<rdar://problem/21104551> Update build settings
[WebKit-https.git] / Source / WTF / ChangeLog
1 2015-05-26  Dan Bernstein  <mitz@apple.com>
2
3         <rdar://problem/21104551> Update build settings
4
5         Reviewed by Anders Carlsson.
6
7         * Configurations/DebugRelease.xcconfig:
8
9 2015-05-23  Dan Bernstein  <mitz@apple.com>
10
11         Remove unused definitions of WEBKIT_VERSION_MIN_REQUIRED
12         https://bugs.webkit.org/show_bug.cgi?id=145345
13
14         Reviewed by Sam Weinig.
15
16         * Configurations/Base.xcconfig: Also changed to use $(inherited).
17
18 2015-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
19
20         Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
21         https://bugs.webkit.org/show_bug.cgi?id=144848
22
23         Reviewed by Darin Adler.
24
25         he current AtomicStringImpl accidentally means the symbol OR atomic StringImpl.
26         t's not correct to its name and it's error prone.
27
28         In this patch, we'll introduce/changes classes into WTF.
29
30         1. UniquedStringImpl
31         It's derived class from StringImpl. And it represents symbol || atomic StringImpl.
32
33         2. SymbolImpl
34         It's derived class from UniquedStringImpl. Only symbol strings can become this.
35         It ensures the given StringImpl is symbol in compile time.
36
37         3. AtomicStringImpl
38         It's derived class from UniquedStringImpl. Only atomic (non-normal && non-symbol) strings can become this.
39         It ensures the given StringImpl is atomic in compile time.
40
41         And, in this time, I just accept UniqueStringImpl in AtomicString. As the result,
42         1. Now AtomicStringImpl issue is fixed. Its SymbolImpl is separated and UniquedStringImpl is introduced.
43         2. But AtomicString still have both symbol and atomic strings.
44         This should be solved in the separated patch.
45
46         * WTF.vcxproj/WTF.vcxproj:
47         * WTF.vcxproj/WTF.vcxproj.filters:
48         * WTF.xcodeproj/project.pbxproj:
49         * wtf/CMakeLists.txt:
50         * wtf/PrintStream.cpp:
51         * wtf/PrintStream.h:
52         (WTF::printInternal):
53         * wtf/text/AtomicString.h:
54         (WTF::AtomicString::AtomicString):
55         * wtf/text/AtomicStringImpl.h:
56         * wtf/text/StringImpl.cpp:
57         (WTF::StringImpl::~StringImpl):
58         (WTF::StringImpl::createSymbol):
59         (WTF::StringImpl::createSymbolEmpty):
60         * wtf/text/StringImpl.h:
61         * wtf/text/SymbolImpl.h: Copied from Source/JavaScriptCore/runtime/PrivateName.h.
62         * wtf/text/SymbolRegistry.cpp:
63         (WTF::SymbolRegistry::symbolForKey):
64         (WTF::SymbolRegistry::keyForSymbol):
65         (WTF::SymbolRegistry::remove):
66         * wtf/text/SymbolRegistry.h:
67         * wtf/text/UniquedStringImpl.h: Copied from Source/JavaScriptCore/runtime/PrivateName.h.
68
69 2015-05-20  Zan Dobersek  <zdobersek@igalia.com>
70
71         [GTK] Move MainThreadGtk, RunLoopGtk, WorkQueueGtk under Source/WTF/wtf/glib/
72         https://bugs.webkit.org/show_bug.cgi?id=145117
73
74         Reviewed by Csaba Osztrogonác.
75
76         Move the MainThreadGtk, RunLoopGtk and WorkQueueGtk implementation files from
77         Source/WTF/wtf/gtk/ to Source/WTF/wtf/glib/. These implementations are not
78         GTK-specific and only depend on GLib, so they are renamed as well.
79
80         There are other such implementations under Source/WTF/wtf/gobject/ (GObject
81         is just a subset of GLib) that will be moved under the new directory in
82         future patches.
83
84         * wtf/PlatformGTK.cmake:
85         * wtf/glib/MainThreadGLib.cpp: Renamed from Source/WTF/wtf/gtk/MainThreadGtk.cpp.
86         (WTF::initializeMainThreadPlatform):
87         (WTF::scheduleDispatchFunctionsOnMainThread):
88         * wtf/glib/RunLoopGLib.cpp: Renamed from Source/WTF/wtf/gtk/RunLoopGtk.cpp.
89         (WTF::RunLoop::RunLoop):
90         (WTF::RunLoop::~RunLoop):
91         (WTF::RunLoop::run):
92         (WTF::RunLoop::stop):
93         (WTF::RunLoop::wakeUp):
94         (WTF::RunLoop::TimerBase::TimerBase):
95         (WTF::RunLoop::TimerBase::~TimerBase):
96         (WTF::RunLoop::TimerBase::start):
97         (WTF::RunLoop::TimerBase::stop):
98         (WTF::RunLoop::TimerBase::isActive):
99         * wtf/glib/WorkQueueGLib.cpp: Renamed from Source/WTF/wtf/gtk/WorkQueueGtk.cpp.
100         (WTF::WorkQueue::platformInitialize):
101         (WTF::WorkQueue::platformInvalidate):
102         (WTF::WorkQueue::registerSocketEventHandler):
103         (WTF::WorkQueue::unregisterSocketEventHandler):
104         (WTF::WorkQueue::dispatch):
105         (WTF::WorkQueue::dispatchAfter):
106
107 2015-05-19  Andreas Kling  <akling@apple.com>
108
109         Give StringView a utf8() API.
110         <https://webkit.org/b/145201>
111
112         Reviewed by Anders Carlsson
113
114         Added an LChar version of StringImpl::utf8ForCharacters() and use that to give
115         StringView a utf8() API just like String has.
116
117         * wtf/text/StringImpl.cpp:
118         (WTF::StringImpl::utf8ForCharacters):
119         * wtf/text/StringImpl.h:
120         * wtf/text/StringView.cpp:
121         (WTF::StringView::utf8):
122         * wtf/text/StringView.h:
123
124 2015-05-19  Yusuke Suzuki  <utatane.tea@gmail.com>
125
126         Move AtomicStringImpl table related operations from AtomicString to AtomicStringImpl
127         https://bugs.webkit.org/show_bug.cgi?id=145109
128
129         Reviewed by Darin Adler.
130
131         Now AtomicStringImpl table operations are located in AtomicString.
132         But they should be under AtomicStringImpl.
133         This patch simply moves these operations to AtomicStringImpl.
134
135         And this patch renames static AtomicString::find to static AtomicStringImpl::lookUp
136         because it conflicts with AtomicStringImpl's member function name.
137
138         * WTF.vcxproj/WTF.vcxproj:
139         * WTF.vcxproj/WTF.vcxproj.filters:
140         * WTF.vcxproj/copy-files.cmd:
141         * WTF.xcodeproj/project.pbxproj:
142         * wtf/CMakeLists.txt:
143         * wtf/PlatformMac.cmake:
144         * wtf/PlatformWin.cmake:
145         * wtf/text/AtomicString.cpp:
146         (WTF::AtomicString::lower):
147         (WTF::AtomicString::convertToASCIILowercase):
148         (WTF::AtomicString::fromUTF8Internal):
149         (WTF::AtomicStringTableLocker::AtomicStringTableLocker): Deleted.
150         (WTF::stringTable): Deleted.
151         (WTF::addToStringTable): Deleted.
152         (WTF::CStringTranslator::hash): Deleted.
153         (WTF::CStringTranslator::equal): Deleted.
154         (WTF::CStringTranslator::translate): Deleted.
155         (WTF::AtomicString::add): Deleted.
156         (WTF::UCharBufferTranslator::hash): Deleted.
157         (WTF::UCharBufferTranslator::equal): Deleted.
158         (WTF::UCharBufferTranslator::translate): Deleted.
159         (WTF::HashAndCharactersTranslator::hash): Deleted.
160         (WTF::HashAndCharactersTranslator::equal): Deleted.
161         (WTF::HashAndCharactersTranslator::translate): Deleted.
162         (WTF::HashAndUTF8CharactersTranslator::hash): Deleted.
163         (WTF::HashAndUTF8CharactersTranslator::equal): Deleted.
164         (WTF::HashAndUTF8CharactersTranslator::translate): Deleted.
165         (WTF::SubstringTranslator::translate): Deleted.
166         (WTF::SubstringTranslator8::hash): Deleted.
167         (WTF::SubstringTranslator8::equal): Deleted.
168         (WTF::SubstringTranslator16::hash): Deleted.
169         (WTF::SubstringTranslator16::equal): Deleted.
170         (WTF::LCharBufferTranslator::hash): Deleted.
171         (WTF::LCharBufferTranslator::equal): Deleted.
172         (WTF::LCharBufferTranslator::translate): Deleted.
173         (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
174         (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
175         (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
176         (WTF::AtomicString::addFromLiteralData): Deleted.
177         (WTF::AtomicString::addSlowCase): Deleted.
178         (WTF::AtomicString::remove): Deleted.
179         (WTF::AtomicString::findSlowCase): Deleted.
180         (WTF::AtomicString::findInternal): Deleted.
181         (WTF::AtomicString::isInAtomicStringTable): Deleted.
182         * wtf/text/AtomicString.h:
183         (WTF::AtomicString::AtomicString):
184         (WTF::AtomicString::fromUTF8):
185         (WTF::AtomicString::find): Deleted.
186         (WTF::AtomicString::add): Deleted.
187         (WTF::AtomicString::addWithStringTableProvider): Deleted.
188         * wtf/text/AtomicStringImpl.cpp: Copied from Source/WTF/wtf/text/AtomicString.cpp.
189         (WTF::AtomicStringTableLocker::AtomicStringTableLocker):
190         (WTF::stringTable):
191         (WTF::addToStringTable):
192         (WTF::CStringTranslator::hash):
193         (WTF::CStringTranslator::equal):
194         (WTF::CStringTranslator::translate):
195         (WTF::AtomicStringImpl::add):
196         (WTF::UCharBufferTranslator::hash):
197         (WTF::UCharBufferTranslator::equal):
198         (WTF::UCharBufferTranslator::translate):
199         (WTF::HashAndCharactersTranslator::hash):
200         (WTF::HashAndCharactersTranslator::equal):
201         (WTF::HashAndCharactersTranslator::translate):
202         (WTF::HashAndUTF8CharactersTranslator::hash):
203         (WTF::HashAndUTF8CharactersTranslator::equal):
204         (WTF::HashAndUTF8CharactersTranslator::translate):
205         (WTF::SubstringTranslator::translate):
206         (WTF::SubstringTranslator8::hash):
207         (WTF::SubstringTranslator8::equal):
208         (WTF::SubstringTranslator16::hash):
209         (WTF::SubstringTranslator16::equal):
210         (WTF::LCharBufferTranslator::hash):
211         (WTF::LCharBufferTranslator::equal):
212         (WTF::LCharBufferTranslator::translate):
213         (WTF::CharBufferFromLiteralDataTranslator::hash):
214         (WTF::CharBufferFromLiteralDataTranslator::equal):
215         (WTF::CharBufferFromLiteralDataTranslator::translate):
216         (WTF::AtomicStringImpl::addLiteral):
217         (WTF::AtomicStringImpl::addSlowCase):
218         (WTF::AtomicStringImpl::remove):
219         (WTF::AtomicStringImpl::lookUpSlowCase):
220         (WTF::AtomicStringImpl::addUTF8):
221         (WTF::AtomicStringImpl::lookUpInternal):
222         (WTF::AtomicStringImpl::isInAtomicStringTable):
223         * wtf/text/AtomicStringImpl.h:
224         (WTF::AtomicStringImpl::lookUp):
225         (WTF::AtomicStringImpl::add):
226         (WTF::AtomicStringImpl::addWithStringTableProvider):
227         (WTF::AtomicStringImpl::AtomicStringImpl): Deleted.
228         * wtf/text/StringImpl.cpp:
229         (WTF::StringImpl::~StringImpl):
230         * wtf/text/StringImpl.h:
231         * wtf/text/WTFString.h:
232         (WTF::String::String):
233         * wtf/text/cf/AtomicStringCF.cpp:
234         (WTF::AtomicString::add): Deleted.
235         * wtf/text/cf/AtomicStringImplCF.cpp: Renamed from Source/WTF/wtf/text/cf/AtomicStringCF.cpp.
236         (WTF::AtomicStringImpl::add):
237
238 2015-05-19  Ting-Wei Lan  <lantw44@gmail.com>
239
240         [SOUP] Use st_birthtime to get creation time of files on systems support it
241         https://bugs.webkit.org/show_bug.cgi?id=144989
242
243         Reviewed by Carlos Garcia Campos.
244
245         Define HAVE(STAT_BIRTHTIME) as 1 on operating systems supporting
246         getting creation time of files using st_birthtime in stat.
247
248         * wtf/Platform.h:
249
250 2015-05-19  Chris Dumez  <cdumez@apple.com>
251
252         Mark static variables as const when possible
253         https://bugs.webkit.org/show_bug.cgi?id=145161
254
255         Reviewed by Andreas Kling.
256
257         * wtf/dtoa.cpp:
258         (WTF::pow5mult):
259
260 2015-05-19  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
261
262         [EFL] Remove unnecessary PLATFORM(EFL) macro in EFL specific files
263         https://bugs.webkit.org/show_bug.cgi?id=145160
264
265         Reviewed by Csaba Osztrogonác.
266
267         * wtf/efl/EflTypedefs.h: Remove PLATFORM(EFL).
268         * wtf/efl/UniquePtrEfl.h: ditto.
269
270 2015-05-18  Michael Catanzaro  <mcatanzaro@igalia.com>
271
272         [CMake] Ignore warnings in system headers
273         https://bugs.webkit.org/show_bug.cgi?id=144747
274
275         Reviewed by Darin Adler.
276
277         Separate include directories into WebKit project includes and system includes. Suppress all
278         warnings from headers in system include directories using the SYSTEM argument to
279         the include_directories command.
280
281         * wtf/CMakeLists.txt:
282         * wtf/PlatformEfl.cmake:
283         * wtf/PlatformGTK.cmake:
284
285 2015-05-18  Myles C. Maxfield  <mmaxfield@apple.com>
286
287         Addressing post-review comments on r184353
288         https://bugs.webkit.org/show_bug.cgi?id=145146
289
290         Reviewed by Benjamin Poulain.
291
292         Create an overload for equalIgnoringASCIICase() for AtomicString and string literals.
293
294         * wtf/text/AtomicString.h:
295         (WTF::equalIgnoringASCIICase):
296
297 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
298
299         [ES6] Arrow function syntax. Feature flag for arrow function
300         https://bugs.webkit.org/show_bug.cgi?id=145108
301
302         Reviewed by Ryosuke Niwa.
303
304         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
305
306         * wtf/FeatureDefines.h:
307
308 2015-05-17  Benjamin Poulain  <benjamin@webkit.org>
309
310         Do not use fastMallocGoodSize anywhere
311         https://bugs.webkit.org/show_bug.cgi?id=145103
312
313         Reviewed by Michael Saboff.
314
315         It is silly we see fastMallocGoodSize in profiles, it does absolutely nothing.
316
317         This patch keeps fastMallocGoodSize() around for older code linking
318         with newer WebKit, but remove any use of it inside WebKit.
319
320         * wtf/FastMalloc.cpp:
321         (WTF::fastMallocGoodSize):
322         * wtf/FastMalloc.h:
323         * wtf/Vector.h:
324         (WTF::VectorBufferBase::allocateBuffer):
325         (WTF::VectorBufferBase::tryAllocateBuffer):
326         (WTF::VectorBufferBase::reallocateBuffer):
327
328 2015-05-15  Dan Bernstein  <mitz@apple.com>
329
330         Build fix for some versions of clang.
331
332         * wtf/SaturatedArithmetic.h:
333         (signedAddOverflows):
334         (signedSubtractOverflows):
335
336 2015-05-14  Dan Bernstein  <mitz@apple.com>
337
338         Reverted r177753, now that <rdar://problem/19347133> is fixed.
339
340         Rubber-stamped by Benjamin Poulain.
341
342         * wtf/SaturatedArithmetic.h:
343         (signedAddOverflows):
344         (signedSubtractOverflows):
345
346 2015-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
347
348         Add String literal overloads to equalIgnoringASCIICase()
349         https://bugs.webkit.org/show_bug.cgi?id=145008
350
351         Reviewed by Benjamin Poulain.
352
353         Create an overload for equalIgnoringASCIICase for string literals.
354
355         * wtf/text/StringImpl.h:
356         (WTF::equalIgnoringASCIICase): Use a non-templated helper function.
357         * wtf/text/StringImpl.cpp:
358         (WTF::equalIgnoringASCIICase): Implement it.
359         * wtf/text/StringView.h:
360         (WTF::equalIgnoringASCIICase): Use a non-templated helper function.
361         * wtf/text/StringView.cpp:
362         (WTF::equalIgnoringASCIICase): Implement it.
363         * wtf/text/WTFString.h:
364         (WTF::equalIgnoringASCIICase): Delegate to StringImpl's implementation.
365
366 2015-05-14  Žan Doberšek  <zdobersek@igalia.com>
367
368         [GTK] RunLoop constructor should properly retrieve or establish the thread-default GMainContext
369         https://bugs.webkit.org/show_bug.cgi?id=144732
370
371         Reviewed by Carlos Garcia Campos.
372
373         RunLoop constructor in the GTK implementation should use the
374         existing thread-default context, create a new one if not on
375         the main thread, or use the global-default one if on the main
376         thread.
377
378         In RunLoop::run(), the GMainContext should then be pushed as
379         the thread-default before calling g_main_loop_run(), and popped
380         off when the main loop stops.
381
382         * wtf/gtk/RunLoopGtk.cpp:
383         (WTF::RunLoop::RunLoop):
384         (WTF::RunLoop::run):
385
386 2015-05-13  Oliver Hunt  <oliver@apple.com>
387        Ensure that all the smart pointer types in WTF clear their pointer before deref
388        https://bugs.webkit.org/show_bug.cgi?id=143789
389
390        Reviewed by Ryosuke Niwa.
391
392        In order to prevent use after free bugs caused by destructors
393        that end up trying to access the smart pointer itself, we should
394        make sure we always clear the m_ptr field before calling deref.
395
396        Essentially the UaF path is:
397        struct Foo : RefCounted<Foo> {
398          Wibble* m_wibble;
399          void doSomething();
400          ~Foo() { m_wibble->doSomethingLikeCleanup(); }
401        };
402
403        struct Wibble {
404          void doSomethingLikeCleanup()
405          {
406            if (m_foo) {
407                /* if this branch is not here we get a null deref */
408                m_foo->doSomething();
409            }
410          }
411          void replaceFoo(Foo* foo) { m_foo = foo; }
412          RefPtr<Foo> m_foo;
413        };
414
415        Wibble* someWibble = /* a Wibble with m_foo->m_refCount == 1 */;
416                             /* and m_foo points to someWibble       */;
417
418        someWibble->replaceFoo(someOtherFoo);
419        + someWibble->m_foo->m_ptr->deref();
420          + someWibble->m_foo->m_ptr->~Foo()
421            + someWibble->m_foo->m_ptr->m_wibble->doSomethingLikeCleanup()
422              + someWibble->m_foo->m_ptr->m_wibble /* someWibble */ ->m_foo->m_ptr /*logically dead*/ ->doSomething()
423
424        By clearing m_ptr first we either force a null pointer deref or
425        we force our code down a path that does not use the dead smart
426        pointer.
427
428        * wtf/PassRefPtr.h:
429        (WTF::PassRefPtr::~PassRefPtr):
430        * wtf/Ref.h:
431        (WTF::Ref::~Ref):
432        (WTF::Ref::operator=):
433        * wtf/RefPtr.h:
434        (WTF::RefPtr::~RefPtr):
435        * wtf/RetainPtr.h:
436        (WTF::RetainPtr::~RetainPtr):
437        (WTF::RetainPtr<T>::clear):
438
439 2015-05-12  Michael Saboff  <msaboff@apple.com>
440
441         If JSC cannot get executable memory, it shouldn't call madvise
442         https://bugs.webkit.org/show_bug.cgi?id=144931
443
444         Reviewed by Mark Lam.
445
446         Made calling madvise conditional on really getting mmapped memory.
447
448         * wtf/OSAllocatorPosix.cpp:
449         (WTF::OSAllocator::reserveUncommitted):
450
451 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
452
453         [Win] Move Windows build target to Windows 7 (or newer)
454         https://bugs.webkit.org/show_bug.cgi?id=144890
455         <rdar://problem/20707307>
456
457         Reviewed by Anders Carlsson.
458
459         Update linked SDK and minimal Windows level to be compatible with
460         Windows 7 or newer.
461
462         * WTF.vcxproj/WTF.vcxproj:
463         * WTF.vcxproj/WTFGenerated.vcxproj:
464         * config.h:
465
466 2015-05-11  Carlos Garcia Campos  <cgarcia@igalia.com>
467
468         [GTK] WorkQueue objects are not released
469         https://bugs.webkit.org/show_bug.cgi?id=144824
470
471         Reviewed by Žan Doberšek.
472
473         Do not keep a reference of the WorkQueue for the entire life of
474         its worker thread, since every task scheduled on the WorkQueue
475         already takes a reference. Instead, take a reference of the main
476         loop to make sure that when the worker thread starts, the main
477         loop hasn't been released to avoid runtime warnings (see
478         webkit.org/b/140998). Also removed the g_main_context_pop_thread_default()
479         from the thread body, since the thread-specific context queue will
480         be freed anyway when the thread exits.
481         If the WorkQueue is released early, before the thread has started,
482         schedule a main loop quit in the context, to make sure it will
483         be the first thing run by the main loop and the thread will exit.
484
485         * wtf/WorkQueue.h: Remove unused event loop mutex.
486         * wtf/gtk/WorkQueueGtk.cpp:
487         (WTF::WorkQueue::platformInitialize):
488         (WTF::WorkQueue::platformInvalidate):
489
490 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
491
492         Remove the PICTURE_SIZES build flag
493         https://bugs.webkit.org/show_bug.cgi?id=144679
494
495         Reviewed by Benjamin Poulain.
496
497         Removed the PICTURE_SIZES build time flag.
498
499         * wtf/FeatureDefines.h:
500
501 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
502
503         Remove convenience constructors for TextRun
504         https://bugs.webkit.org/show_bug.cgi?id=144752
505
506         Reviewed by Anders Carlsson.
507
508         No reason why StringView shouldn't have a StringImpl* constructor.
509
510         Test: StringView8Bit in TestWebKitAPI
511
512         * wtf/text/StringView.h: Add the constructor.
513
514 2015-05-08  Commit Queue  <commit-queue@webkit.org>
515
516         Unreviewed, rolling out r183996.
517         https://bugs.webkit.org/show_bug.cgi?id=144806
518
519         ASan detected use-after free (Requested by ap on #webkit).
520
521         Reverted changeset:
522
523         "Remove convenience constructors for TextRun"
524         https://bugs.webkit.org/show_bug.cgi?id=144752
525         http://trac.webkit.org/changeset/183996
526
527 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
528
529         Remove convenience constructors for TextRun
530         https://bugs.webkit.org/show_bug.cgi?id=144752
531
532         Reviewed by Anders Carlsson.
533
534         No reason why StringView shouldn't have a StringImpl* constructor.
535
536         Test: StringView8Bit in TestWebKitAPI
537
538         * wtf/text/StringView.h: Add the constructor.
539
540 2015-05-08  Andreas Kling  <akling@apple.com>
541
542         Optimize serialization of quoted JSON strings.
543         <https://webkit.org/b/144754>
544
545         Reviewed by Darin Adler.
546
547         Add a StringBuilder API for appending a quoted JSON string. This is used by
548         JSON.stringify() to implement efficient appending of strings while escaping
549         quotes, control characters and \uNNNN-style characters.
550
551         The main benefit comes from only doing a single buffer expansion up front,
552         instead of doing it every time we append something. The fudge factor is pretty
553         large, since the maximum number of output characters per input character is 6.
554
555         The first landing of this patch had two bugs in it:
556
557         - Made \uNNNN escapes uppercase hexadecimal instead of lowercase.
558         - Didn't preallocate enough space for 8-bit input strings.
559
560         Both were caught by existing tests on our bots, and both were due to last-minute
561         changes before landing. :/
562
563         * wtf/text/StringBuilder.cpp:
564         (WTF::appendQuotedJSONStringInternal):
565         (WTF::StringBuilder::appendQuotedJSONString):
566         * wtf/text/StringBuilder.h:
567
568 2015-05-07  Commit Queue  <commit-queue@webkit.org>
569
570         Unreviewed, rolling out r183961.
571         https://bugs.webkit.org/show_bug.cgi?id=144784
572
573         Broke js/dom/JSON-stringify.html (Requested by kling on
574         #webkit).
575
576         Reverted changeset:
577
578         "Optimize serialization of quoted JSON strings."
579         https://bugs.webkit.org/show_bug.cgi?id=144754
580         http://trac.webkit.org/changeset/183961
581
582 2015-05-07  Andreas Kling  <akling@apple.com>
583
584         Optimize serialization of quoted JSON strings.
585         <https://webkit.org/b/144754>
586
587         Reviewed by Darin Adler.
588
589         Add a StringBuilder API for appending a quoted JSON string. This is used by
590         JSON.stringify() to implement efficient appending of strings while escaping
591         quotes, control characters and \uNNNN-style characters.
592
593         The main benefit comes from only doing a single buffer expansion up front,
594         instead of doing it every time we append something. The fudge factor is pretty
595         large for 16-bit strings, since the maximum number of output characters per
596         input character is 6.
597
598         * wtf/text/StringBuilder.cpp:
599         (WTF::appendQuotedJSONStringInternal):
600         (WTF::StringBuilder::appendQuotedJSONString):
601         * wtf/text/StringBuilder.h:
602
603 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
604
605         [GTK] All spell checking layout tests fail
606         https://bugs.webkit.org/show_bug.cgi?id=144648
607
608         Reviewed by Carlos Garcia Campos.
609
610         * wtf/Platform.h: Activate UNIFIED_TEXT_CHECKING for GTK+.
611
612 2015-05-07  Dan Bernstein  <mitz@apple.com>
613
614         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
615         https://bugs.webkit.org/show_bug.cgi?id=144727
616
617         Reviewed by Darin Adler.
618
619         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig, and define
620         INSTALL_PATH_PREFIX and LD_DYLIB_INSTALL_NAME for the iOS 8.x Simulator.
621
622 2015-05-07  Žan Doberšek  <zdobersek@igalia.com>
623
624         [GTK] Clean up RunLoop implementation
625         https://bugs.webkit.org/show_bug.cgi?id=144729
626
627         Reviewed by Carlos Garcia Campos.
628
629         Clean up the RunLoop implementation for the GTK port,
630         removing unnecessary methods and using simpler variable names.
631
632         Nested GMainLoops in RunLoop::run() are now created for the
633         RunLoop's GMainContext, and not for the default context (enforced
634         through the null argument to g_main_loop_new()).
635
636         * wtf/RunLoop.h:
637         * wtf/gtk/RunLoopGtk.cpp:
638         (WTF::RunLoop::RunLoop):
639         (WTF::RunLoop::~RunLoop):
640         (WTF::RunLoop::run):
641         (WTF::RunLoop::stop):
642         (WTF::RunLoop::wakeUp):
643         (WTF::RunLoop::TimerBase::start):
644         (WTF::RunLoop::innermostLoop): Deleted.
645         (WTF::RunLoop::pushNestedMainLoop): Deleted.
646         (WTF::RunLoop::popNestedMainLoop): Deleted.
647
648 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
649
650         [GTK] Async operations running in the WorkQueue thread should schedule their sources to the WorkQueue main lopp
651         https://bugs.webkit.org/show_bug.cgi?id=144541
652
653         Reviewed by Žan Doberšek.
654
655         They are currently sent to the main thread run loop, because we
656         are not setting the WorkQueue main context as the default one in
657         the worker thread.
658
659         * wtf/gtk/WorkQueueGtk.cpp:
660         (WTF::WorkQueue::platformInitialize): Call
661         g_main_context_push_thread_default() to set the WorkQueue main
662         context as the default of the thread before running the main loop,
663         and g_main_context_pop_thread_default() when the main loop quits.
664
665 2015-05-04  Commit Queue  <commit-queue@webkit.org>
666
667         Unreviewed, rolling out r183661.
668         https://bugs.webkit.org/show_bug.cgi?id=144594
669
670         Caused ~3.5MB regression on membuster(!) (Requested by kling_
671         on #webkit).
672
673         Reverted changeset:
674
675         "Decrease minimum Vector size."
676         https://bugs.webkit.org/show_bug.cgi?id=144453
677         http://trac.webkit.org/changeset/183661
678
679 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
680
681         [WTF] Remove Functional.h inclusions
682         https://bugs.webkit.org/show_bug.cgi?id=144400
683
684         Reviewed by Darin Adler.
685
686         Remove most of the Functional.h header inclusions. The header is preserved
687         since it's still used by older versions of Safari, and for the callOnMainThread()
688         stub in DeprecatedSymbolsUsedBySafari.mm.
689
690         * wtf/MainThread.cpp:
691         * wtf/RunLoop.h:
692         * wtf/WorkQueue.cpp:
693         * wtf/WorkQueue.h:
694         * wtf/efl/DispatchQueueEfl.h:
695         * wtf/efl/DispatchQueueWorkItemEfl.h:
696
697 2015-05-02  Commit Queue  <commit-queue@webkit.org>
698
699         Unreviewed, rolling out r183722.
700         https://bugs.webkit.org/show_bug.cgi?id=144534
701
702         Made all the tests assert (Requested by ap on #webkit).
703
704         Reverted changeset:
705
706         "Generated static StringImpls should have static flag set."
707         https://bugs.webkit.org/show_bug.cgi?id=144516
708         http://trac.webkit.org/changeset/183722
709
710 2015-05-02  Andreas Kling  <akling@apple.com>
711
712         Generated static StringImpls should have static flag set.
713         <https://webkit.org/b/144516>
714
715         Reviewed by Darin Adler.
716
717         Discovered this while tracking down a string ref leak. Turns out that the strings
718         generated by StaticString.pm were not getting the static flag set on them.
719
720         The only practical difference from this AFAICT is that now the garbage collector
721         will correctly see that these strings have no extra memory cost to worry about.
722
723         * wtf/text/StringImpl.h:
724
725 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
726
727         USE(...) macro should expect unprefixed variables
728         https://bugs.webkit.org/show_bug.cgi?id=144454
729
730         Reviewed by Daniel Bates.
731
732         * wtf/Assertions.cpp: Replace all occurrences WTF_USE with USE.
733         * wtf/Platform.h: Replace all occurrences WTF_USE with USE. Modify the USE
734         macro to look for unprefixed variables.
735         * wtf/WTFThreadData.h: Replace all occurrences WTF_USE with USE.
736
737 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
738
739         Enable ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX by default on all ports (Windows was missed)
740         https://bugs.webkit.org/show_bug.cgi?id=144495
741
742         Reviewed by Csaba Osztrogonác.
743
744         * wtf/FeatureDefines.h:
745         This covers all ports that haven't defined the flag otherwise.
746
747 2015-04-30  Alex Christensen  <achristensen@webkit.org>
748
749         Decrease minimum Vector size.
750         https://bugs.webkit.org/show_bug.cgi?id=144453
751
752         Reviewed by Andreas Kling.
753
754         * wtf/Vector.h:
755         Make the default min size 4 to save memory on small Vectors.
756
757 2015-04-30  Yusuke Suzuki  <utatane.tea@gmail.com>
758
759         Use the default hash value for Symbolized StringImpl
760         https://bugs.webkit.org/show_bug.cgi?id=144347
761
762         Reviewed by Darin Adler.
763
764         Use a default hash value calculation for symbolized StringImpl.
765
766         * wtf/text/StringImpl.cpp:
767         (WTF::StringImpl::createSymbol):
768         * wtf/text/StringImpl.h:
769         (WTF::StringImpl::StringImpl):
770         (WTF::StringImpl::symbolAwareHash):
771         (WTF::StringImpl::existingSymbolAwareHash):
772         (WTF::StringImpl::hashForSymbol):
773         * wtf/text/StringStatics.cpp:
774         (WTF::StringImpl::nextHashForSymbol):
775         (WTF::StringImpl::hashAndFlagsForSymbol): Deleted.
776
777 2015-04-29  Alexey Proskuryakov  <ap@apple.com>
778
779         LazyNeverDestroyed is not thread safe in debug builds, causing assertions
780         https://bugs.webkit.org/show_bug.cgi?id=144378
781
782         Reviewed by Darin Adler.
783
784         * wtf/NeverDestroyed.h:
785
786 2015-04-28  Geoffrey Garen  <ggaren@apple.com>
787
788         It shouldn't take 1846 lines of code and 5 FIXMEs to sort an array.
789         https://bugs.webkit.org/show_bug.cgi?id=144013
790
791         Reviewed by Mark Lam.
792
793         Remove this custom tree implementation because it is unused. (It was
794         previously used to achieve a stable array sort in certain cases.)
795
796         * WTF.vcxproj/WTF.vcxproj:
797         * WTF.vcxproj/WTF.vcxproj.filters:
798         * WTF.xcodeproj/project.pbxproj:
799         * wtf/AVLTree.h: Removed.
800         * wtf/CMakeLists.txt:
801
802 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
803
804         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
805         https://bugs.webkit.org/show_bug.cgi?id=132159
806
807         Reviewed by Darin Adler.
808
809         * wtf/Platform.h:
810
811         Opt-in using ENABLE(PLATFORM_FONT_LOOKUP)
812
813 2015-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>
814
815         REGRESSION (r183373): ASSERT failed in wtf/SHA1.h
816         https://bugs.webkit.org/show_bug.cgi?id=144257
817
818         Reviewed by Darin Adler.
819
820         * wtf/SHA1.h:
821         (WTF::SHA1::addBytes):
822
823 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
824
825         [CMake] [GTK] Organize and clean up unused CMake variables
826         https://bugs.webkit.org/show_bug.cgi?id=144364
827
828         Reviewed by Gyuyoung Kim.
829
830         * wtf/PlatformGTK.cmake: Add variables specific to this project.
831
832 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
833
834         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
835         https://bugs.webkit.org/show_bug.cgi?id=144304
836
837         Reviewed by Geoffrey Garen.
838
839         No longer check ENABLE_LLINT_C_LOOP to determine the value of ENABLE_JIT.
840
841         * wtf/Platform.h:
842
843 2015-04-28  Commit Queue  <commit-queue@webkit.org>
844
845         Unreviewed, rolling out r183514.
846         https://bugs.webkit.org/show_bug.cgi?id=144359
847
848         It broke cloop test bots (Requested by mcatanzaro on #webkit).
849
850         Reverted changeset:
851
852         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
853         https://bugs.webkit.org/show_bug.cgi?id=144304
854         http://trac.webkit.org/changeset/183514
855
856 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
857
858         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
859         https://bugs.webkit.org/show_bug.cgi?id=144304
860
861         Reviewed by Geoffrey Garen.
862
863         No longer check ENABLE_LLINT_C_LOOP to determine the value of ENABLE_JIT.
864
865         * wtf/Platform.h:
866
867 2015-04-28  Alex Christensen  <achristensen@webkit.org>
868
869         Properly reset deleted count when clearing HashTables.
870         https://bugs.webkit.org/show_bug.cgi?id=144343
871
872         Reviewed by Andreas Kling.
873
874         * wtf/HashTable.h:
875         (WTF::KeyTraits>::clear):
876         Reset m_deletedCount, which appears to have been forgotten.
877
878 2015-04-28  Alex Christensen  <achristensen@webkit.org>
879
880         [Content Extensions] Use less memory for CombinedURLFilters.
881         https://bugs.webkit.org/show_bug.cgi?id=144290
882
883         Reviewed by Andreas Kling.
884
885         * wtf/Forward.h:
886         * wtf/Vector.h:
887         Added a minCapacity template parameter to allow changing the minimum size of an 
888         allocated buffer. The default minCapacity is kept at 16 unless otherwise specified 
889         to have no change on existing code, but this could be changed later. A smaller 
890         default minCapacity would use less memory with small Vectors but spend more time 
891         copying when expanding to large Vectors.
892
893 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
894
895         [Win] Deactivate WebGL until Windows tests work properly
896         https://bugs.webkit.org/show_bug.cgi?id=144291
897         <rdar://problem/20707307>
898
899         Reviewed by Zalan Bujtas.
900
901         * wtf/FeatureDefines.h: Force WebGL off for Windows builds.
902
903 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
904
905         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
906         https://bugs.webkit.org/show_bug.cgi?id=144193
907
908         Reviewed by Darin Adler.
909
910         * wtf/FeatureDefines.h:
911         * wtf/Platform.h:
912
913 2015-04-22  Martin Robinson  <mrobinson@igalia.com>
914
915         [CMake] Autogenerate cmakeconfig.h.cmake
916         https://bugs.webkit.org/show_bug.cgi?id=143997
917
918         Reviewed by Csaba Osztrogonác.
919
920         * wtf/Platform.h: Move a GTK-specific setting from cmakeconfig.h to here.
921
922 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
923
924         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
925         https://bugs.webkit.org/show_bug.cgi?id=144182
926
927         Reviewed by Simon Fraser.
928
929         * wtf/FeatureDefines.h: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
930
931 2015-04-24  Commit Queue  <commit-queue@webkit.org>
932
933         Unreviewed, rolling out r183288.
934         https://bugs.webkit.org/show_bug.cgi?id=144189
935
936         Made js/sort-with-side-effecting-comparisons.html time out in
937         debug builds (Requested by ap on #webkit).
938
939         Reverted changeset:
940
941         "It shouldn't take 1846 lines of code and 5 FIXMEs to sort an
942         array."
943         https://bugs.webkit.org/show_bug.cgi?id=144013
944         http://trac.webkit.org/changeset/183288
945
946 2015-04-21  Geoffrey Garen  <ggaren@apple.com>
947
948         It shouldn't take 1846 lines of code and 5 FIXMEs to sort an array.
949         https://bugs.webkit.org/show_bug.cgi?id=144013
950
951         Reviewed by Mark Lam.
952
953         Remove this custom tree implementation because it is unused. (It was
954         previously used to achieve a stable array sort in certain cases.)
955
956         * WTF.vcxproj/WTF.vcxproj:
957         * WTF.vcxproj/WTF.vcxproj.filters:
958         * WTF.xcodeproj/project.pbxproj:
959         * wtf/AVLTree.h: Removed.
960         * wtf/CMakeLists.txt:
961
962 2015-04-24  Darin Adler  <darin@apple.com>
963
964         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
965         https://bugs.webkit.org/show_bug.cgi?id=128007
966
967         Reviewed by Anders Carlsson.
968
969         * WTF.vcxproj/WTF.vcxproj: Removed OwnPtr source files.
970         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
971         * WTF.xcodeproj/project.pbxproj: Ditto.
972         * wtf/CMakeLists.txt: Ditto.
973
974         * wtf/Forward.h: Removed OwnPtr and PassOwnPtr.
975         * wtf/HashTraits.h: Ditto.
976
977         * wtf/OwnPtr.h: Removed.
978         * wtf/OwnPtrCommon.h: Removed.
979         * wtf/PassOwnPtr.h: Removed.
980
981         * wtf/SizeLimits.cpp: Removed OwnPtr.
982         * wtf/VectorTraits.h: Removed OwnPtr specialization.
983
984 2015-04-23  Jer Noble  <jer.noble@apple.com>
985
986         Disable HAVE_AVKIT on AppleTV
987         https://bugs.webkit.org/show_bug.cgi?id=144142
988
989         Reviewed by Dan Bernstein.
990
991         * wtf/Platform.h:
992
993 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
994
995         [iOS] WebKit services should inherit environment variables for home
996         https://bugs.webkit.org/show_bug.cgi?id=144078
997         rdar://problem/20571678
998
999         Reviewed by Dan Bernstein.
1000
1001         * wtf/spi/darwin/XPCSPI.h: Added xpc_copy_bootstrap and xpc_dictionary_apply.
1002
1003 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
1004
1005         Undo the WTF part of the previous build fix, we don't use private headers in WTF.
1006
1007         * WTF.xcodeproj/project.pbxproj:
1008
1009 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
1010
1011         Build fix.
1012
1013         * WTF.xcodeproj/project.pbxproj: Make RAMSize.h a private header, now that it's used
1014         from outside WTF.
1015
1016 2015-04-23  Andreas Kling  <akling@apple.com>
1017
1018         There should only be one way to get the system memory size.
1019         <https://webkit.org/b/144081>
1020
1021         Reviewed by Antti Koivisto.
1022
1023         Merge all the logic from other RAM size fetcher helpers into WTF's.
1024
1025         Darwin ports now use host_info() instead of sysctl(), since that was the more common way
1026         of doing this.
1027
1028         Also bumped the fallback answer from 128 MB to 512 MB to bring it closer to today's hardware.
1029
1030         Finally, the number is rounded up to the next multiple of 128 MB, to avoid misunderstandings
1031         on some systems where the number returned by the kernel is slightly lower than the marketing
1032         number. Removed the "fudging" that was used in some places, since this fixes that cleanly.
1033
1034         * wtf/RAMSize.cpp:
1035         (WTF::computeRAMSize):
1036
1037 2015-04-22  Darin Adler  <darin@apple.com>
1038
1039         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
1040         https://bugs.webkit.org/show_bug.cgi?id=143949
1041
1042         Reviewed by Andreas Kling.
1043
1044         * wtf/MathExtras.h:
1045         (wtf_ceil): Deleted. This was a workaround for a bug that was introduced in Leopard and
1046         fixed in Snow Leopard <rdar://problem/6286405>, so we don't need the workaround any more.
1047
1048 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
1049
1050         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
1051         https://bugs.webkit.org/show_bug.cgi?id=144052
1052         rdar://problem/19754404
1053
1054         Build fix. Landing a forward declaration that should have been part of the original patch.
1055
1056         * wtf/spi/darwin/XPCSPI.h:
1057
1058 2015-04-21  Chris Dumez  <cdumez@apple.com>
1059
1060         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
1061         https://bugs.webkit.org/show_bug.cgi?id=143970
1062
1063         Reviewed by Darin Adler.
1064
1065         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
1066         constructor explicit as it copies the vector and it is easy to call it
1067         by mistake.
1068
1069         * wtf/RefCountedArray.h:
1070         (WTF::RefCountedArray::RefCountedArray):
1071         * wtf/Vector.h:
1072
1073 2015-04-21  Darin Adler  <darin@apple.com>
1074
1075         Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template definitions and traits)
1076         https://bugs.webkit.org/show_bug.cgi?id=143944
1077
1078         Reviewed by Andreas Kling.
1079
1080         * wtf/FilePrintStream.h: Removed unneeded include.
1081         * wtf/HashTable.h: Fixed class template name in comment.
1082         * wtf/HashTraits.h: Removed unneeded forward declaration.
1083         * wtf/ListHashSet.h: Removed unneeded includes.
1084         * wtf/ThreadingWin.cpp: Removed unneeded includes.
1085         (WTF::wtfThreadEntryPoint): Changed code to use unique_ptr.
1086         (WTF::createThreadInternal): Changed code to use make_unique and release.
1087         * wtf/efl/RunLoopEfl.cpp: Removed unneeded includes.
1088
1089 2015-04-19  Darin Adler  <darin@apple.com>
1090
1091         Update RefPtr documentation and deprecation
1092         https://bugs.webkit.org/show_bug.cgi?id=143936
1093
1094         Reviewed by Andreas Kling.
1095
1096         * WTF.vcxproj/WTF.vcxproj: Removed PassRef.h
1097         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
1098         * WTF.xcodeproj/project.pbxproj: Ditto.
1099         * wtf/CMakeLists.txt: Ditto.
1100
1101 2015-04-17  Alexey Proskuryakov  <ap@apple.com>
1102
1103         Use ASan poisoning to taint moved-out-of Refs
1104         https://bugs.webkit.org/show_bug.cgi?id=143894
1105         rdar://problem/19443723
1106
1107         Reviewed by Darin Adler.
1108
1109         * wtf/Ref.h: (WTF::Ref::~Ref):
1110
1111 2015-04-17  Alexey Proskuryakov  <ap@apple.com>
1112
1113         Remove unused BoundsCheckedPointer
1114         https://bugs.webkit.org/show_bug.cgi?id=143896
1115
1116         Reviewed by Geoffrey Garen.
1117
1118         * WTF.vcxproj/WTF.vcxproj:
1119         * WTF.vcxproj/WTF.vcxproj.filters:
1120         * WTF.xcodeproj/project.pbxproj:
1121         * wtf/BoundsCheckedPointer.h: Removed.
1122         * wtf/CMakeLists.txt:
1123
1124 2015-04-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1125
1126         [ES6] Implement Symbol.for and Symbol.keyFor
1127         https://bugs.webkit.org/show_bug.cgi?id=143404
1128
1129         Reviewed by Geoffrey Garen.
1130
1131         When we register symbolized StringImpl* into SymbolRegistry, symbolized StringImpl* is aware of that.
1132         And when destructing it, it removes its reference from SymbolRegistry as if atomic StringImpl do so with AtomicStringTable.
1133         While AtomicStringTable (in WebCore case) exists in thread local storage,
1134         SymbolRegistry exists per VM and StringImpl* has a reference to the registered SymbolRegistry.
1135
1136         Since StringImpl has isSymbol etc. members, it's class is aware of Symbol use cases.
1137         So introduce SymbolRegistry in WTF layers as if AtomicStringTable.
1138
1139         * WTF.vcxproj/WTF.vcxproj:
1140         * WTF.vcxproj/WTF.vcxproj.filters:
1141         * WTF.xcodeproj/project.pbxproj:
1142         * wtf/CMakeLists.txt:
1143         * wtf/text/AtomicString.cpp:
1144         (WTF::AtomicString::addSlowCase):
1145         (WTF::AtomicString::findSlowCase):
1146         (WTF::AtomicString::findInternal):
1147         (WTF::AtomicString::find): Deleted.
1148         * wtf/text/AtomicString.h:
1149         (WTF::AtomicString::find):
1150         * wtf/text/StringImpl.cpp:
1151         (WTF::StringImpl::~StringImpl):
1152         (WTF::StringImpl::createSymbol):
1153         (WTF::StringImpl::createSymbolEmpty):
1154         * wtf/text/StringImpl.h:
1155         (WTF::StringImpl::StringImpl):
1156         (WTF::StringImpl::extractFoldedStringInSymbol):
1157         (WTF::StringImpl::symbolRegistry):
1158         (WTF::StringImpl::createSymbolEmpty): Deleted.
1159         * wtf/text/SymbolRegistry.cpp: Copied from Source/JavaScriptCore/runtime/SymbolConstructor.h.
1160         (WTF::SymbolRegistry::~SymbolRegistry):
1161         (WTF::SymbolRegistry::symbolForKey):
1162         (WTF::SymbolRegistry::keyForSymbol):
1163         (WTF::SymbolRegistry::remove):
1164         * wtf/text/SymbolRegistry.h: Added.
1165         (WTF::SymbolRegistryKey::hash):
1166         (WTF::SymbolRegistryKey::impl):
1167         (WTF::SymbolRegistryKey::isHashTableDeletedValue):
1168         (WTF::SymbolRegistryKey::hashTableDeletedValue):
1169         (WTF::DefaultHash<SymbolRegistryKey>::Hash::hash):
1170         (WTF::DefaultHash<SymbolRegistryKey>::Hash::equal):
1171         (WTF::HashTraits<SymbolRegistryKey>::isEmptyValue):
1172         (WTF::SymbolRegistryKey::SymbolRegistryKey):
1173
1174 2015-04-16  Antti Koivisto  <antti@apple.com>
1175
1176         Use CommonCrypto for SHA1 and MD5
1177         https://bugs.webkit.org/show_bug.cgi?id=143826
1178
1179         Reviewed by Anders Carlsson.
1180
1181         CommonCrypto SHA1 implementation is ~4x faster than the naive WTF one. Use it when available.
1182
1183         These are covered by existing API tests.
1184
1185         * wtf/MD5.cpp:
1186         (WTF::MD5::MD5):
1187         (WTF::MD5::addBytes):
1188         (WTF::MD5::checksum):
1189         * wtf/MD5.h:
1190         * wtf/SHA1.cpp:
1191         (WTF::SHA1::SHA1):
1192         (WTF::SHA1::addBytes):
1193         (WTF::SHA1::computeHash):
1194
1195             Remove the side effect where computeHash resets the state. No one relies on it.
1196
1197         (WTF::SHA1::hexDigest):
1198         (WTF::SHA1::computeHexDigest):
1199         * wtf/SHA1.h:
1200
1201 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
1202
1203         Remove the unnecessary WTF_CHANGES define
1204         https://bugs.webkit.org/show_bug.cgi?id=143825
1205
1206         Reviewed by Andreas Kling.
1207
1208         * config.h:
1209
1210 2015-04-15  Руслан Ижбулатов  <lrn1986@gmail.com>
1211
1212         Harmonize binary semaphore ifdefs
1213
1214         They should be either OS(WINDOWS) (in which case we'd need
1215         BinarySemaphoreWin.cpp, which is not shipped by WebKitGTK)
1216         or PLATFORM(WIN) (in which case Mutex/ThreadCondition-based
1217         implementation is used).
1218
1219         This fixes errors like:
1220           CXX      Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo
1221         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In constructor 'WTF::BinarySemaphore::BinarySemaphore()':
1222         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:34:7: error: class 'WTF::BinarySemaphore' does not have any field named 'm_isSet'
1223              : m_isSet(false)
1224                ^
1225         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'void WTF::BinarySemaphore::signal()':
1226         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:44:24: error: 'm_mutex' was not declared in this scope
1227              MutexLocker locker(m_mutex);
1228                                 ^
1229         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:46:5: error: 'm_isSet' was not declared in this scope
1230              m_isSet = true;
1231              ^
1232         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:47:5: error: 'm_condition' was not declared in this scope
1233              m_condition.signal();
1234              ^
1235         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'bool WTF::BinarySemaphore::wait(double)':
1236         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:52:24: error: 'm_mutex' was not declared in this scope
1237              MutexLocker locker(m_mutex);
1238                                 ^
1239         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:55:13: error: 'm_isSet' was not declared in this scope
1240              while (!m_isSet) {
1241                      ^
1242         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:56:21: error: 'm_condition' was not declared in this scope
1243                  timedOut = !m_condition.timedWait(m_mutex, absoluteTime);
1244                              ^
1245         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:62:5: error: 'm_isSet' was not declared in this scope
1246              m_isSet = false;
1247              ^
1248         GNUmakefile:52762: recipe for target 'Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo' failed
1249
1250         [W32] Inconsistent ifdefs in BinarySemaphore.h and BinarySemaphore.cpp
1251         https://bugs.webkit.org/show_bug.cgi?id=143756
1252
1253         Reviewed by Darin Adler.
1254
1255         * wtf/threads/BinarySemaphore.h:
1256
1257 2015-04-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1258
1259         Fix -Wparentheses warning with GCC 5 in SaturatedArithmetic.h
1260         https://bugs.webkit.org/show_bug.cgi?id=143457
1261
1262         Reviewed by Benjamin Poulain.
1263
1264         Tested by WTF.SaturatedArithmeticAddition and WTF.SaturatedArithmeticSubtraction.
1265
1266         * wtf/SaturatedArithmetic.h:
1267         (signedAddOverflows): Use && instead of & to avoid triggering -Wparentheses in newer
1268         versions of GCC and Clang, and to improve the clarity of the function.
1269         (signedSubtractOverflows): Changed correspondingly, although there was no warning here.
1270
1271 2015-04-08  Sam Weinig  <sam@webkit.org>
1272
1273         Allow LaunchServices to handle URLs on link navigations
1274         <rdar://problem/19446826>
1275         https://bugs.webkit.org/show_bug.cgi?id=143544
1276
1277         Reviewed by Anders Carlsson.
1278
1279         * wtf/Platform.h:
1280         Add HAVE macro for this functionality.
1281
1282 2015-04-09  Andy Estes  <aestes@apple.com>
1283
1284         [Cocoa] Add a HAVE(AVKIT) and use it
1285         https://bugs.webkit.org/show_bug.cgi?id=143593
1286
1287         Reviewed by David Kilzer.
1288
1289         * wtf/Platform.h: Defined HAVE(AVKIT) to be true on all Cocoa platforms except Watch OS.
1290
1291 2015-04-09  Andy Estes  <aestes@apple.com>
1292
1293         [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
1294         https://bugs.webkit.org/show_bug.cgi?id=143559
1295
1296         Reviewed by David Kilzer.
1297
1298         Added PLATFORM(WATCHOS). Used PLATFORM() since Watch OS is just a variant of OS(IOS).
1299         Defined HAVE(PARENTAL_CONTROLS) to be true on all Cocoa platforms except Watch OS.
1300
1301         * wtf/Platform.h:
1302
1303 2015-04-08  Alex Christensen  <achristensen@webkit.org> and Patrick Gansterer  <paroga@webkit.org>
1304
1305         Add CMake build system for WinCairo port.
1306         https://bugs.webkit.org/show_bug.cgi?id=115944
1307
1308         Reviewed by Chris Dumez.
1309
1310         * wtf/FeatureDefines.h:
1311         * wtf/PlatformWin.cmake:
1312
1313 2015-04-05  Antti Koivisto  <antti@apple.com>
1314
1315         Bloom filter should support longer hashes
1316         https://bugs.webkit.org/show_bug.cgi?id=143419
1317
1318         Reviewed by Dan Bernstein.
1319
1320         It currently supports 'unsigned' hash only which is inconvenient and doesn't have enough independent bits for larger filters.
1321
1322         Support arbitrarily sized hashes of type std::array<uint8_t, hashSize> (like SHA1::Digest and MD5::Digest).
1323
1324         * wtf/BloomFilter.h:
1325         (WTF::BloomFilter<keyBits>::keysFromHash):
1326         (WTF::BloomFilter<keyBits>::mayContain):
1327         (WTF::BloomFilter<keyBits>::add):
1328
1329 2015-04-03  Antti Koivisto  <antti@apple.com>
1330
1331         Add non-counting Bloom filter implementation
1332         https://bugs.webkit.org/show_bug.cgi?id=143366
1333
1334         Reviewed by Sam Weinig.
1335
1336         Add a traditional single-bit-per-bucket Bloom filter in addition to the existing counting implementation.
1337
1338         - rename BloomFilter -> CountingBloomFilter.
1339         - add a new basic BloomFilter type.
1340         - update some terminology to match http://en.wikipedia.org/wiki/Bloom_filter and modernize the code a bit.
1341         - add API tests.
1342
1343         * wtf/BloomFilter.h:
1344         (WTF::BloomFilter::BloomFilter):
1345         (WTF::BloomFilter::add):
1346
1347             Also support merging.
1348
1349         (WTF::BloomFilter::mayContain):
1350         (WTF::BloomFilter::arrayIndex):
1351         (WTF::BloomFilter::bitMask):
1352         (WTF::BloomFilter<keyBits>::mayContain):
1353         (WTF::BloomFilter<keyBits>::add):
1354         (WTF::BloomFilter<keyBits>::isBitSet):
1355         (WTF::BloomFilter<keyBits>::setBit):
1356         (WTF::BloomFilter<keyBits>::clear):
1357         (WTF::CountingBloomFilter::CountingBloomFilter):
1358         (WTF::CountingBloomFilter::mayContain):
1359         (WTF::CountingBloomFilter::firstBucket):
1360         (WTF::CountingBloomFilter::secondBucket):
1361         (WTF::CountingBloomFilter<keyBits>::add):
1362         (WTF::CountingBloomFilter<keyBits>::remove):
1363         (WTF::CountingBloomFilter<keyBits>::clear):
1364         (WTF::CountingBloomFilter<keyBits>::likelyEmpty):
1365         (WTF::CountingBloomFilter<keyBits>::isClear):
1366         (WTF::BloomFilter::maximumCount): Deleted.
1367         (WTF::BloomFilter::firstSlot): Deleted.
1368         (WTF::BloomFilter::secondSlot): Deleted.
1369         (WTF::BloomFilter<keyBits>::remove): Deleted.
1370         (WTF::BloomFilter<keyBits>::likelyEmpty): Deleted.
1371         (WTF::BloomFilter<keyBits>::isClear): Deleted.
1372
1373 015-04-01  Antti Koivisto  <antti@apple.com>
1374
1375         Value assignment operator of Optional should be stricter
1376         https://bugs.webkit.org/show_bug.cgi?id=143303
1377
1378         Reviewed by Andreas Kling.
1379
1380         struct Foo { mutable Optional<std::chrono::seconds> s; };
1381         Foo foo, foo2;
1382         foo = foo2;
1383
1384         doesn't build because it tries to use wrong operator=.
1385
1386         * wtf/Optional.h:
1387
1388             Add enable_if test similar to std::experimental::optional.
1389
1390 2015-04-01  Alex Christensen  <achristensen@webkit.org>
1391
1392         Progress towards CMake on Windows and Mac.
1393         https://bugs.webkit.org/show_bug.cgi?id=143293
1394
1395         Reviewed by Filip Pizlo.
1396
1397         * wtf/CMakeLists.txt:
1398         Don't use bmalloc on Windows yet.
1399         * wtf/FeatureDefines.h:
1400         Temporarily disabled WebGL on Windows CMake builds.
1401         * wtf/PlatformMac.cmake:
1402         Tell open source builders where to find unicode headers.
1403
1404 2015-03-31  Alexey Proskuryakov  <ap@apple.com>
1405
1406         Fix the build after <http://trac.webkit.org/changeset/182205>.
1407
1408         * wtf/text/StringImpl.h: (WTF::StringImpl::extractFoldedStringInSymbol):
1409         A function cannot be both exported and inline.
1410
1411 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1412
1413         Clean up Identifier factories to clarify the meaning of StringImpl*
1414         https://bugs.webkit.org/show_bug.cgi?id=143146
1415
1416         Reviewed by Filip Pizlo.
1417
1418         Introduce StringKind into `StringImpl`. There's 3 kinds
1419         1. StringNormal (non-atomic, non-symbol)
1420         2. StringAtomic (atomic, non-symbol)
1421         3. StringSymbol (non-atomic, symbol)
1422         They are mutually exclusive.
1423
1424         * wtf/text/AtomicString.cpp:
1425         (WTF::AtomicString::addSlowCase):
1426         (WTF::AtomicString::findSlowCase):
1427         When registering a string into AtomicStringTable,
1428         it should not be a symbol string
1429         because symbol and atomic types are mutually exclusive.
1430         When a symbol string comes, we extract an owner string
1431         from a symbol string by using `StringImpl::extractFoldedStringInSymbol()`.
1432         It always succeeds because a symbol (non empty) string
1433         is always BufferSubstring and has an owner string.
1434         Empty symbol string doesn't have an owner string.
1435         This case is filtered by `!string.length()` guard.
1436         * wtf/text/AtomicString.h:
1437         (WTF::AtomicString::add):
1438         (WTF::AtomicString::addWithStringTableProvider):
1439         * wtf/text/StringImpl.cpp:
1440         (WTF::StringImpl::~StringImpl):
1441         (WTF::StringImpl::createSymbol):
1442         (WTF::StringImpl::createUnique): Deleted.
1443         * wtf/text/StringImpl.h:
1444         (WTF::StringImpl::StringImpl):
1445         (WTF::StringImpl::createSymbolEmpty):
1446         (WTF::StringImpl::flagIsAtomic):
1447         (WTF::StringImpl::flagIsSymbol):
1448         (WTF::StringImpl::maskStringKind):
1449         (WTF::StringImpl::stringKind):
1450         (WTF::StringImpl::isSymbol):
1451         (WTF::StringImpl::isAtomic):
1452         (WTF::StringImpl::setIsAtomic):
1453         (WTF::StringImpl::extractFoldedStringInSymbol):
1454         (WTF::StringImpl::createUniqueEmpty): Deleted.
1455         (WTF::StringImpl::flagIsUnique): Deleted.
1456         (WTF::StringImpl::isUnique): Deleted.
1457         * wtf/text/StringStatics.cpp:
1458         (WTF::StringImpl::hashAndFlagsForSymbol):
1459         (WTF::StringImpl::hashAndFlagsForUnique): Deleted.
1460
1461 2015-03-30  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1462
1463         [CMake][EFL] Remove redundant library link and include path
1464         https://bugs.webkit.org/show_bug.cgi?id=143221
1465
1466         Reviewed by Csaba Osztrogonác.
1467
1468         * wtf/PlatformEfl.cmake: Remove unnecessary library link and include path.
1469
1470 2015-03-27  Myles C. Maxfield  <mmaxfield@apple.com>
1471
1472         Support building WTF on Windows without Cygwin
1473         https://bugs.webkit.org/show_bug.cgi?id=143084
1474
1475         Reviewed by Brent Fulgham.
1476
1477         Windows doesn't have "touch".
1478
1479         * WTF.vcxproj/WTFGenerated.make:
1480
1481 2015-03-26  Alex Christensen  <achristensen@webkit.org>
1482
1483         Progress towards CMake on Mac.
1484         https://bugs.webkit.org/show_bug.cgi?id=143112
1485
1486         Reviewed by Chris Dumez.
1487
1488         * wtf/PlatformMac.cmake:
1489
1490 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
1491
1492         Unreviewed, we have edited this file in 2015.
1493
1494         * wtf/Platform.h:
1495
1496 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
1497
1498         Heap variables shouldn't end up in the stack frame
1499         https://bugs.webkit.org/show_bug.cgi?id=141174
1500
1501         Reviewed by Geoffrey Garen.
1502
1503         * wtf/FastBitVector.h:
1504         (WTF::FastBitVector::resize): Small change: don't resize if you don't have to resize.
1505
1506 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
1507
1508         Change Atomic methods from using the_wrong_naming_conventions to using theRightNamingConventions. Also make seq_cst the default.
1509
1510         Rubber stamped by Geoffrey Garen.
1511
1512         * wtf/Atomics.h:
1513         (WTF::Atomic::load):
1514         (WTF::Atomic::store):
1515         (WTF::Atomic::compareExchangeWeak):
1516         (WTF::Atomic::compareExchangeStrong):
1517         (WTF::Atomic::compare_exchange_weak): Deleted.
1518         (WTF::Atomic::compare_exchange_strong): Deleted.
1519         * wtf/ByteSpinLock.h:
1520         (WTF::ByteSpinLock::lock):
1521         * wtf/SpinLock.h:
1522         (WTF::SpinLockBase::lock):
1523
1524 2015-03-24  Beth Dakin  <bdakin@apple.com>
1525
1526         Add events related to force click gesture
1527         https://bugs.webkit.org/show_bug.cgi?id=142836
1528         -and corresponding-
1529         rdar://problem/20210239
1530
1531         Reviewed by Dean Jackson.
1532
1533         New enable flag for the events.
1534         * wtf/FeatureDefines.h:
1535
1536 2015-03-23  Filip Pizlo  <fpizlo@apple.com>
1537
1538         JSC should have a low-cost asynchronous disassembler
1539         https://bugs.webkit.org/show_bug.cgi?id=142997
1540
1541         Reviewed by Mark Lam.
1542
1543         * wtf/StringPrintStream.h:
1544
1545 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
1546
1547         CSS Selectors: fix attribute case-insensitive matching of Contain and List
1548         https://bugs.webkit.org/show_bug.cgi?id=142932
1549
1550         Reviewed by Darin Adler.
1551
1552         Add some utility functions to the string classes to find substrings
1553         using ASCII case-insensitive comparisons.
1554
1555         * wtf/text/AtomicString.h:
1556         (WTF::AtomicString::contains):
1557         Add the light version that only lock one register.
1558
1559         (WTF::AtomicString::containsIgnoringASCIICase):
1560         (WTF::AtomicString::findIgnoringASCIICase):
1561
1562         * wtf/text/StringCommon.h:
1563         (WTF::findIgnoringASCIICase):
1564         This is the common implementation used by StringView and StringImpl.
1565
1566         * wtf/text/StringImpl.cpp:
1567         (WTF::StringImpl::findIgnoringASCIICase):
1568         * wtf/text/StringImpl.h:
1569         * wtf/text/StringView.cpp:
1570         (WTF::StringView::containsIgnoringASCIICase):
1571         (WTF::StringView::findIgnoringASCIICase):
1572         * wtf/text/StringView.h:
1573         * wtf/text/WTFString.h:
1574         (WTF::String::findIgnoringASCIICase):
1575         (WTF::String::contains):
1576         (WTF::String::containsIgnoringASCIICase):
1577
1578 2015-03-19  Andreas Kling  <akling@apple.com>
1579
1580         DFGAllocator should use bmalloc's aligned allocator.
1581         <https://webkit.org/b/142871>
1582
1583         Reviewed by Geoffrey Garen.
1584
1585         Remove PageAllocationAligned since it has no more clients.
1586
1587         * WTF.vcxproj/WTF.vcxproj:
1588         * WTF.vcxproj/WTF.vcxproj.filters:
1589         * WTF.xcodeproj/project.pbxproj:
1590         * wtf/CMakeLists.txt:
1591         * wtf/PageAllocationAligned.cpp: Removed.
1592         * wtf/PageAllocationAligned.h: Removed.
1593
1594 2015-03-18  Dhi Aurrahman  <diorahman@rockybars.com>
1595
1596         Fix StringView misplaced implementations after r181525 and r181558
1597         https://bugs.webkit.org/show_bug.cgi?id=142772
1598
1599         Reviewed by Darin Adler.
1600
1601         Fix misplaced implementations in StringView::startsWithIgnoringASCIICase and 
1602         StringView::endsWith. 
1603
1604         Add some tests in [1] to cover the StringView::startsWith, 
1605         StringView::startsWithIgnoringASCIICase, StringView::endsWith and 
1606         StringView::endsWithIgnoringASCIICase implementations.
1607
1608         [1] Tools/TestWebKitAPI/Tests/WTF/StringView.cpp.
1609
1610         * wtf/text/StringView.cpp:
1611         (WTF::StringView::startsWithIgnoringASCIICase):
1612         (WTF::StringView::endsWith):
1613         (WTF::StringView::endsWithIgnoringASCIICase):
1614
1615 2015-03-17  Michael Saboff  <msaboff@apple.com>
1616
1617         Windows X86-64 should use the fixed executable allocator
1618         https://bugs.webkit.org/show_bug.cgi?id=142749
1619
1620         Reviewed by Filip Pizlo.
1621
1622         Set ENABLE_EXECUTABLE_ALLOCATOR_FIXED for Windows.
1623         Needed to export MetaAllocator::currentStatistics() for use in JavaScriptCore.
1624
1625         * wtf/MetaAllocator.h:
1626         * wtf/Platform.h:
1627
1628 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
1629
1630         Enable ES6 classes by default
1631         https://bugs.webkit.org/show_bug.cgi?id=142774
1632
1633         Reviewed by Gavin Barraclough.
1634
1635         * wtf/FeatureDefines.h:
1636
1637 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
1638
1639         [ARM] Enable generating idiv instructions if it is supported
1640         https://bugs.webkit.org/show_bug.cgi?id=142725
1641
1642         Reviewed by Michael Saboff.
1643
1644         * wtf/Platform.h: Set HAVE_ARM_IDIV_INSTRUCTIONS based on GCC macro too.
1645
1646 2015-03-16  Benjamin Poulain  <benjamin@webkit.org>
1647
1648         Fix StringView after r181525
1649         Unreviewed.
1650
1651         Fix 2 silly mistakes I made in r181525.
1652
1653         * wtf/text/StringView.cpp:
1654         (WTF::StringView::startsWith):
1655         (WTF::StringView::startsWithIgnoringASCIICase):
1656         (WTF::StringView::endsWith):
1657         (WTF::StringView::endsWithIgnoringASCIICase):
1658         The implementation was inside the #ifdef.
1659
1660         * wtf/text/StringView.h:
1661         The symbols were not exported.
1662
1663 2015-03-16  Max Stepin  <maxstepin@gmail.com>
1664
1665         Add APNG support
1666         https://bugs.webkit.org/show_bug.cgi?id=17022
1667
1668         Reviewed by Carlos Garcia Campos.
1669
1670         * wtf/FeatureDefines.h:
1671
1672 2015-03-15  Benjamin Poulain  <benjamin@webkit.org>
1673
1674         CSS: fix the case-insensitive matching of the attribute selectors Begin, End and Hyphen
1675         https://bugs.webkit.org/show_bug.cgi?id=142715
1676
1677         Reviewed by Brent Fulgham.
1678
1679         Add the necessary infrastructure to test startsWith() and endsWith() with
1680         ASCII case-insentive comparisons.
1681
1682         * wtf/text/AtomicString.h:
1683         (WTF::AtomicString::startsWith):
1684         (WTF::AtomicString::startsWithIgnoringASCIICase):
1685         (WTF::AtomicString::endsWith):
1686         (WTF::AtomicString::endsWithIgnoringASCIICase):
1687
1688         * wtf/text/StringCommon.h:
1689         (WTF::loadUnaligned):
1690         (WTF::equal):
1691         I moved the low level equal() code from StringImpl to StringCommon
1692         since it is used by both StringImpl and StringView.
1693
1694         (WTF::equalCommon):
1695         (WTF::equalIgnoringASCIICaseCommon):
1696         Ideally we should drop the "Common" part of the name but StringView
1697         wants this inline for some reason. I prefered keeping the current behavior
1698         since I don't know how StringView's matching performance was evaluated.
1699
1700         (WTF::startsWith):
1701         (WTF::startsWithIgnoringASCIICase):
1702         (WTF::endsWith):
1703         (WTF::endsWithIgnoringASCIICase):
1704         Make all that code shared between StringView and Stringimpl.
1705
1706         * wtf/text/StringImpl.cpp:
1707         (WTF::StringImpl::startsWith):
1708         (WTF::StringImpl::startsWithIgnoringASCIICase):
1709         (WTF::StringImpl::endsWith):
1710         (WTF::StringImpl::endsWithIgnoringASCIICase):
1711         (WTF::equal):
1712         (WTF::stringImplContentEqual): Deleted.
1713         * wtf/text/StringImpl.h:
1714         (WTF::loadUnaligned): Deleted.
1715         (WTF::equal): Deleted.
1716
1717         * wtf/text/StringView.cpp:
1718         (WTF::StringView::startsWith):
1719         (WTF::StringView::startsWithIgnoringASCIICase):
1720         (WTF::StringView::endsWith):
1721         (WTF::StringView::endsWithIgnoringASCIICase):
1722         * wtf/text/StringView.h:
1723         Since those are new, we can safely make them out-of-line and
1724         evaluate the inlining impact as needed.
1725
1726         * wtf/text/WTFString.h:
1727         (WTF::String::startsWithIgnoringASCIICase):
1728         (WTF::String::endsWith):
1729         (WTF::String::endsWithIgnoringASCIICase):
1730
1731 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
1732
1733         Change the exact attribute matching to be ASCII case-insensitive
1734         https://bugs.webkit.org/show_bug.cgi?id=142609
1735
1736         Reviewed by Darin Adler.
1737
1738         Add support for ASCII case insensitive comparisons to all the string
1739         classes.
1740
1741         The new file StringCommon.h has the common algorithm to avoid repeating
1742         the same code with different types.
1743
1744         * WTF.vcxproj/WTF.vcxproj:
1745         * WTF.vcxproj/WTF.vcxproj.filters:
1746         * wtf/ASCIICType.h:
1747         (WTF::toASCIILower):
1748         * wtf/CMakeLists.txt:
1749         * wtf/text/AtomicString.h:
1750         (WTF::equalIgnoringASCIICase):
1751         * wtf/text/StringCommon.h: Added.
1752         (WTF::equalIgnoringASCIICase):
1753         (WTF::equalIgnoringASCIICaseCommon):
1754         * wtf/text/StringImpl.cpp:
1755         (WTF::equalIgnoringASCIICase):
1756         (WTF::equalIgnoringASCIICaseNonNull):
1757         (WTF::StringImpl::utf8Impl):
1758         (WTF::StringImpl::defaultWritingDirection): Deleted.
1759         (WTF::StringImpl::adopt): Deleted.
1760         (WTF::StringImpl::sizeInBytes): Deleted.
1761         (WTF::putUTF8Triple): Deleted.
1762         (WTF::StringImpl::utf8): Deleted.
1763         * wtf/text/StringImpl.h:
1764         (WTF::StringImpl::isSubString): Deleted.
1765         (WTF::find): Deleted.
1766
1767 2015-03-14  Michael Saboff  <msaboff@apple.com>
1768
1769         Disable Yarr JIT for ARMv7k
1770         https://bugs.webkit.org/show_bug.cgi?id=142645
1771
1772         Rubber stamped by Geoffrey Garen.
1773
1774         Changed the setting of ENABLE_YARR_JIT to be predicated on ENABLED_JIT.
1775
1776         * wtf/Platform.h:
1777
1778 2015-03-14  Michael Saboff  <msaboff@apple.com>
1779
1780         ES6: Add binary and octal literal support
1781         https://bugs.webkit.org/show_bug.cgi?id=142681
1782
1783         Reviewed by Ryosuke Niwa.
1784
1785         * wtf/ASCIICType.h:
1786         (WTF::isASCIIBinaryDigit): New support function.
1787         (WTF::isASCIIOctalDigit): Updated to use logical and (&&) instead of binary and (&).
1788
1789 2015-03-13  Mark Lam  <mark.lam@apple.com>
1790
1791         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
1792         <https://webkit.org/b/142674>
1793
1794         Reviewed by Filip Pizlo.
1795
1796         We no longer use TCMalloc in our code, and we now have C++11.  This replaces the
1797         TCMalloc_SpinLock with a new WTF::SpinLock based on WTF::Atomic (which is a
1798         wrapper around std::atomic).
1799
1800         Note that there is a StaticSpinLock and a SpinLock:
1801
1802         1. StaticSpinLock is an alias for SpinLockBase, and its initialization relies on
1803            static / global std:atomic being automatically initialized to 0 at compile time.
1804            Hence, StaticSpinLock should only be used for statics / globals (including
1805            static members of classes / structs).
1806
1807         2. SpinLock is derived from SpinLockBase, and adds a default constructor to
1808            initialize its internal atomic value to 0.  Because SpinLock has a constructor,
1809            it cannot be used for statics / globals.  Objects that want to embed a spin
1810            lock as an instance field should use SpinLock so that it is initialized properly.
1811            std::atomic will not automatically initialize instance fields to 0.  Hence,
1812            StaticSpinLock will not work correctly as instance fields of a class / struct.
1813
1814         * WTF.vcxproj/WTF.vcxproj:
1815         * WTF.vcxproj/WTF.vcxproj.filters:
1816         * WTF.xcodeproj/project.pbxproj:
1817         * wtf/CMakeLists.txt:
1818         * wtf/MetaAllocator.cpp:
1819         (WTF::MetaAllocator::~MetaAllocator):
1820         (WTF::MetaAllocator::MetaAllocator):
1821         * wtf/MetaAllocator.h:
1822         * wtf/SpinLock.h: Added.
1823         (WTF::SpinLockBase::lock):
1824         (WTF::SpinLockBase::unlock):
1825         (WTF::SpinLockBase::isLocked):
1826         (WTF::SpinLockBase::slowLock):
1827         (WTF::SpinLock::SpinLock):
1828         * wtf/TCSpinLock.h: Removed.
1829         * wtf/text/AtomicString.cpp:
1830
1831 2015-03-13  Mark Lam  <mark.lam@apple.com>
1832
1833         Introduce WTF::Atomic to wrap std::atomic for a friendlier CAS.
1834         <https://webkit.org/b/142661>
1835
1836         Reviewed by Filip Pizlo.
1837
1838         The CAS functions provided by std::atomic takes a reference to the expected
1839         value and modifies it if the CAS fails.  However, in a lot of our CAS usage,
1840         we don't want the expected value to change.  The solution to this is to
1841         provide a WTF::Atomic struct that wraps std::atomic, and provide CAS
1842         methods that won't alter the expected value if the CAS fails.
1843
1844         The method names in WTF::Atomic are chosen to be identical to those
1845         in std::atomic so that WTF::Atomic can be a simple drop in replacement
1846         for std::atomic.
1847
1848         Also changed ByteSpinLock to use WTF::Atomic instead of std::atomic.
1849
1850         * wtf/Atomics.h:
1851         (WTF::Atomic::load):
1852         (WTF::Atomic::store):
1853         (WTF::Atomic::compare_exchange_weak):
1854         (WTF::Atomic::compare_exchange_strong):
1855         * wtf/ByteSpinLock.h:
1856         (WTF::ByteSpinLock::ByteSpinLock):
1857         (WTF::ByteSpinLock::lock):
1858
1859 2015-03-12  Filip Pizlo  <fpizlo@apple.com>
1860
1861         Bytecode liveness analysis should have more lambdas and fewer sets
1862         https://bugs.webkit.org/show_bug.cgi?id=142647
1863
1864         Reviewed by Mark Lam.
1865         
1866         Add a method for iterating each set bit in a FastBitVector. Uses a functor as a callback since
1867         this allows for a more efficient algorithm.
1868
1869         * wtf/FastBitVector.h:
1870         (WTF::FastBitVector::forEachSetBit):
1871
1872 2015-03-12  Michael Saboff  <msaboff@apple.com>
1873
1874         Disable Yarr JIT for ARMv7k
1875         https://bugs.webkit.org/show_bug.cgi?id=142645
1876
1877         Reviewed by Oliver Hunt.
1878
1879         Make the setting of ENABLE_YARR_JIT match ENABLE_JIT for ARMv7k.
1880
1881         * wtf/Platform.h:
1882
1883 2015-03-12  Mark Lam  <mark.lam@apple.com>
1884
1885         Change WTF::ByteSpinLock to use std::atomic.
1886         <https://webkit.org/b/142644>
1887
1888         Reviewed by Filip Pizlo.
1889
1890         * wtf/ByteSpinLock.h:
1891         (WTF::ByteSpinLock::ByteSpinLock):
1892         (WTF::ByteSpinLock::lock):
1893         (WTF::ByteSpinLock::unlock):
1894         (WTF::ByteSpinLock::isHeld):
1895
1896 2015-03-12  Csaba Osztrogonác  <ossy@webkit.org>
1897
1898         [ARM][Linux] GC sometimes stuck in an infinite loop if parallel GC is enabled
1899         https://bugs.webkit.org/show_bug.cgi?id=141290
1900
1901         Reviewed by Carlos Garcia Campos.
1902
1903         * wtf/Platform.h: Enable parallel GC after r181319.
1904
1905 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
1906
1907         Use out-of-band messaging for RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline()
1908         https://bugs.webkit.org/show_bug.cgi?id=142569
1909
1910         Reviewed by David Hyatt.
1911
1912         Provide a callback to Optional::valueOrCompute() which is evaluated only if necessary.
1913
1914         * wtf/Optional.h:
1915         (WTF::Optional::valueOrCompute):
1916
1917 2015-03-10  Brent Fulgham  <bfulgham@apple.com>
1918
1919         [Win] 17 different JSC tests started to fail in DST
1920         https://bugs.webkit.org/show_bug.cgi?id=142531
1921
1922         Reviewed by Chris Dumez.
1923
1924         The stock 'GetTimeZoneInformation' call does not always match the actual Daylight
1925         Savings calendar. This results in a period of time when these tests fail.
1926
1927         If available, we should take advantage of the new 'GetTimeZoneInformationForYear',
1928         which accesses a dynamic calendar of DST dates, which is presumbably updated by
1929         Microsoft from year-to-year.
1930
1931         * wtf/DateMath.cpp:
1932         (WTF::timeZoneInformationForYearFunction): New function to conditionally access
1933         some Vista (and newer) functionality.
1934         (WTF::calculateUTCOffset): Call new function (if available) to calculate proper UTC
1935         time offset.
1936
1937 2015-03-10  Alex Christensen  <achristensen@webkit.org>
1938
1939         Use unsigned for HashSet size.
1940         https://bugs.webkit.org/show_bug.cgi?id=142518
1941
1942         Reviewed by Benjamin Poulain.
1943
1944         * wtf/HashCountedSet.h:
1945         (WTF::Traits>::size):
1946         (WTF::Traits>::capacity):
1947         * wtf/HashMap.h:
1948         (WTF::X>::size):
1949         (WTF::X>::capacity):
1950         * wtf/HashSet.h:
1951         (WTF::V>::size):
1952         (WTF::V>::capacity):
1953         * wtf/HashTable.h:
1954         (WTF::HashTable::Stats::recordCollisionAtCount):
1955         (WTF::HashTable::Stats::dumpStats):
1956         (WTF::HashTable::size):
1957         (WTF::HashTable::capacity):
1958         (WTF::KeyTraits>::deallocateTable):
1959         (WTF::KeyTraits>::checkTableConsistencyExceptSize):
1960         * wtf/HashTraits.h:
1961         * wtf/ListHashSet.h:
1962         (WTF::U>::size):
1963         (WTF::U>::capacity):
1964
1965 2015-03-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
1966
1967         Remove PassRefPtr from svg/properties classes.
1968         https://bugs.webkit.org/show_bug.cgi?id=142063.
1969
1970         Reviewed by Darin Adler.
1971
1972         * wtf/Ref.h:
1973         (WTF::static_reference_cast): Add a stat_cast function to Ref<>.
1974
1975 2015-03-10  Mark Lam  <mark.lam@apple.com>
1976
1977         [Win] JSC Build Warnings Need to be Resolved.
1978         <https://webkit.org/b/142366>
1979
1980         Reviewed by Brent Fulgham.
1981
1982         * wtf/Compiler.h:
1983         - MSVC also does not have the CONSIDERS_UNREACHABLE_CODE quirk.
1984
1985 2015-03-10  Geoffrey Garen  <ggaren@apple.com>
1986
1987         bmalloc: tryFastMalloc shouldn't crash
1988         https://bugs.webkit.org/show_bug.cgi?id=142443
1989
1990         Reviewed by Sam Weinig.
1991
1992         Rolling back in r181307 with a check for whether bmalloc is enabled, to
1993         avoid crashes when running with ASan and GuardMalloc.
1994
1995         * wtf/FastMalloc.cpp:
1996         (WTF::fastMalloc):
1997         (WTF::fastRealloc):
1998         (WTF::fastAlignedMalloc):
1999         (WTF::tryFastMalloc):
2000         (WTF::tryFastRealloc): Deleted.
2001         * wtf/FastMalloc.h:
2002
2003 2015-03-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2004
2005         GCC: CRASH() should be annotated with NORETURN
2006         https://bugs.webkit.org/show_bug.cgi?id=142524
2007
2008         Reviewed by Anders Carlsson.
2009
2010         Add COMPILER(GCC) to #ifdefs that already exist for Clang.
2011
2012         * wtf/Assertions.cpp:
2013         * wtf/Assertions.h:
2014
2015 2015-03-09  Commit Queue  <commit-queue@webkit.org>
2016
2017         Unreviewed, rolling out r181307.
2018         https://bugs.webkit.org/show_bug.cgi?id=142525
2019
2020         Broke ASan tests (Requested by ap on #webkit).
2021
2022         Reverted changeset:
2023
2024         "bmalloc: tryFastMalloc shouldn't crash"
2025         https://bugs.webkit.org/show_bug.cgi?id=142443
2026         http://trac.webkit.org/changeset/181307
2027
2028 2015-03-09  Geoffrey Garen  <ggaren@apple.com>
2029
2030         bmalloc: tryFastMalloc shouldn't crash
2031         https://bugs.webkit.org/show_bug.cgi?id=142443
2032
2033         Reviewed by Darin Adler.
2034
2035         * wtf/FastMalloc.cpp:
2036         (WTF::fastMalloc):
2037         (WTF::fastRealloc):
2038         (WTF::fastAlignedMalloc): Don't check for null. bmalloc automatically
2039         crashes on allocation failure, and we'd rather not pay for an extra check.
2040
2041         (WTF::tryFastMalloc): Added an opt-out API to return null rather than
2042         crashing, since some clients need this.
2043
2044         (WTF::tryFastRealloc): Deleted. Unused.
2045
2046         * wtf/FastMalloc.h:
2047
2048 2015-03-09  Mark Lam  <mark.lam@apple.com>
2049
2050         8-bit version of weakCompareAndSwap() can cause an infinite loop.
2051         https://webkit.org/b/142513>
2052
2053         Reviewed by Filip Pizlo.
2054
2055         Presently, Bitmap::concurrentTestAndSet() uses the 8-bit version of
2056         weakCompareAndSwap() (which compares and swaps an uint8_t value).
2057         Bitmap::concurrentTestAndSet() has a loop that checks if a bit in the
2058         byte of interest has been set.  If not, it will call the 8-bit CAS
2059         function to set the bit.
2060
2061         Under the covers, for ARM, the 8-bit CAS function actually works with a
2062         32-bit CAS.  The 8-bit CAS will first fetch the 32-bit value in memory
2063         that should contain the 8-bit value, and check if it contains the
2064         expected byte.  If the value in memory doesn't have the expected byte,
2065         it will return early to its caller.  The expectation is that the caller
2066         will reload the byte from memory and call the 8-bit CAS again.
2067
2068         Unfortunately, this code path that returns early does not have a
2069         compiler fence.  Without a compiler fence, the C++ compiler can
2070         optimize away the reloading of the expected byte value, leaving it
2071         unchanged.  As a result, we'll have a infinite loop here that checks a
2072         value that will never change, and the loop will not terminate until the
2073         value changes.
2074
2075         The fix is to eliminate the early return check in the 8-bit CAS, and
2076         have it always call down to the 32-bit CAS.  The 32-bit CAS has a
2077         compiler fence which will prevent this issue.
2078
2079         * wtf/Atomics.h:
2080         (WTF::weakCompareAndSwap):
2081
2082 2015-03-09  Martin Robinson  <mrobinson@igalia.com>
2083
2084         [EFL] Move DispatchQueue to WTF
2085         https://bugs.webkit.org/show_bug.cgi?id=142493
2086
2087         Reviewed by Csaba Osztrogonác.
2088
2089         * wtf/PlatformEfl.cmake: Add DispatchQueue to the source list.
2090         * wtf/efl/DispatchQueueEfl.cpp: Renamed from Source/WebKit2/Platform/efl/DispatchQueueEfl.cpp.
2091         * wtf/efl/DispatchQueueEfl.h: Renamed from Source/WebKit2/Platform/efl/DispatchQueueEfl.h.
2092         * wtf/efl/DispatchQueueWorkItemEfl.h: Renamed from Source/WebKit2/Platform/efl/DispatchQueueWorkItemEfl.h.
2093
2094 2015-03-08  Brent Fulgham  <bfulgham@apple.com>
2095
2096         [Win] WTF::WorkQueue does not balance ref/deref properly
2097         https://bugs.webkit.org/show_bug.cgi?id=142471
2098
2099         Reviewed by Antti Koivisto.
2100
2101         Make sure we deref the count when we execute a function in the
2102         WorkQueue.
2103
2104         * wtf/win/WorkQueueWin.cpp:
2105         (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
2106
2107 2015-03-07  Brent Fulgham  <bfulgham@apple.com>
2108
2109         [Win] Revive WTF::WorkQueue on Windows
2110         https://bugs.webkit.org/show_bug.cgi?id=142432
2111
2112         Reviewed by Darin Adler.
2113
2114         Revive the Windows implementation of WTF::WorkQueue.
2115
2116         * WTF.vcxproj/WTF.vcxproj:
2117         * WTF.vcxproj/WTF.vcxproj.filters:
2118         * wtf/WorkQueue.h:
2119         * wtf/win/WorkItemWin.cpp: Added.
2120         * wtf/win/WorkItemWin.h: Added.
2121         * wtf/win/WorkQueueWin.cpp: Added.
2122
2123 2015-03-06  Geoffrey Garen  <ggaren@apple.com>
2124
2125         Fix crashes seen on the the Windows buildbots after my last patch.
2126
2127         Unreviewed.
2128
2129         * wtf/FastMalloc.cpp:
2130         (WTF::fastAlignedMalloc): Let's pass these arguments in the right order.
2131
2132 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
2133
2134         Crash in -[WebCascadeList objectAtIndex:] + 195
2135         https://bugs.webkit.org/show_bug.cgi?id=141274
2136
2137         Reviewed by David Kilzer.
2138
2139         * wtf/WeakPtr.h:
2140         (WTF::WeakPtrFactory::createWeakPtr): WebCascadeList uses a const FontCascade,
2141         and it calls createWeakPtr() on it. Therefore, createWeakPtr has to be marked
2142         const.
2143         (WTF::WeakPtrFactory::operator=): Removed because it was broken and had no
2144         callers
2145
2146 2015-03-06  Simon Fraser  <simon.fraser@apple.com>
2147
2148         Allow tree dumping functions to be used in release builds by switching a flag
2149         https://bugs.webkit.org/show_bug.cgi?id=142379
2150
2151         Reviewed by Zalan Bujtas.
2152
2153         There are various tree dumping functions that are useful for debugging, and sometimes
2154         you want to be able to use them in release builds. Currently they are surrounded by
2155         #ifndef NDEBUG. Change this to #if ENABLE(TREE_DEBUGGING), which is defined to 0 or 1
2156         in wtf/Platform.h
2157
2158         * wtf/Platform.h:
2159
2160 2015-03-05  Chris Dumez  <cdumez@apple.com>
2161
2162         Regression(r173761): ASSERTION FAILED: !is8Bit() in StringImpl::characters16()
2163         https://bugs.webkit.org/show_bug.cgi?id=142350
2164
2165         Reviewed by Michael Saboff and Benjamin Poulain.
2166
2167         Fix ASSERTION FAILED: !is8Bit() in StringImpl::characters16() from
2168         WTF::equalInner() after r173761. The code was incorrectly assuming that
2169         if stringImpl is 16-bit, then matchString is 16-bit too, which is not
2170         correct.
2171
2172         Also rename WTFString::startsWith() / endsWith() taking an offset to
2173         hasInfixStartingAt() / hasInfixEndingAt() for clarity. It seems odd
2174         to call it startsWith even though it won't technically *start* with
2175         the pattern if the input offset is greater than zero.
2176
2177         Also drop the caseSensitive argument as it is never used (always true
2178         at call sites.
2179
2180         * wtf/text/StringImpl.cpp:
2181         (WTF::equalInner):
2182         (WTF::StringImpl::hasInfixStartingAt):
2183         (WTF::StringImpl::hasInfixEndingAt):
2184         (WTF::StringImpl::startsWith): Deleted.
2185         (WTF::StringImpl::endsWith): Deleted.
2186         * wtf/text/StringImpl.h:
2187         * wtf/text/WTFString.h:
2188         (WTF::String::hasInfixStartingAt):
2189         (WTF::String::hasInfixEndingAt):
2190         (WTF::String::startsWith): Deleted.
2191         (WTF::String::endsWith): Deleted.
2192
2193 2015-03-05  Chris Dumez  <cdumez@apple.com>
2194
2195         NetworkCache efficacy logging is using too much CPU
2196         https://bugs.webkit.org/show_bug.cgi?id=142186
2197         <rdar://problem/19632080>
2198
2199         Reviewed by Antti Koivisto.
2200
2201         * wtf/HashMap.h:
2202         (WTF::copyToVector):
2203         Add copyToVector() utility function for HashMap that uses an std::pair<key, value>
2204         as element type.
2205
2206         * wtf/text/WTFString.h:
2207         (WTF::StringCapture::StringCapture):
2208         (WTF::StringCapture::operator=):
2209         Add default constructor and assignment operator to StringCapture so that
2210         it can be used in a Vector.
2211
2212 2015-03-05  Antti Koivisto  <antti@apple.com>
2213
2214         Support WorkQueue QOS classes on Mavericks
2215         https://bugs.webkit.org/show_bug.cgi?id=142328
2216
2217         Reviewed by Anders Carlsson.
2218
2219         "The priority of a dispatch queue is inherited from its target queue.  In order to
2220         change the priority of a queue created with dispatch_queue_create(), use the
2221         dispatch_get_global_queue() function to obtain a target queue of the desired prior-
2222         ity."
2223
2224         * wtf/cocoa/WorkQueueCocoa.cpp:
2225         (WTF::targetQueueForQOSClass):
2226         (WTF::WorkQueue::platformInitialize):
2227
2228 2015-03-03  Anders Carlsson  <andersca@apple.com>
2229
2230         Remove unused compression code
2231         https://bugs.webkit.org/show_bug.cgi?id=142237
2232
2233         Reviewed by Geoffrey Garen.
2234
2235         * WTF.vcxproj/WTF.vcxproj:
2236         * WTF.vcxproj/WTF.vcxproj.filters:
2237         * WTF.xcodeproj/project.pbxproj:
2238         * wtf/CMakeLists.txt:
2239         * wtf/Compression.cpp: Removed.
2240         * wtf/Compression.h: Removed.
2241
2242 2015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2243
2244         [WK2] Remove unnecessary create() factory functions.
2245         https://bugs.webkit.org/show_bug.cgi?id=142161
2246
2247         Reviewed by Chris Dumez.
2248
2249         We can replace some create() factory functions with std::make_unique(). Because
2250         it just returns new instance. Even some of those functions have used std::unique_ptr<>
2251         instead of std::make_unique<>. Fixed all.
2252
2253         * wtf/efl/WorkQueueEfl.cpp:
2254         (WorkQueue::dispatch):
2255
2256 2015-03-02  Filip Pizlo  <fpizlo@apple.com>
2257
2258         DFG compile time measurements should really report milliseconds
2259         https://bugs.webkit.org/show_bug.cgi?id=142209
2260
2261         Reviewed by Benjamin Poulain.
2262         
2263         This bug was introduced because currentTimeMS() calls were converted to
2264         monotonicallyIncreasingTime() calls. Perhaps this bug would be less likely if there was a
2265         monotonicallyIncreasingTimeMS() function available, so this patch adds it.
2266
2267         * wtf/CurrentTime.h:
2268         (WTF::monotonicallyIncreasingTimeMS):
2269
2270 2015-02-27  Darin Adler  <darin@apple.com>
2271
2272         Remove unused PossiblyNull
2273         https://bugs.webkit.org/show_bug.cgi?id=142124
2274
2275         Reviewed by Andreas Kling.
2276
2277         * WTF.vcxproj/WTF.vcxproj: Removed the file.
2278         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
2279         * WTF.xcodeproj/project.pbxproj: Ditto.
2280         * wtf/CMakeLists.txt: Ditto.
2281         * wtf/PossiblyNull.h: Removed.
2282
2283         * wtf/FastMalloc.h: Moved everything to the left.
2284         Moved member functions out of the TryMallocReturnValue class definition.
2285         (WTF::TryMallocReturnValue::operator PossiblyNull<T>): Deleted.
2286         (WTF::TryMallocReturnValue::getValue): Marked inline, changed to work
2287         only with pointer types, not arbitrary non-pointer types.
2288
2289 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
2290
2291         [Win] Make build logs more legible by reducing noise
2292         https://bugs.webkit.org/show_bug.cgi?id=142034
2293
2294         Reviewed by Alexey Proskuryakov.
2295
2296         Modify batch files, makefiles, and DOS commands to remove
2297         uninteresting/unhelpful output.
2298
2299         * WTF.vcxproj/WTFGenerated.make:
2300         * WTF.vcxproj/WTFPreBuild.cmd:
2301         * WTF.vcxproj/copy-files.cmd:
2302
2303 2015-02-26  Landry Breuil  <landry@openbsd.org>
2304
2305         Revert bug 19975, now that gcc 4.7 is required.
2306         https://bugs.webkit.org/show_bug.cgi?id=129927
2307
2308         Reviewed by Andreas Kling.
2309
2310         isfinite() and signbit() are provided by gcc's cmath header.
2311
2312         * wtf/MathExtras.h:
2313
2314 2015-02-26  Csaba Osztrogonác  <ossy@webkit.org>
2315
2316         UNREACHABLE_FOR_PLATFORM() should be release assert
2317         https://bugs.webkit.org/show_bug.cgi?id=141904
2318
2319         Reviewed by Darin Adler.
2320
2321         * wtf/Assertions.h:
2322         (UNREACHABLE_FOR_PLATFORM):
2323
2324 2015-02-25  Filip Pizlo  <fpizlo@apple.com>
2325
2326         Enable concurrent JIT on GTK
2327         https://bugs.webkit.org/show_bug.cgi?id=142007
2328
2329         Reviewed by Benjamin Poulain.
2330
2331         Seems weird that GTK keeps it off. No good reason for that as far as I can tell.
2332
2333         * wtf/Platform.h:
2334
2335 2015-02-23  Brent Fulgham  <bfulgham@apple.com>
2336
2337         WTF::WeakPtr should rename 'forgot' to 'clear' and support nullptr assignment
2338         https://bugs.webkit.org/show_bug.cgi?id=141935
2339
2340         Reviewed by Myles C. Maxfield.
2341
2342         * wtf/WeakPtr.h:
2343         (WTF::WeakPtr::operator=): Added 'nullptr_t' overload.
2344         (WTF::WeakPtr::clear): Renamed from 'forget'
2345         (WTF::WeakPtr::forget): Deleted.
2346
2347 2015-02-23  Brent Fulgham  <bfulgham@apple.com>
2348
2349         WTF::WeakPtr should have a 'forget' method
2350         https://bugs.webkit.org/show_bug.cgi?id=141923
2351
2352         Reviewed by Myles C. Maxfield.
2353
2354         * wtf/WeakPtr.h:
2355         (WTF::WeakPtr::forget): Added.
2356
2357 2015-02-20  Geoffrey Garen  <ggaren@apple.com>
2358
2359         Remove TCMalloc
2360         https://bugs.webkit.org/show_bug.cgi?id=141844
2361
2362         Reviewed by Andreas Kling.
2363
2364         It's unused.
2365
2366         * WTF.vcxproj/WTF.vcxproj:
2367         * WTF.vcxproj/WTF.vcxproj.filters:
2368         * WTF.xcodeproj/project.pbxproj:
2369         * wtf/CMakeLists.txt:
2370         * wtf/FastMalloc.cpp:
2371         (WTF::EntropySource<4>::value): Deleted.
2372         (WTF::EntropySource<8>::value): Deleted.
2373         (WTF::internalEntropyValue): Deleted.
2374         (WTF::freedObjectStartPoison): Deleted.
2375         (WTF::freedObjectEndPoison): Deleted.
2376         (WTF::ClassIndex): Deleted.
2377         (WTF::HardenedSLL::create): Deleted.
2378         (WTF::HardenedSLL::null): Deleted.
2379         (WTF::HardenedSLL::setValue): Deleted.
2380         (WTF::HardenedSLL::value): Deleted.
2381         (WTF::HardenedSLL::operator!): Deleted.
2382         (WTF::HardenedSLL::operator UnspecifiedBoolType): Deleted.
2383         (WTF::HardenedSLL::operator!=): Deleted.
2384         (WTF::HardenedSLL::operator==): Deleted.
2385         (WTF::LgFloor): Deleted.
2386         (WTF::SLL_Next): Deleted.
2387         (WTF::SLL_SetNext): Deleted.
2388         (WTF::SLL_Push): Deleted.
2389         (WTF::SLL_Pop): Deleted.
2390         (WTF::SLL_PopRange): Deleted.
2391         (WTF::SLL_PushRange): Deleted.
2392         (WTF::SizeClass): Deleted.
2393         (WTF::ByteSizeForClass): Deleted.
2394         (WTF::NumMoveSize): Deleted.
2395         (WTF::InitSizeClasses): Deleted.
2396         (WTF::MetaDataAlloc): Deleted.
2397         (WTF::PageHeapAllocator::Init): Deleted.
2398         (WTF::PageHeapAllocator::New): Deleted.
2399         (WTF::PageHeapAllocator::Delete): Deleted.
2400         (WTF::PageHeapAllocator::inuse): Deleted.
2401         (WTF::pages): Deleted.
2402         (WTF::AllocationSize): Deleted.
2403         (WTF::spanInitializerCookie): Deleted.
2404         (WTF::Span::next): Deleted.
2405         (WTF::Span::remoteNext): Deleted.
2406         (WTF::Span::prev): Deleted.
2407         (WTF::Span::setNext): Deleted.
2408         (WTF::Span::setPrev): Deleted.
2409         (WTF::Span::initCookie): Deleted.
2410         (WTF::Span::clearCookie): Deleted.
2411         (WTF::Span::isValid): Deleted.
2412         (WTF::Event): Deleted.
2413         (WTF::NewSpan): Deleted.
2414         (WTF::DeleteSpan): Deleted.
2415         (WTF::DLL_Init): Deleted.
2416         (WTF::DLL_Remove): Deleted.
2417         (WTF::DLL_IsEmpty): Deleted.
2418         (WTF::DLL_Length): Deleted.
2419         (WTF::DLL_Print): Deleted.
2420         (WTF::DLL_Prepend): Deleted.
2421         (WTF::TCMalloc_Central_FreeList::length): Deleted.
2422         (WTF::TCMalloc_Central_FreeList::tc_length): Deleted.
2423         (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Deleted.
2424         (WTF::TCMalloc_Central_FreeList::entropy): Deleted.
2425         (WTF::FastMallocZone::goodSize): Deleted.
2426         (WTF::FastMallocZone::check): Deleted.
2427         (WTF::FastMallocZone::print): Deleted.
2428         (WTF::FastMallocZone::log): Deleted.
2429         (WTF::FastMallocZone::forceLock): Deleted.
2430         (WTF::FastMallocZone::forceUnlock): Deleted.
2431         (WTF::FastMallocZone::statistics): Deleted.
2432         (WTF::FastMallocZone::zoneValloc): Deleted.
2433         (WTF::FastMallocZone::zoneDestroy): Deleted.
2434         (WTF::MallocHook::record): Deleted.
2435         (WTF::MallocHook::recordAllocation): Deleted.
2436         (WTF::MallocHook::recordDeallocation): Deleted.
2437         (WTF::MallocHook::init): Deleted.
2438         (WTF::MallocHook::InvokeNewHook): Deleted.
2439         (WTF::MallocHook::InvokeDeleteHook): Deleted.
2440         (WTF::KernelSupportsTLS): Deleted.
2441         (WTF::CheckIfKernelSupportsTLS): Deleted.
2442         (WTF::TCMalloc_PageHeap::GetDescriptor): Deleted.
2443         (WTF::TCMalloc_PageHeap::GetDescriptorEnsureSafe): Deleted.
2444         (WTF::TCMalloc_PageHeap::SystemBytes): Deleted.
2445         (WTF::TCMalloc_PageHeap::FreeBytes): Deleted.
2446         (WTF::TCMalloc_PageHeap::GetSizeClassIfCached): Deleted.
2447         (WTF::TCMalloc_PageHeap::CacheSizeClass): Deleted.
2448         (WTF::TCMalloc_PageHeap::RecordSpan): Deleted.
2449         (WTF::TCMalloc_PageHeap::init): Deleted.
2450         (WTF::TCMalloc_PageHeap::initializeScavenger): Deleted.
2451         (WTF::TCMalloc_PageHeap::isScavengerSuspended): Deleted.
2452         (WTF::TCMalloc_PageHeap::scheduleScavenger): Deleted.
2453         (WTF::TCMalloc_PageHeap::rescheduleScavenger): Deleted.
2454         (WTF::TCMalloc_PageHeap::suspendScavenger): Deleted.
2455         (WTF::TCMalloc_PageHeap::scavengerTimerFired): Deleted.
2456         (WTF::TCMalloc_PageHeap::runScavengerThread): Deleted.
2457         (WTF::TCMalloc_PageHeap::signalScavenger): Deleted.
2458         (WTF::TCMalloc_PageHeap::scavenge): Deleted.
2459         (WTF::TCMalloc_PageHeap::shouldScavenge): Deleted.
2460         (WTF::TCMalloc_PageHeap::New): Deleted.
2461         (WTF::TCMalloc_PageHeap::AllocLarge): Deleted.
2462         (WTF::TCMalloc_PageHeap::Split): Deleted.
2463         (WTF::TCMalloc_PageHeap::Carve): Deleted.
2464         (WTF::mergeDecommittedStates): Deleted.
2465         (WTF::TCMalloc_PageHeap::Delete): Deleted.
2466         (WTF::TCMalloc_PageHeap::IncrementalScavenge): Deleted.
2467         (WTF::TCMalloc_PageHeap::RegisterSizeClass): Deleted.
2468         (WTF::TCMalloc_PageHeap::ReturnedBytes): Deleted.
2469         (WTF::PagesToMB): Deleted.
2470         (WTF::TCMalloc_PageHeap::Dump): Deleted.
2471         (WTF::TCMalloc_PageHeap::GrowHeap): Deleted.
2472         (WTF::TCMalloc_PageHeap::Check): Deleted.
2473         (WTF::TCMalloc_PageHeap::CheckList): Deleted.
2474         (WTF::TCMalloc_PageHeap::ReleaseFreeList): Deleted.
2475         (WTF::TCMalloc_PageHeap::ReleaseFreePages): Deleted.
2476         (WTF::TCMalloc_ThreadCache_FreeList::Init): Deleted.
2477         (WTF::TCMalloc_ThreadCache_FreeList::length): Deleted.
2478         (WTF::TCMalloc_ThreadCache_FreeList::empty): Deleted.
2479         (WTF::TCMalloc_ThreadCache_FreeList::lowwatermark): Deleted.
2480         (WTF::TCMalloc_ThreadCache_FreeList::clear_lowwatermark): Deleted.
2481         (WTF::TCMalloc_ThreadCache_FreeList::Push): Deleted.
2482         (WTF::TCMalloc_ThreadCache_FreeList::PushRange): Deleted.
2483         (WTF::TCMalloc_ThreadCache_FreeList::PopRange): Deleted.
2484         (WTF::TCMalloc_ThreadCache_FreeList::Pop): Deleted.
2485         (WTF::TCMalloc_ThreadCache_FreeList::Validate): Deleted.
2486         (WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Deleted.
2487         (WTF::TCMalloc_ThreadCache::freelist_length): Deleted.
2488         (WTF::TCMalloc_ThreadCache::Size): Deleted.
2489         (WTF::TCMalloc_ThreadCache::enumerateFreeObjects): Deleted.
2490         (WTF::getPageHeap): Deleted.
2491         (WTF::fastMallocGoodSize): Deleted.
2492         (WTF::TCMalloc_PageHeap::periodicScavenge): Deleted.
2493         (WTF::TCMalloc_PageHeap::scavengerThread): Deleted.
2494         (WTF::setThreadHeap): Deleted.
2495         (WTF::TCMalloc_Central_FreeList::Init): Deleted.
2496         (WTF::TCMalloc_Central_FreeList::ReleaseListToSpans): Deleted.
2497         (WTF::TCMalloc_Central_FreeList::ReleaseToSpans): Deleted.
2498         (WTF::TCMalloc_Central_FreeList::EvictRandomSizeClass): Deleted.
2499         (WTF::TCMalloc_Central_FreeList::MakeCacheSpace): Deleted.
2500         (WTF::TCMalloc_Central_FreeList::ShrinkCache): Deleted.
2501         (WTF::TCMalloc_Central_FreeList::InsertRange): Deleted.
2502         (WTF::TCMalloc_Central_FreeList::RemoveRange): Deleted.
2503         (WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe): Deleted.
2504         (WTF::TCMalloc_Central_FreeList::FetchFromSpans): Deleted.
2505         (WTF::TCMalloc_Central_FreeList::Populate): Deleted.
2506         (WTF::TCMalloc_ThreadCache::SampleAllocation): Deleted.
2507         (WTF::TCMalloc_ThreadCache::Init): Deleted.
2508         (WTF::TCMalloc_ThreadCache::Cleanup): Deleted.
2509         (WTF::TCMalloc_ThreadCache::Allocate): Deleted.
2510         (WTF::TCMalloc_ThreadCache::Deallocate): Deleted.
2511         (WTF::TCMalloc_ThreadCache::FetchFromCentralCache): Deleted.
2512         (WTF::TCMalloc_ThreadCache::ReleaseToCentralCache): Deleted.
2513         (WTF::TCMalloc_ThreadCache::Scavenge): Deleted.
2514         (WTF::TCMalloc_ThreadCache::PickNextSample): Deleted.
2515         (WTF::TCMalloc_ThreadCache::InitModule): Deleted.
2516         (WTF::TCMalloc_ThreadCache::NewHeap): Deleted.
2517         (WTF::TCMalloc_ThreadCache::GetThreadHeap): Deleted.
2518         (WTF::TCMalloc_ThreadCache::GetCache): Deleted.
2519         (WTF::TCMalloc_ThreadCache::GetCacheIfPresent): Deleted.
2520         (WTF::TCMalloc_ThreadCache::InitTSD): Deleted.
2521         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): Deleted.
2522         * wtf/TCPackedCache.h: Removed.
2523         * wtf/TCPageMap.h: Removed.
2524         * wtf/TCSystemAlloc.cpp: Removed.
2525         * wtf/TCSystemAlloc.h: Removed.
2526
2527 2015-02-20  Alexey Proskuryakov  <ap@apple.com>
2528
2529         Remove svn:keywords property.
2530
2531         As far as I can tell, the property had no effect on any of these files, but also,
2532         when it has effect it's likely harmful.
2533
2534         * wtf/DecimalNumber.cpp: Removed property svn:keywords.
2535         * wtf/spi/darwin/XPCSPI.h: Removed property svn:keywords.
2536
2537 2015-02-20  Csaba Osztrogonác  <ossy@webkit.org>
2538
2539         EFL URTBF
2540
2541         * wtf/PlatformEfl.cmake:
2542
2543 2015-02-20  Simon Fraser  <simon.fraser@apple.com>
2544
2545         RunLoop::dispatch() should drop the mutex before calling wakeUp().
2546         https://bugs.webkit.org/show_bug.cgi?id=141820
2547
2548         Reviewed by Alexey Proskuryakov.
2549         
2550         RunLoop::wakeUp() calls into CoreFoundation which could take time,
2551         so scope the mutex just to protect m_functionQueue.
2552
2553         * wtf/RunLoop.cpp:
2554         (WTF::RunLoop::dispatch):
2555
2556 2015-02-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2557
2558         Unreviewed, EFL build fix since r180410.
2559
2560         * wtf/PlatformEfl.cmake: Add WEBKIT2/Platform/efl path in order to include DispatchQueueEfl.h.
2561
2562 2015-02-20  Antti Koivisto  <antti@apple.com>
2563
2564         Move WorkQueue from WK2 to WTF
2565         https://bugs.webkit.org/show_bug.cgi?id=141797
2566
2567         Reviewed by Anders Carlsson.
2568
2569         It may be useful in WebCore.
2570
2571         Windows implementation is still missing.
2572
2573         * WTF.xcodeproj/project.pbxproj:
2574         * wtf/CMakeLists.txt:
2575         * wtf/PlatformGTK.cmake:
2576         * wtf/WorkQueue.cpp: Copied from Source/WebKit2/Platform/WorkQueue.cpp.
2577         * wtf/WorkQueue.h: Copied from Source/WebKit2/Platform/WorkQueue.h.
2578         * wtf/cocoa: Added.
2579         * wtf/cocoa/WorkQueueCocoa.cpp: Copied from Source/WebKit2/Platform/mac/WorkQueueMac.cpp.
2580         * wtf/efl/WorkQueueEfl.cpp: Copied from Source/WebKit2/Platform/efl/WorkQueueEfl.cpp.
2581         * wtf/gtk/WorkQueueGtk.cpp: Copied from Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp.
2582
2583 2015-02-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2584
2585         [EFL] Enable bmalloc for EFL port 
2586         https://bugs.webkit.org/show_bug.cgi?id=141459
2587
2588         Reviewed by Csaba Osztrogonác.
2589
2590         * wtf/CMakeLists.txt: Remove TCSystemAlloc.cpp/h.
2591         * wtf/FastMalloc.cpp: Enable BMALLOC for EFL port.
2592
2593 2015-02-13  Anders Carlsson  <andersca@apple.com>
2594
2595         Add a move constructor and move assignment operator to Deque
2596         https://bugs.webkit.org/show_bug.cgi?id=141571
2597
2598         Reviewed by Andreas Kling.
2599
2600         * wtf/Deque.h:
2601         (WTF::inlineCapacity>::Deque):
2602         (WTF::=): Deleted.
2603
2604 2015-02-13  Anders Carlsson  <andersca@apple.com>
2605
2606         Add an initializer list constructor to Deque
2607         https://bugs.webkit.org/show_bug.cgi?id=141565
2608
2609         Reviewed by Andreas Kling.
2610
2611         * wtf/Deque.h:
2612         (WTF::inlineCapacity>::Deque):
2613
2614 2015-02-13  Anders Carlsson  <andersca@apple.com>
2615
2616         Re-indent Deque.h
2617
2618         Rubber-stamped by Antti Koivisto.
2619
2620         * wtf/Deque.h:
2621
2622 2015-02-11  Brent Fulgham  <bfulgham@apple.com>
2623
2624         [Win] [64-bit] Work around MSVC2013 Runtime Bug
2625         https://bugs.webkit.org/show_bug.cgi?id=141498
2626         <rdar://problem/19803642>
2627
2628         Reviewed by Anders Carlsson.
2629
2630         Disable FMA3 instruction use in the MSVC math library to
2631         work around a VS2013 runtime crash. We can remove this
2632         workaround when we switch to VS2015.
2633
2634         * WTF.vcxproj/WTF.vcxproj: Add new files.
2635         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
2636         * wtf/win/WTFDLL.cpp: Added.
2637
2638 2015-02-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2639
2640         [EFL][GTK] Use bmalloc instead of tcmalloc
2641         https://bugs.webkit.org/show_bug.cgi?id=140162
2642
2643         Reviewed by Carlos Garcia Campos.
2644
2645         * wtf/CMakeLists.txt:
2646         * wtf/FastMalloc.cpp:
2647             Enable bmalloc on GTK ports, but EFL port will enable it when bmalloc supports
2648             memory statistics.
2649
2650 2015-02-10  Darin Adler  <darin@apple.com>
2651
2652         Add the crash-on-failure behavior to bmalloc-based fastMalloc
2653         https://bugs.webkit.org/show_bug.cgi?id=141434
2654
2655         Reviewed by Alexey Proskuryakov.
2656
2657         * wtf/FastMalloc.cpp: Removed unneeded includes.
2658         (WTF::fastMalloc): Added null check and CRASH.
2659         (WTF::fastCalloc): Added overflow checking, null check, and CRASH.
2660         (WTF::fastRealloc): Added null check and CRASH.
2661         (WTF::fastMallocSize): Added FIXME comment.
2662         (WTF::fastMallocGoodSize): Added FIXME comment.
2663         (WTF::fastAlignedMalloc): Added null check and CRASH.
2664         (WTF::tryFastMalloc): Changed to call bmalloc directly instead of
2665         calling fastMalloc, since fastMalloc will now crash on failure.
2666         (WTF::tryFastRealloc): Changed to call bmalloc directly instead of
2667         calling fastRealloc, since fastRealloc will now crash on failure.
2668         (WTF::tryFastCalloc): Added overflow checking.
2669         (WTF::fastMallocStatistics): Added FIXME comment.
2670
2671 2015-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2672
2673         [GTK] GMutexLocker build issue
2674         https://bugs.webkit.org/show_bug.cgi?id=141381
2675
2676         Reviewed by Žan Doberšek.
2677
2678         Remove using WTF::GMutexLocker from the header, since newer glib
2679         versions have a GMutexLocker in the public API.
2680
2681         * wtf/gobject/GMutexLocker.h:
2682
2683 2015-02-09  Alexey Proskuryakov  <ap@apple.com>
2684
2685         REGRESSION: tryFastCalloc is no longer "try"
2686         https://bugs.webkit.org/show_bug.cgi?id=141406
2687
2688         Reviewed by Darin Adler.
2689
2690         This causes crashes on some WebKit regression test bots.
2691
2692         * wtf/FastMalloc.cpp: (WTF::tryFastCalloc): Fix what looks like a copy/paste mistake.
2693
2694 2015-02-07  Csaba Osztrogonác  <ossy@webkit.org>
2695
2696         [ARM] GC sometimes stuck in an infinite loop if parallel GC is enabled
2697         https://bugs.webkit.org/show_bug.cgi?id=141290
2698
2699         Reviewed by Anders Carlsson.
2700
2701         * wtf/Platform.h:
2702
2703 2015-02-07  Chris Dumez  <cdumez@apple.com>
2704
2705         Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
2706         https://bugs.webkit.org/show_bug.cgi?id=141321
2707
2708         Reviewed by Darin Adler.
2709
2710         Add Vector::removeFirstMatching() / removeAllMatching() methods taking
2711         lambda functions to match the element(s) to remove. This simplifies the
2712         code a bit. Vector::removeAllMatching() is also more efficient than the
2713         manual removal alternative.
2714
2715         * wtf/Vector.h:
2716
2717 2015-02-06  Commit Queue  <commit-queue@webkit.org>
2718
2719         Unreviewed, rolling out r179743.
2720         https://bugs.webkit.org/show_bug.cgi?id=141335
2721
2722         caused missing symbols in non-WebKit clients of WTF::Vector
2723         (Requested by kling on #webkit).
2724
2725         Reverted changeset:
2726
2727         "Remove WTF::fastMallocGoodSize()."
2728         https://bugs.webkit.org/show_bug.cgi?id=141020
2729         http://trac.webkit.org/changeset/179743
2730
2731 2015-02-06  Andreas Kling  <akling@apple.com>
2732
2733         Remove WTF::fastMallocGoodSize().
2734         <https://webkit.org/b/141020>
2735
2736         Reviewed by Anders Carlsson.
2737
2738         bmalloc's good-size API just returns exactly whatever you pass it,
2739         so it's of no utility to us anymore.
2740
2741         This gets rid of a bunch of pointless out-of-line calls in Vector
2742         construction and growth.
2743
2744         * wtf/Compression.cpp:
2745         (WTF::GenericCompressedData::create):
2746         * wtf/FastMalloc.cpp:
2747         (WTF::fastMallocGoodSize): Deleted.
2748         * wtf/FastMalloc.h:
2749         * wtf/Vector.h:
2750         (WTF::VectorBufferBase::allocateBuffer):
2751         (WTF::VectorBufferBase::tryAllocateBuffer):
2752         (WTF::VectorBufferBase::reallocateBuffer):
2753
2754 2015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
2755
2756         [Streams API] Implement a barebone ReadableStream interface
2757         https://bugs.webkit.org/show_bug.cgi?id=141045
2758
2759         Reviewed by Benjamin Poulain.
2760
2761         * wtf/FeatureDefines.h:
2762
2763 2015-02-04  Alexey Proskuryakov  <ap@apple.com>
2764
2765         Optimized equal() functions in StringImpl.h are not ASan compatible
2766         https://bugs.webkit.org/show_bug.cgi?id=141258
2767
2768         Reviewed by Daniel Bates.
2769
2770         * wtf/text/StringImpl.h: (WTF::equal): Add custom implementations for ASan.
2771
2772 2015-02-04  Chris Dumez  <cdumez@apple.com>
2773
2774         Add removeFirst(value) / removeAll(value) methods to WTF::Vector
2775         https://bugs.webkit.org/show_bug.cgi?id=141192
2776
2777         Reviewed by Benjamin Poulain.
2778
2779         Add removeFirst(value) / removeAll(value) convenience methods to
2780         WTF::Vector to reduce complexity a bit at call sites.
2781
2782         I am planning to add overloads for these taking a lambda function for
2783         matching in a follow-up patch as well. I have seen quite a few
2784         Vector::remove(index) call sites that would benefit from it.
2785
2786         * wtf/Vector.h:
2787         (WTF::OverflowHandler>::removeFirst):
2788         (WTF::OverflowHandler>::removeAll):
2789
2790 2015-02-02  Dhi Aurrahman  <diorahman@rockybars.com>
2791
2792         Optimize matchesLangPseudoClass() of :lang()
2793         https://bugs.webkit.org/show_bug.cgi?id=140873
2794
2795         Reviewed by Darin Adler.
2796
2797         Add some basic equality comparison operators.
2798
2799         * wtf/text/StringView.h:
2800         (WTF::operator==):
2801         (WTF::operator!=):
2802         (WTF::equal):
2803         (WTF::equalIgnoringASCIICase):
2804
2805 2015-02-02  Geoffrey Garen  <ggaren@apple.com>
2806
2807         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
2808         https://bugs.webkit.org/show_bug.cgi?id=140900
2809
2810         Reviewed by Mark Hahnenberg.
2811
2812         Re-landing just the HandleBlock piece of this patch.
2813
2814         * wtf/FastMalloc.cpp:
2815         (WTF::fastAlignedMalloc):
2816         (WTF::fastAlignedFree):
2817         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2818         * wtf/FastMalloc.h:
2819
2820 2015-02-02  Daniel Bates  <dabates@apple.com>
2821
2822         [iOS] ASSERTION FAILED: m_scriptExecutionContext->isContextThread() in ContextDestructionObserver::observeContext
2823         https://bugs.webkit.org/show_bug.cgi?id=141057
2824         <rdar://problem/19068790>
2825
2826         Reviewed by Alexey Proskuryakov.
2827
2828         * wtf/MainThread.h:
2829         * wtf/mac/MainThreadMac.mm:
2830         (WTF::callOnWebThreadOrDispatchAsyncOnMainThread): Added.
2831
2832 2015-01-31  Sam Weinig  <sam@webkit.org>
2833
2834         Remove even more Mountain Lion support
2835         https://bugs.webkit.org/show_bug.cgi?id=141124
2836
2837         Reviewed by Alexey Proskuryakov.
2838
2839         * Configurations/Base.xcconfig:
2840         * Configurations/DebugRelease.xcconfig:
2841         * wtf/Assertions.cpp:
2842         * wtf/FeatureDefines.h:
2843         * wtf/Platform.h:
2844
2845 2015-01-31  Commit Queue  <commit-queue@webkit.org>
2846
2847         Unreviewed, rolling out r179426.
2848         https://bugs.webkit.org/show_bug.cgi?id=141119
2849
2850         "caused a memory use regression" (Requested by Guest45 on
2851         #webkit).
2852
2853         Reverted changeset:
2854
2855         "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
2856         pages"
2857         https://bugs.webkit.org/show_bug.cgi?id=140900
2858         http://trac.webkit.org/changeset/179426
2859
2860 2015-01-31  Commit Queue  <commit-queue@webkit.org>
2861
2862         Unreviewed, rolling out r179408.
2863         https://bugs.webkit.org/show_bug.cgi?id=141117
2864
2865         This didn't fully fix the issue (Requested by anttik on
2866         #webkit).
2867
2868         Reverted changeset:
2869
2870         "OSObjectPtr does not work with dispatch_data_t on Maverics"
2871         https://bugs.webkit.org/show_bug.cgi?id=141081
2872         http://trac.webkit.org/changeset/179408
2873
2874 2015-01-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2875
2876         Implement ES6 Symbol
2877         https://bugs.webkit.org/show_bug.cgi?id=140435
2878
2879         Reviewed by Geoffrey Garen.
2880
2881         Introduce new unique string mechanizm into StringImpl.
2882         It is used for implementing Symbol which holds a [[Description]] value.
2883
2884         * wtf/text/AtomicString.h:
2885         (WTF::AtomicString::add):
2886         (WTF::AtomicString::addWithStringTableProvider):
2887
2888         Previously, we checked `isAtomic()` or `!length()`. This guard can filter out EmptyUnique.
2889         But now, we introduced new unique StringImpl. Since it has an actual string value, we need to check `isUnique()`.
2890
2891         * wtf/text/StringImpl.cpp:
2892         (WTF::StringImpl::~StringImpl):
2893         (WTF::StringImpl::createUnique):
2894
2895         In createUnique, we leverage Substring mechanizm to produce a new unique
2896         string from an existing string.
2897
2898         * wtf/text/StringImpl.h:
2899         (WTF::StringImpl::StringImpl):
2900         (WTF::StringImpl::createUniqueEmpty):
2901         (WTF::StringImpl::flagIsUnique):
2902         (WTF::StringImpl::isUnique):
2903         (WTF::StringImpl::setIsAtomic):
2904         (WTF::StringImpl::createEmptyUnique): Deleted.
2905         (WTF::StringImpl::isEmptyUnique): Deleted.
2906
2907         Instead of EmptyUnique, we introduced new flag to StringImpl, `isUnique`.
2908         While EmptyUnique cannot hold any string values except for empty string,
2909         the unique StringImpl can hold any String values.
2910         We fold the Symbol's descriptiveString value here.
2911
2912         * wtf/text/StringStatics.cpp:
2913         (WTF::StringImpl::hashAndFlagsForUnique):
2914         (WTF::StringImpl::hashAndFlagsForEmptyUnique): Deleted.
2915
2916 2015-01-30  Geoffrey Garen  <ggaren@apple.com>
2917
2918         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
2919         https://bugs.webkit.org/show_bug.cgi?id=140900
2920
2921         Reviewed by Mark Hahnenberg.
2922
2923         Re-landing just the HandleBlock piece of this patch.
2924
2925         * wtf/FastMalloc.cpp:
2926         (WTF::fastAlignedMalloc):
2927         (WTF::fastAlignedFree):
2928         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2929         * wtf/FastMalloc.h:
2930
2931 2015-01-30  Namhoon Kim  <yanhkim@gmail.com>
2932
2933         Call vsnprintf instead of _vsnprintf in vprintf_stderr_common
2934         https://bugs.webkit.org/show_bug.cgi?id=141078
2935
2936         In windows _vsnprintf api does not place null character
2937         automatically. Simply replace it with vsnprintf. Which is
2938         polyfill to call wtf_vsnprintf in windows.
2939
2940         Reviewed by Brent Fulgham.
2941
2942         * wtf/Assertions.cpp:
2943
2944 2015-01-30  Brian J. Burg  <burg@cs.washington.edu>
2945
2946         Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
2947         https://bugs.webkit.org/show_bug.cgi?id=141039
2948
2949         Reviewed by Timothy Hatcher.
2950
2951         Add messages to Stopwatch assertions, and clean up constructor.
2952
2953         * wtf/Stopwatch.h:
2954         (WTF::Stopwatch::Stopwatch):
2955         (WTF::Stopwatch::start):
2956         (WTF::Stopwatch::stop):
2957
2958 2015-01-30  Chris Dumez  <cdumez@apple.com>
2959
2960         Add match_constness<Reference, T> helper struct
2961         https://bugs.webkit.org/show_bug.cgi?id=140905
2962
2963         Reviewed by Benjamin Poulain.
2964
2965         Add match_constness<Reference, T> helper struct to simplify downcast<>()
2966         a bit. The purpose of this helper is to update T's constness to match
2967         Reference's.
2968
2969         * wtf/TypeCasts.h:
2970         (WTF::downcast):
2971
2972 2015-01-30  Chris Dumez  <cdumez@apple.com>
2973
2974         Add assertion in RefPtr's operator*() to make sure we don't dereference nullptr
2975         https://bugs.webkit.org/show_bug.cgi?id=141092
2976
2977         Reviewed by Anders Carlsson.
2978
2979         Add assertion in RefPtr's operator*() to make sure we don't dereference
2980         nullptr.
2981
2982         * wtf/RefPtr.h:
2983         (WTF::RefPtr::operator*):
2984
2985 2015-01-30  Geoffrey Garen  <ggaren@apple.com>
2986
2987         GC marking threads should clear malloc caches
2988         https://bugs.webkit.org/show_bug.cgi?id=141097
2989
2990         Reviewed by Andreas Kling.
2991
2992         Split the scavenging API into per-thread vs global, so that you can
2993         request to scavenge your own thread without scavenging the whole heap.
2994
2995         * wtf/FastMalloc.cpp:
2996         (WTF::releaseFastMallocFreeMemoryForThisThread):
2997         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2998         * wtf/FastMalloc.h:
2999
3000 2015-01-30  Antti Koivisto  <antti@apple.com>
3001
3002         OSObjectPtr does not work with dispatch_data_t on Maverics
3003         https://bugs.webkit.org/show_bug.cgi?id=141081
3004
3005         Reviewed by Pratik Solanki.
3006         
3007         Trying to use OSObjectPtr<dispatch_data_t> throws 
3008         
3009         -[OS_dispatch_data _xref_dispose]: unrecognized selector sent to instance 0
3010
3011         * wtf/OSObjectPtr.h:
3012         (WTF::retainOSObject<dispatch_data_t>):
3013         (WTF::releaseOSObject<dispatch_data_t>):
3014         
3015             Add specialization for dispatch_data_t on Maverics.
3016
3017 2015-01-29  Santosh Mahto  <santoshbit2007@gmail.com>
3018
3019         Refactor String::format to handle unreached va_end.
3020         https://bugs.webkit.org/show_bug.cgi?id=140938
3021
3022         Reviewed by Alexey Proskuryakov.
3023
3024         Now va_end is called for all platform after getting length
3025         of formatted string and again va_start/va_end is called to write
3026         formatted string in buffer. This way it ensure va_end is always
3027         reached for each va_start.
3028
3029         * wtf/text/WTFString.cpp:
3030
3031 2015-01-29  Csaba Osztrogonác  <ossy@webkit.org>
3032
3033         Move HAVE_DTRACE definition back to Platform.h
3034         https://bugs.webkit.org/show_bug.cgi?id=141033
3035
3036         Reviewed by Dan Bernstein.
3037
3038         * wtf/Platform.h:
3039
3040 2015-01-28  Namhoon Kim  <namkim@ea.com>
3041
3042         Windows return -1 when calling vsnprintf with arguments that exceed target buffer size
3043         https://bugs.webkit.org/show_bug.cgi?id=140917
3044
3045         Reviewed by Brent Fulgham.
3046
3047         Fix return value of vsnprintf when windows API return -1 to denote
3048         requested buffer exceeded. Replace return value by calling vscprintf.
3049
3050         * wtf/StringExtras.h:
3051         (snprintf): Fix return value by calling vscprintf when buffer exceeded.
3052         (wtf_vsnprintf): Ditto.
3053
3054 2015-01-28  Geoffrey Garen  <ggaren@apple.com>
3055
3056         Removed fastMallocForbid / fastMallocAllow
3057         https://bugs.webkit.org/show_bug.cgi?id=141012
3058
3059         Reviewed by Mark Hahnenberg.
3060
3061         Removed the forbid / allow API because it is no longer used.
3062
3063         * wtf/FastMalloc.cpp:
3064         (WTF::tryFastMalloc):
3065         (WTF::fastMalloc):
3066         (WTF::tryFastCalloc):
3067         (WTF::fastCalloc):
3068         (WTF::fastFree):
3069         (WTF::tryFastRealloc):
3070         (WTF::fastRealloc):
3071         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3072         (WTF::isForbidden): Deleted.
3073         (WTF::fastMallocForbid): Deleted.
3074         (WTF::fastMallocAllow): Deleted.
3075         (WTF::initializeIsForbiddenKey): Deleted.
3076         * wtf/FastMalloc.h:
3077
3078 2015-01-28  Dana Burkart  <dburkart@apple.com>
3079
3080         Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
3081         https://bugs.webkit.org/show_bug.cgi?id=136765
3082
3083         Reviewed by Alexey Proskuryakov.
3084
3085         * Configurations/Base.xcconfig:
3086         * Configurations/DebugRelease.xcconfig:
3087
3088 2015-01-28  Darin Adler  <darin@apple.com>
3089
3090         Fix small leak in Collator
3091         https://bugs.webkit.org/show_bug.cgi?id=140990
3092
3093         Reviewed by Andreas Kling.
3094
3095         * wtf/unicode/icu/CollatorICU.cpp:
3096         (WTF::Collator::Collator): Use fastStrDup instead of strdup.
3097         (WTF::Collator::~Collator): Use fastFree on the collator locale that we
3098         are abandoning. The old code instead just called free on a null pointer.
3099
3100 2015-01-27  Geoffrey Garen  <ggaren@apple.com>
3101
3102         Removed WTF_MALLOC_VALIDATION
3103         https://bugs.webkit.org/show_bug.cgi?id=140958
3104
3105         Reviewed by Anders Carlsson.
3106
3107         I don't think anyone has been using this, and the #ifdefs were driving
3108         me crazy.
3109
3110         We have other options for validation -- like MallocGuardEdges,
3111         MallocCheckHeapEach, MallocScribble, and GuardMalloc.
3112
3113         * wtf/FastMalloc.cpp:
3114         (WTF::tryFastMalloc):
3115         (WTF::fastMalloc):
3116         (WTF::tryFastCalloc):
3117         (WTF::fastCalloc):
3118         (WTF::fastFree):
3119         (WTF::tryFastRealloc):
3120         (WTF::fastRealloc):
3121         (WTF::fastMallocSize):
3122         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3123         (WTF::Internal::fastMallocMatchFailed): Deleted.
3124         * wtf/FastMalloc.h:
3125         (WTF::Internal::fastMallocValidationHeader): Deleted.
3126         (WTF::Internal::fastMallocValidationSuffix): Deleted.
3127         (WTF::Internal::fastMallocMatchValidationType): Deleted.
3128         (WTF::Internal::setFastMallocMatchValidationType): Deleted.
3129         (WTF::fastMallocMatchValidateMalloc): Deleted.
3130         (WTF::fastMallocMatchValidateFree): Deleted.
3131         (WTF::fastMallocValidate): Deleted.
3132
3133 2015-01-27  Commit Queue  <commit-queue@webkit.org>
3134
3135         Unreviewed, rolling out r179192.
3136         https://bugs.webkit.org/show_bug.cgi?id=140953
3137
3138         Caused numerous layout test failures (Requested by mattbaker_
3139         on #webkit).
3140
3141         Reverted changeset:
3142
3143         "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
3144         pages"
3145         https://bugs.webkit.org/show_bug.cgi?id=140900
3146         http://trac.webkit.org/changeset/179192
3147
3148 2015-01-26  Geoffrey Garen  <ggaren@apple.com>
3149
3150         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
3151         https://bugs.webkit.org/show_bug.cgi?id=140900
3152
3153         Reviewed by Mark Hahnenberg.
3154
3155         New interface for aligned allocation: fastAlignedMalloc / fastAlignedFree.
3156         We require a special function call on free because Windows.
3157
3158         * wtf/FastMalloc.cpp:
3159         (WTF::fastAlignedMalloc):
3160         (WTF::fastAlignedFree): Do it.
3161
3162         (WTF::do_memalign): Un-ifdef this, since we use it now.
3163
3164         * wtf/FastMalloc.h: Make our new function names visible like the rest
3165         of fastMalloc.
3166
3167 2015-01-26  Brent Fulgham  <bfulgham@apple.com>
3168
3169         [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
3170         https://bugs.webkit.org/show_bug.cgi?id=87426
3171         <rdar://problem/11527899>
3172
3173         Reviewed by Darin Adler.
3174
3175         Revise internal containers to use std::addressof in preference to
3176         to using the '&' operator.
3177
3178         * wtf/Deque.h:
3179         (WTF::inlineCapacity>::append):
3180         (WTF::inlineCapacity>::prepend):
3181         (WTF::inlineCapacity>::removeFirst):
3182         (WTF::inlineCapacity>::removeLast):
3183         (WTF::inlineCapacity>::remove):
3184         (WTF::inlineCapacity>::after):
3185         (WTF::inlineCapacity>::before):
3186         * wtf/GetPtr.h:
3187         * wtf/HashTable.h:
3188         (WTF::HashTableBucketInitializer<false>::initialize):
3189         * wtf/HashTraits.h:
3190         (WTF::SimpleClassHashTraits::constructDeletedValue):
3191         (WTF::CustomHashTraits::constructDeletedValue):
3192         * wtf/ListHashSet.h:
3193         (WTF::ListHashSetConstIterator::get):
3194         * wtf/Vector.h:
3195         (WTF::Vector::swap):
3196         (WTF::OverflowHandler>::append):
3197         (WTF::OverflowHandler>::tryAppend):
3198         (WTF::OverflowHandler>::insert):
3199
3200 2015-01-24  Chris Dumez  <cdumez@apple.com>
3201
3202         Provide implementation for WTF::DefaultHash<bool>
3203         https://bugs.webkit.org/show_bug.cgi?id=140848
3204
3205         Reviewed by Anders Carlsson.
3206
3207         Provide implementation for WTF::DefaultHash<bool> so that we can use
3208         HashMap<std::pair<XXX, bool>> in the code base. Right now, we need to
3209         use some integer type to work around the issue.
3210
3211         * wtf/HashFunctions.h:
3212
3213 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3214
3215         [GTK] Add missing null check in some derefGPtr implementations
3216         https://bugs.webkit.org/show_bug.cgi?id=140822
3217
3218         Reviewed by Sergio Villar Senin.
3219
3220         It's missing in GHashTable and GVariant implementations.
3221
3222         * wtf/gobject/GRefPtr.cpp:
3223         (WTF::derefGPtr):
3224
3225 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3226
3227         [GTK] Add initial database process support
3228         https://bugs.webkit.org/show_bug.cgi?id=139491
3229
3230         Reviewed by Sergio Villar Senin.
3231
3232         Add support for using GRefPtr with GVariantBuilder.
3233
3234         * wtf/gobject/GRefPtr.cpp:
3235         (WTF::refGPtr):
3236         (WTF::derefGPtr):
3237         * wtf/gobject/GRefPtr.h:
3238         * wtf/gobject/GTypedefs.h:
3239
3240 2015-01-22  Ryosuke Niwa  <rniwa@webkit.org>
3241
3242         Add a build flag for ES6 class syntax
3243         https://bugs.webkit.org/show_bug.cgi?id=140760
3244
3245         Reviewed by Michael Saboff.
3246
3247         * wtf/FeatureDefines.h:
3248
3249 2015-01-21  Csaba Osztrogonác  <ossy@webkit.org>
3250
3251         Remove ENABLE(INSPECTOR) ifdef guards
3252         https://bugs.webkit.org/show_bug.cgi?id=140668
3253
3254         Reviewed by Darin Adler.
3255
3256         * wtf/FeatureDefines.h:
3257
3258 2015-01-20  YunQiang Su  <wzssyqa@gmail.com>
3259
3260         Fix failed to build for Linux/MIPS64EL
3261         https://bugs.webkit.org/show_bug.cgi?id=124370
3262
3263         Reviewed by Darin Adler.
3264
3265         Add MIPS64EL support.
3266
3267         * wtf/Platform.h:
3268         * wtf/dtoa/utils.h:
3269
3270 2015-01-19  Alexey Proskuryakov  <ap@apple.com>
3271
3272         Make ASan do bounds checks for WTF::Vector
3273         https://bugs.webkit.org/show_bug.cgi?id=140631
3274         rdar://problem/19437718
3275
3276         Reviewed by Darin Adler.
3277
3278         * wtf/SizeLimits.cpp: Disable Vector object size checks for ASan enabled builds.
3279
3280         * wtf/Vector.h:
3281         (WTF::VectorBuffer::endOfBuffer):
3282         (WTF::Vector::Vector):
3283         (WTF::Vector::~Vector):
3284         (WTF::Vector::swap):
3285         (WTF::OverflowHandler>::Vector):
3286         (WTF::=):
3287         (WTF::OverflowHandler>::fill):
3288         (WTF::OverflowHandler>::resize):
3289         (WTF::OverflowHandler>::shrink):
3290         (WTF::OverflowHandler>::grow):
3291         (WTF::OverflowHandler>::asanSetInitialBufferSizeTo):
3292         (WTF::OverflowHandler>::asanSetBufferSizeToFullCapacity):
3293         (WTF::OverflowHandler>::asanBufferSizeWillChangeTo):
3294         (WTF::OverflowHandler>::reserveCapacity):
3295         (WTF::OverflowHandler>::tryReserveCapacity):
3296         (WTF::OverflowHandler>::shrinkCapacity):
3297         (WTF::OverflowHandler>::append):
3298         (WTF::OverflowHandler>::tryAppend):
3299         (WTF::OverflowHandler>::appendSlowCase):
3300         (WTF::OverflowHandler>::uncheckedAppend):
3301         (WTF::OverflowHandler>::insert):
3302         (WTF::OverflowHandler>::remove):
3303         (WTF::OverflowHandler>::releaseBuffer):
3304
3305         * wtf/Compiler.h: Changed ASAN_ENABLED macro fallback value from false to 0,
3306         MSVC was not happy with false.
3307
3308 2015-01-20  Csaba Osztrogonác  <ossy@webkit.org>
3309
3310         Remove non-Windows cruft from WebKit/win/Plugins
3311         https://bugs.webkit.org/show_bug.cgi?id=140675
3312
3313         Reviewed by Anders Carlsson.
3314
3315         * wtf/FeatureDefines.h:
3316
3317 2015-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
3318
3319         WeakPtr functions crash when created with default constructor
3320         https://bugs.webkit.org/show_bug.cgi?id=140479
3321
3322         Reviewed by Andreas Kling.
3323
3324         This patch rearranges how WeakPtr works, and has the following ideas behind it:
3325
3326         1. WeakPtr should use Ref internally. This solves the crash by always having a
3327         valid WeakReference.
3328         2. Clients should not be able to construct WeakReferences directly. Instead,
3329         only WeakPtrFactory (and WeakPtr's default constructor) should be able to
3330         construct them. They are considered an implementation detail of WeakPtr.
3331         3. Except for the default constructor, clients should not be able to construct
3332         WeakPtrs directly. Instead, the WeakPtrFactory must construct them. This
3333         guarantees that the WeakPtrs all reference the same WeakReference.
3334         4. Clients can construct a WeakPtr using its default constructor, and then
3335         use the assignment operator to make it non-null. (Or they could use
3336         WeakPtrFactory to make it non-null at creation-time.)
3337         5. No one was using WeakReference::bindTo(), and it doesn't seem useful, so I
3338         removed it.
3339
3340         Tests: WTF_WeakPtr API tests
3341
3342         * wtf/Ref.h:
3343         (WTF::Ref::Ref): Added extra ASSERT()s, and explicitly deleted copy
3344         constructors with a comment.
3345         (WTF::Ref::operator=): Added extra ASSERT()s, and explicitly deleted copy
3346         assignment operators with a comment.
3347         * wtf/WeakPtr.h:
3348         (WTF::WeakReference::clear): Used nullptr.
3349         (WTF::WeakReference::create): Moved to private:
3350         (WTF::WeakPtr::WeakPtr): For the default constructor, initialized the Ref with
3351         a new WeakReference. For the other constructor, moved it to private:. Also added
3352         copy constructors and copy assignment operators (since Ref doesn't have them but
3353         RefPtr does). These constructors/operators are relied upon in various places
3354         throughout WebCore.
3355         (WTF::WeakPtr::operator bool): Made non-explicit.
3356         (WTF::WeakReference::createUnbound): Deleted.
3357         (WTF::WeakReference::bindTo): Deleted.
3358         (WTF::WeakReference::WeakReference): Deleted.
3359         (WTF::WeakPtrFactory::WeakPtrFactory): Deleted.
3360
3361 2015-01-16  Yusuke Suzuki  <utatane.tea@gmail.com>
3362
3363         std::all_of requires complete C++ iterators in GCC 4.8
3364         https://bugs.webkit.org/show_bug.cgi?id=140530
3365
3366         Reviewed by Darin Adler.
3367
3368         In the WebKit2/UIProcess/WebProcessLifetimeObserver.cpp, std::all_of
3369         is used for HashIterators. However, std::all_of requires the complete
3370         C++ iterator interface including iterator_category typedef member and
3371         it raises compile error in GCC 4.8 (and libstdc++) environment.
3372
3373         This patch inherits std::iterator with appropriate type parameters.
3374         It automatically defines required typedefs including iterator_category.
3375
3376         * wtf/HashIterators.h:
3377
3378 2015-01-15  Csaba Osztrogonác  <ossy@webkit.org>
3379
3380         Remove ENABLE(SQL_DATABASE) guards
3381         https://bugs.webkit.org/show_bug.cgi?id=140434
3382
3383         Reviewed by Darin Adler.
3384
3385         * wtf/FeatureDefines.h:
3386
3387 2015-01-14  Csaba Osztrogonác  <ossy@webkit.org>
3388
3389         Unreviewed fix after r163330.
3390
3391         * wtf/Platform.h: Use C style comment.
3392
3393 2015-01-14  Marc Juul  <juul@sudomesh.org>
3394
3395         C++ style comment was preventing compile if CPU(ARM_NEON)
3396         https://bugs.webkit.org/show_bug.cgi?id=133827
3397
3398         Reviewed by Csaba Osztrogonác.
3399
3400         * wtf/Platform.h:
3401
3402 2015-01-13  Chris Dumez  <cdumez@apple.com>
3403
3404         Make WTF::Optional work with msvc 2013
3405         https://bugs.webkit.org/show_bug.cgi?id=140401
3406
3407         Reviewed by Anders Carlsson.
3408
3409         Update the WTF::Optional implementation to use std::aligned_memory and
3410         placement new instead of an unrestricted union because msvc 2013 still
3411         doesn't support unrestricted unions.
3412
3413         This change is a pre-requirement to fix Bug 140347 as this change uses
3414         WTF::Optional with types that have non-trivial copy constructors.
3415
3416         This change is covered by the existing Optional WTF test.
3417
3418         * wtf/Optional.h:
3419
3420 2015-01-11  Sam Weinig  <sam@webkit.org>
3421
3422         Remove support for SharedWorkers
3423         https://bugs.webkit.org/show_bug.cgi?id=140344
3424
3425         Reviewed by Anders Carlsson.
3426
3427         * wtf/FeatureDefines.h:
3428
3429 2015-01-12  Darin Adler  <darin@apple.com>
3430
3431         Modernize and streamline HTMLTokenizer
3432         https://bugs.webkit.org/show_bug.cgi?id=140166
3433
3434         Reviewed by Sam Weinig.
3435
3436         * wtf/Forward.h: Removed PassRef, added OrdinalNumber and TextPosition.
3437
3438 2015-01-09  Commit Queue  <commit-queue@webkit.org>
3439
3440         Unreviewed, rolling out r178154, r178163, and r178164.
3441         https://bugs.webkit.org/show_bug.cgi?id=140292
3442
3443         Still multiple assertion failures on tests (Requested by ap on
3444         #webkit).
3445
3446         Reverted changesets:
3447
3448         "Modernize and streamline HTMLTokenizer"
3449         https://bugs.webkit.org/show_bug.cgi?id=140166
3450         http://trac.webkit.org/changeset/178154
3451
3452         "Unreviewed speculative buildfix after r178154."
3453         http://trac.webkit.org/changeset/178163
3454
3455         "One more unreviewed speculative buildfix after r178154."
3456         http://trac.webkit.org/changeset/178164
3457
3458 2015-01-08  Darin Adler  <darin@apple.com>
3459
3460         Modernize and streamline HTMLTokenizer
3461         https://bugs.webkit.org/show_bug.cgi?id=140166
3462
3463         Reviewed by Sam Weinig.
3464
3465         * wtf/Forward.h: Removed PassRef, added OrdinalNumber and TextPosition.
3466
3467 2015-01-08  Benjamin Poulain  <benjamin@webkit.org>
3468
3469         [WK2] Start a prototype for declarative site specific extensions
3470         https://bugs.webkit.org/show_bug.cgi?id=140160
3471
3472         Reviewed by Andreas Kling.
3473
3474         * wtf/FeatureDefines.h:
3475
3476 2015-01-07  Daniel Bates  <dabates@apple.com>
3477
3478         [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
3479         https://bugs.webkit.org/show_bug.cgi?id=137371
3480
3481         As pointed out by Tim Horton, use C-style comment instead of C++-style comment as
3482         wtf/Compiler.h is included in the sandbox profile and the sandbox profile compiler
3483         doesn't understand C++-style comments.
3484
3485         * wtf/Compiler.h:
3486
3487 2015-01-07  Daniel Bates  <dabates@apple.com>
3488
3489         [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
3490         https://bugs.webkit.org/show_bug.cgi?id=137371
3491
3492         Reviewed by David Kilzer.
3493
3494         Move EXTERN_C_BEGIN and EXTERN_C_END macros from file WebKit2/config.h to here and
3495         rename them to WTF_EXTERN_C_BEGIN and WTF_EXTERN_C_END, respectively, so that we
3496         can make use of these macros in SPI wrapper headers (e.g. UIKitSPI.h).
3497
3498         I'll look to transition existing code to WTF_EXTERN_C_BEGIN/WTF_EXTERN_C_END and
3499         remove EXTERN_C in a subsequent commit(s).
3500
3501         * wtf/Compiler.h:
3502
3503 2015-01-07  Commit Queue  <commit-queue@webkit.org>
3504
3505         Unreviewed, rolling out r178068.
3506         https://bugs.webkit.org/show_bug.cgi?id=140235
3507
3508         Breaks the iOS build (Requested by enrica on #webkit).
3509
3510         Reverted changeset:
3511
3512         "[iOS] Make WebKit2 build with public iOS SDK and more build
3513         fixes for DRT"
3514         https://bugs.webkit.org/show_bug.cgi?id=137371
3515         http://trac.webkit.org/changeset/178068
3516
3517 2015-01-07  Daniel Bates  <dabates@apple.com>
3518
3519         [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
3520         https://bugs.webkit.org/show_bug.cgi?id=137371
3521
3522         Reviewed by David Kilzer.
3523
3524         Move EXTERN_C_BEGIN and EXTERN_C_END macros from file WebKit2/config.h to here and
3525         rename them to WTF_EXTERN_C_BEGIN and WTF_EXTERN_C_END, respectively, so that we
3526         can make use of these macros in SPI wrapper headers (e.g. UIKitSPI.h).
3527
3528         I'll look to transition existing code to WTF_EXTERN_C_BEGIN/WTF_EXTERN_C_END and
3529         remove EXTERN_C in a subsequent commit(s).
3530
3531         * wtf/Compiler.h:
3532
3533 2015-01-07  Brian J. Burg  <burg@cs.washington.edu>
3534
3535         Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
3536         https://bugs.webkit.org/show_bug.cgi?id=140053
3537
3538         Reviewed by Andreas Kling.
3539
3540         * wtf/Stopwatch.h:
3541         (WTF::Stopwatch::create): Return a Ref.
3542
3543 2015-01-07  Commit Queue  <commit-queue@webkit.org>
3544
3545         Unreviewed, rolling out r178039.
3546         https://bugs.webkit.org/show_bug.cgi?id=140187
3547
3548         Breaks ObjC Inspector Protocol (Requested by JoePeck on
3549         #webkit).
3550
3551         Reverted changeset:
3552
3553         "Web Inspector: purge PassRefPtr from Inspector code and use
3554         Ref for typed and untyped protocol objects"
3555         https://bugs.webkit.org/show_bug.cgi?id=140053
3556         http://trac.webkit.org/changeset/178039
3557
3558 2015-01-06  Brian J. Burg  <burg@cs.washington.edu>
3559
3560         Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
3561         https://bugs.webkit.org/show_bug.cgi?id=140053
3562
3563         Reviewed by Andreas Kling.
3564
3565         * wtf/Stopwatch.h:
3566         (WTF::Stopwatch::create): Return a Ref.
3567
3568 2015-01-06  Alexey Proskuryakov  <ap@apple.com>
3569
3570         ADDRESS_SANITIZER macro is overloaded
3571         https://bugs.webkit.org/show_bug.cgi?id=140130
3572
3573         Reviewed by Anders Carlsson.
3574
3575         * wtf/Compiler.h: Added an ASAN_ENABLED macro. The abbreviation should become well
3576         known - we already use it in tools.
3577
3578         * wtf/Assertions.h:
3579         * wtf/RefCounted.h:
3580         * wtf/SizeLimits.cpp:
3581         Change the conditional to ENABLE(SECURITY_ASSERTIONS). These checks will be used
3582         in debug builds, and also when one explicitly passes -DENABLE_SECURITY_ASSERTIONS.
3583
3584 2015-01-05  Andreas Kling  <akling@apple.com>
3585
3586         Purge PassRefPtr from Page.
3587         <https://webkit.org/b/140089>
3588
3589         Reviewed by Anders Carlsson.
3590
3591         Make SchedulePair::create() return Ref since it never fails.
3592
3593         * wtf/SchedulePair.h:
3594         (WTF::SchedulePair::create):
3595
3596 2015-01-01  Darin Adler  <darin@apple.com>
3597
3598         Rework code that hides characters in password fields to streamline a little
3599         https://bugs.webkit.org/show_bug.cgi?id=140035
3600
3601         Reviewed by Sam Weinig.
3602
3603         * wtf/text/StringImpl.cpp:
3604         (WTF::StringImpl::fill): Deleted.
3605         * wtf/text/StringImpl.h: Deleted StringImpl::fill.
3606         * wtf/text/WTFString.h:
3607         (WTF::String::fill): Deleted.
3608
3609 2014-12-26  Dan Bernstein  <mitz@apple.com>
3610
3611         Build fix.
3612
3613         Removed use of __builtin_s{add,sub}_overflow introduced in r177729 that was causing a compiler used at Apple to crash because of <rdar://problem/19347133>.
3614
3615         * wtf/SaturatedArithmetic.h:
3616         (signedAddOverflows):
3617         (signedSubtractOverflows):
3618
3619 2014-12-26  Dan Bernstein  <mitz@apple.com>
3620
3621         <rdar://problem/19348208> REGRESSION (r177027): iOS builds use the wrong toolchain
3622         https://bugs.webkit.org/show_bug.cgi?id=139950
3623
3624         Reviewed by David Kilzer.
3625
3626         * Configurations/Base.xcconfig: Only define TOOLCHAINS when building for OS X, doing so
3627         in a manner that works with Xcode 5.1.1.
3628
3629 2014-12-25  Dan Bernstein  <mitz@apple.com>
3630
3631         Try to fix the Windows build after r177733.
3632
3633         * wtf/Ref.h:
3634
3635 2014-12-25  Alexey Proskuryakov  <ap@apple.com>
3636
3637         Simplify saturated integer add/sub
3638         https://bugs.webkit.org/show_bug.cgi?id=139854
3639
3640         Address Darin's post-commit feedback to fix API tests.
3641
3642         * wtf/SaturatedArithmetic.h: (saturatedSubtraction):
3643
3644 2014-12-24  Benjamin Poulain  <benjamin@webkit.org>
3645
3646         Simplify saturated integer add/sub
3647         https://bugs.webkit.org/show_bug.cgi?id=139854
3648
3649         Reviewed by Darin Adler.
3650
3651         * wtf/Compiler.h:
3652         Make a wrapper for __has_builtin for compilers that do not support it.
3653
3654         * wtf/SaturatedArithmetic.h:
3655         (saturatedAddition):
3656         (saturatedSubtraction):
3657         Use the builtins when possible instead of reinventing the wheel.
3658         On ARMv7, use the saturated math instructions.
3659
3660 2014-12-23  Anders Carlsson  <andersca@apple.com>
3661
3662         Move dynamic_objc_cast to RetainPtr.h
3663         https://bugs.webkit.org/show_bug.cgi?id=139915
3664
3665         Reviewed by Sam Weinig.
3666
3667         * wtf/RetainPtr.h:
3668         (WTF::dynamic_objc_cast):
3669
3670 2014-12-23  Anders Carlsson  <andersca@apple.com>
3671
3672         Re-indent RefPtr.h and RetainPtr.h.
3673
3674         Rubber-stamped by Sam Weinig.
3675
3676         * wtf/RefPtr.h:
3677         * wtf/RetainPtr.h:
3678
3679 2014-12-20  Eric Carlson  <eric.carlson@apple.com>
3680
3681         [iOS] add optimized fullscreen API
3682         https://bugs.webkit.org/show_bug.cgi?id=139833
3683         <rdar://problem/18844486>
3684
3685         Reviewed by Simon Fraser.
3686
3687         * wtf/Platform.h: Define ENABLE_VIDEO_PRESENTATION_MODE.
3688
3689 2014-12-18  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3690
3691         Fix build break on EFL and GTK since r177523
3692         https://bugs.webkit.org/show_bug.cgi?id=139805
3693
3694         Reviewed by Csaba Osztrogonác.
3695
3696         * wtf/Ref.h: Include <wtf/StdLibExtras.h> to use std::exchange().
3697
3698 2014-12-18  Gavin Barraclough  <barraclough@apple.com>
3699
3700         Add strong typing to RefCounter interface, return value as a bool.
3701         https://bugs.webkit.org/show_bug.cgi?id=139776
3702
3703         Unreviewed style fixes.
3704
3705         * wtf/RefCounter.h:
3706         (WTF::=):
3707
3708 2014-12-18  Brent Fulgham  <bfulgham@apple.com>
3709
3710         [Win] Build correction after r177541.
3711
3712         * wtf/RefCounter.h:
3713         (WTF::RefCounter::Token<T>::Token): Revise constructor inlines to correct
3714         syntax error.
3715
3716 2014-12-18  Gavin Barraclough  <barraclough@apple.com>
3717
3718         Add strong typing to RefCounter interface, return value as a bool.
3719         https://bugs.webkit.org/show_bug.cgi?id=139776
3720
3721         Reviewed by Geoff Garen.
3722
3723         Currently all token vended by a RefCounter have the same type - Ref<RefCounter::Count>.
3724         This means there is no compile time type checking to prevent mistakes. Update the count()
3725         method to token<>(), templated on type used to identify the token being returned.
3726         Calls to token<T>() will return a result of type RefCounter::Token<T>.
3727
3728         There are a few problems with the fact the counter will return you an exact count of the
3729         number of outstanding tokens:
3730           - It is desirable to only fire the callback on zero-edge changes; it is more consistent
3731             to do so if the value is only readable as a boolean.
3732           - It is desirable to provide the value as an argument to the callback, however to make
3733             this useful for integer values it is also necessary to indicate the direction of change
3734             (0->1 is often interesting where 2->1 is not).
3735           - There is a mismatch between the precision of returning a count, and the inherent
3736             imprecision of a token based mechanism, where it may be difficult to guarantee
3737             absolutely no unnecessary refcount churn, and thus unintentional counter values.
3738
3739         * wtf/RefCounter.cpp:
3740         (WTF::RefCounter::Count::ref):
3741         (WTF::RefCounter::Count::deref):
3742             - only call the callback on zero-edge changes; provide the value.
3743         (WTF::RefCounter::RefCounter):
3744             - callback now takes a bool argument.
3745         * wtf/RefCounter.h:
3746         (WTF::RefCounter::Token::Token):
3747             - New opaque type to reference the RefCounter::Count.
3748         (WTF::RefCounter::Token::operator!):
3749             - ! operator checks for null / anasigned Tokens.
3750         (WTF::RefCounter::RefCounter):
3751             - callback now takes a bool argument.
3752         (WTF::RefCounter::token):
3753             - renamed from count(), templated on type of token returned.
3754         (WTF::RefCounter::value):
3755             - now returns a bool.
3756         (WTF::RefCounter::Token<T>::Token):
3757         (WTF::=):
3758             - Tokens can be copied & assigned.
3759         (WTF::RefCounter::count): Deleted.
3760             - renamed to token<>().
3761
3762 2014-12-18  Anders Carlsson  <andersca@apple.com>
3763
3764         Simplify smart pointer classes by using std::exchange
3765         https://bugs.webkit.org/show_bug.cgi?id=139790
3766
3767         Reviewed by Andreas Kling.
3768
3769         * wtf/MallocPtr.h:
3770         * wtf/OSObjectPtr.h:
3771         * wtf/OwnPtr.h:
3772         (WTF::OwnPtr<T>::clear):
3773         (WTF::OwnPtr<T>::release):
3774         (WTF::OwnPtr<T>::leakPtr):
3775         (WTF::=):
3776         * wtf/PassOwnPtr.h:
3777         (WTF::PassOwnPtr<T>::leakPtr):
3778         * wtf/PassRefPtr.h:
3779         (WTF::PassRefPtr<T>::leakRef):
3780         * wtf/Ref.h:
3781         * wtf/RefPtr.h:
3782         (WTF::RefPtr<T>::clear):
3783         (WTF::RefPtr<T>::leakRef):
3784         * wtf/RetainPtr.h:
3785         (WTF::RetainPtr<T>::leakRef):
3786
3787 2014-12-18  Anders Carlsson  <andersca@apple.com>
3788
3789         Clean up MachSendRight and add a copySendRight member function
3790         https://bugs.webkit.org/show_bug.cgi?id=139788
3791
3792         Reviewed by Tim Horton.
3793
3794         * wtf/StdLibExtras.h:
3795         (std::exchange):
3796         Add an implementation of std::exchange.
3797
3798 2014-12-17  Chris Dumez  <cdumez@apple.com>
3799
3800         [iOS] Make it possible to toggle FeatureCounter support at runtime
3801         https://bugs.webkit.org/show_bug.cgi?id=139688
3802         <rdar://problem/19266254>
3803
3804         Reviewed by Andreas Kling.
3805
3806         Remove FeatureCounter API from WTF and move it to WebCore/platform
3807         instead so that it can log conditionally based on a WebCore setting.
3808
3809         * WTF.vcxproj/WTF.vcxproj:
3810         * WTF.xcodeproj/project.pbxproj:
3811         * wtf/CMakeLists.txt:
3812
3813 2014-12-17  Brent Fulgham  <bfulgham@apple.com>
3814
3815         [Win] Correct DebugSuffix builds under MSBuild
3816         https://bugs.webkit.org/show_bug.cgi?id=139733
3817         <rdar://problem/19276880>
3818
3819         Reviewed by Simon Fraser.
3820
3821         * WTF.vcxproj/WTF.proj: Make sure to use the '_debug' suffix
3822         when building the DebugSuffix target.
3823
3824 2014-12-17  Anders Carlsson  <andersca@apple.com>
3825
3826         Make Ref::copyRef const and ref-qualified
3827         https://bugs.webkit.org/show_bug.cgi?id=139730
3828
3829         Reviewed by Andreas Kling.
3830
3831         * wtf/Ref.h:
3832
3833 2014-12-16  Daniel Bates  <dabates@apple.com>
3834
3835         [iOS] WTF fails to build with public SDK due to missing header CPAggregateDictionary.h
3836         https://bugs.webkit.org/show_bug.cgi?id=139695
3837
3838         Reviewed by Chris Dumez.
3839
3840         Add USE(APPLE_INTERNAL_SDK)-guard around iOS-specific feature counter implementation
3841         as we are only interested in counting features in builds of iOS WebKit that were built
3842         with the Apple Internal SDK.
3843
3844         * wtf/FeatureCounter.cpp:
3845         * wtf/ios/FeatureCounter.mm:
3846
3847 2014-12-16  Geoffrey Garen  <ggaren@apple.com>
3848
3849         Enable FastMalloc in debug builds
3850         https://bugs.webkit.org/show_bug.cgi?id=139692
3851
3852         Reviewed by Alexey Proskuryakov.
3853
3854         This will give debug builds greater fidelity to the real thing.
3855
3856         FastMalloc now transparently supports all the malloc debugging APIs I
3857         know of by disabling itself at runtime -- and it should be easy to add
3858         support for any APIs I missed -- so there's no need to turn it off in
3859         debug builds.
3860
3861         * wtf/FastMalloc.cpp:
3862
3863 2014-12-16  Anders Carlsson  <andersca@apple.com>
3864
3865         RefPtr::copyRef should be const
3866         https://bugs.webkit.org/show_bug.cgi?id=139689
3867
3868         Reviewed by Andreas Kling.
3869
3870         copyRef() doesn't modify the original object so it should be const.
3871         Also, add a && qualified overload and mark it deleted so that calls to copyRef() where
3872         the object is an rvalue will fail to compile.
3873
3874         * wtf/RefPtr.h:
3875
3876 2014-12-15  Chris Dumez  <cdumez@apple.com>
3877
3878         [iOS] Add feature counting support
3879         https://bugs.webkit.org/show_bug.cgi?id=139652
3880         <rdar://problem/19255690>
3881
3882         Reviewed by Gavin Barraclough.
3883
3884         Add a FeatureCounter API for to log / count when a feature
3885         is used. For now, this is only implementated on iOS.
3886
3887         * WTF.vcxproj/WTF.vcxproj:
3888         * WTF.xcodeproj/project.pbxproj:
3889         * wtf/CMakeLists.txt:
3890         * wtf/FeatureCounter.cpp: Added.
3891         (WTF::incrementFeatureCounterKey):
3892         (WTF::setFeatureCounterKey):
3893         * wtf/FeatureCounter.h: Added.
3894         * wtf/ios/FeatureCounter.mm: Added.
3895         (WTF::incrementFeatureCounterKey):
3896         (WTF::setFeatureCounterKey):
3897
3898 2014-12-12  Anders Carlsson  <andersca@apple.com>
3899
3900         Get rid of the DONT_FINALIZE_ON_MAIN_THREAD #define
3901         https://bugs.webkit.org/show_bug.cgi?id=139613
3902
3903         Reviewed by Sam Weinig.
3904
3905         * wtf/Platform.h:
3906         Remove the #define.
3907
3908 2014-12-15  Commit Queue  <commit-queue@webkit.org>
3909
3910         Unreviewed, rolling out r177284.
3911         https://bugs.webkit.org/show_bug.cgi?id=139658
3912
3913         "Breaks API tests and LayoutTests on Yosemite Debug"
3914         (Requested by msaboff on #webkit).
3915
3916         Reverted changeset:
3917
3918         "Make sure range based iteration of Vector<> still receives
3919         bounds checking"
3920         https://bugs.webkit.org/show_bug.cgi?id=138821
3921         http://trac.webkit.org/changeset/177284
3922
3923 2014-12-15  Andreas Kling  <akling@apple.com>
3924
3925         Purge PassRefPtr from FocusEvent code.
3926         <https://webkit.org/b/139647>
3927
3928         Reviewed by Anders Carlsson.
3929
3930         Add a RefPtr::copyRef() to use when passing a RefPtr to a RefPtr&& without
3931         transferring the ownership.
3932
3933         * wtf/RefPtr.h:
3934
3935 2014-12-15  Oliver Hunt  <oliver@apple.com>
3936
3937         Make sure range based iteration of Vector<> still receives bounds checking
3938         https://bugs.webkit.org/show_bug.cgi?id=138821
3939
3940         Reviewed by Mark Lam.
3941
3942         Add a new IndexedIterator struct to WTF that wraps a
3943         Vector type and index to provide pointer like semantics
3944         while still performing runtime bounds checking, even in
3945         release builds. We store a simple index into the vector
3946         which means that this iterator allows vector resizing
3947         during iteration. If the vector is resized such that the
3948         iterator is out of bounds, then any attempt to dereference
3949         the iterator will crash safely.
3950
3951         For the purpose of retaining semantically equivalent
3952         behaviour, the iterator can be moved to m_index == size()
3953         as that is the standard "end" terminator for these types.
3954         Attempting to dereference at that point will still crash
3955         rather than perform an unsafe memory operation.
3956
3957         By necessity there are many overrides for operator + and - as
3958         we otherwise hit many different type promotion ambiguities when
3959         performing arithmetic with iterators. These ambiguities are also
3960         different for 32- vs. 64-bit, so duplicating the functions
3961         and then forwarding to the core implementations that performed
3962         the bounds checking and mutation seemed like the right call.
3963
3964         * WTF.vcxproj/WTF.vcxproj:
3965         * WTF.vcxproj/WTF.vcxproj.filters:
3966         * WTF.xcodeproj/project.pbxproj:
3967         * wtf/IndexedIterator.h: Added.
3968         (WTF::IndexedIterator::IndexedIterator):
3969         (WTF::IndexedIterator::operator->):
3970         (WTF::IndexedIterator::operator*):
3971         (WTF::IndexedIterator::get):
3972         (WTF::IndexedIterator::operator++):
3973         (WTF::IndexedIterator::operator--):
3974         (WTF::IndexedIterator::operator UnspecifiedBoolType):
3975         (WTF::IndexedIterator::operator-):
3976         (WTF::IndexedIterator::operator=):
3977         (WTF::IndexedIterator::operator==):
3978         (WTF::IndexedIterator::operator!=):
3979         (WTF::IndexedIterator::operator<):
3980         (WTF::IndexedIterator::operator<=):
3981         (WTF::IndexedIterator::operator>):
3982         (WTF::IndexedIterator::operator>=):
3983         (WTF::IndexedIterator::operator const_iterator):
3984         (WTF::IndexedIterator::unsafeGet):
3985         (WTF::getPtr):
3986         (WTF::operator-):
3987         (WTF::operator==):
3988         (WTF::operator!=):
3989         (WTF::operator<=):
3990         (WTF::operator>=):
3991         (WTF::operator<):
3992         (WTF::operator>):
3993         (WTF::IndexedIteratorSelector::makeIterator):
3994         (WTF::IndexedIteratorSelector::makeConstIterator):
3995         * wtf/RefCountedArray.h:
3996         (WTF::RefCountedArray::RefCountedArray):
3997         * wtf/Vector.h:
3998         (WTF::Vector::Vector):
3999         (WTF::Vector::begin):
4000         (WTF::Vector::end):
4001         (WTF::OverflowHandler>::Vector):
4002         (WTF::=):
4003         (WTF::OverflowHandler>::fill):
4004         (WTF::OverflowHandler>::expandCapacity):
4005         (WTF::OverflowHandler>::tryExpandCapacity):
4006         (WTF::OverflowHandler>::resize):
4007         (WTF::OverflowHandler>::shrink):
4008         (WTF::OverflowHandler>::grow):
4009         (WTF::OverflowHandler>::reserveCapacity):
4010         (WTF::OverflowHandler>::tryReserveCapacity):
4011         (WTF::OverflowHandler>::shrinkCapacity):
4012         (WTF::OverflowHandler>::append):
4013         (WTF::OverflowHandler>::tryAppend):
4014         (WTF::OverflowHandler>::appendSlowCase):
4015         (WTF::OverflowHandler>::uncheckedAppend):
4016         (WTF::OverflowHandler>::appendVector):
4017         (WTF::OverflowHandler>::insert):
4018         (WTF::OverflowHandler>::insertVector):
4019         (WTF::OverflowHandler>::remove):
4020
4021 2014-12-14  Andreas Kling  <akling@apple.com>
4022
4023         Minor follow-up tweaks suggested by Darin on bug 139587.
4024
4025         * wtf/text/WTFString.h:
4026         (WTF::String::String):
4027
4028 2014-12-14  Andreas Kling  <akling@apple.com>
4029
4030         Replace PassRef with Ref/Ref&& across the board.
4031         <https://webkit.org/b/139587>
4032
4033         Reviewed by Darin Adler.
4034
4035         Kill the PassRef class and replace it by Ref/Ref&&.
4036         Usage is simple:
4037
4038             - For locals and members, keep using Ref<T>.
4039             - For return types, use Ref<T>.
4040             - For (ownership-transferring) arguments, use Ref<T>&&.
4041
4042         When passing to a Ref&&, use WTF::move() to mobilize the value
4043         at the call site, e.g:
4044
4045             void myFunction(Ref<Foo>&&);
4046
4047             Ref<Foo> myFoo(Foo::create());
4048             myFunction(WTF::move(myFoo));
4049             // 'myFoo' is invalid from this point forward.
4050
4051         As you can see, it works a lot like PassRefPtr, but unlike PassRefPtr
4052         it won't surprise you by becoming null *unless* you WTF::move it.
4053
4054         I've also added a Ref::copyRef() for instances where you want to
4055         return a Ref *without* transferring ownership, e.g code like:
4056
4057             Ref<Foo> foo() { return m_foo; }
4058
4059         ... now becomes ...
4060
4061             Ref<Foo> foo() { return m_foo.copyRef(); }
4062
4063         This makes it explicit that a refcount bump will occur.
4064
4065         Finally, do note that unlike last year's PassRef, Ref&& does not
4066         require you to move it to avoid leaking; it will clean itself up.
4067
4068         * wtf/PassRef.h:
4069         (WTF::adopted): Deleted.
4070         (WTF::PassRef<T>::PassRef): Deleted.
4071         (WTF::PassRef<T>::~PassRef): Deleted.
4072         (WTF::PassRef<T>::get): Deleted.
4073         (WTF::PassRef<T>::ptr): Deleted.
4074         (WTF::PassRef<T>::leakRef): Deleted.
4075         (WTF::adoptRef): Deleted.
4076         (WTF::createRefCounted): Deleted.
4077         * wtf/PassRefPtr.h:
4078         (WTF::PassRefPtr::PassRefPtr):
4079         * wtf/Ref.h:
4080         (WTF::adopted):
4081         (WTF::Ref::~Ref):
4082         (WTF::Ref::Ref):
4083         (WTF::Ref::operator=):
4084         (WTF::Ref::operator->):
4085         (WTF::Ref::ptr):
4086         (WTF::Ref::get):
4087         (WTF::Ref::operator T&):
4088         (WTF::Ref::operator const T&):
4089         (WTF::Ref<T>::replace):
4090         (WTF::adoptRef):
4091         * wtf/RefCounter.h:
4092         (WTF::RefCounter::count):
4093         * wtf/RefPtr.h:
4094         (WTF::RefPtr::releaseNonNull):
4095         (WTF::RefPtr<T>::RefPtr):
4096         (WTF::=):
4097         * wtf/text/AtomicString.cpp:
4098         (WTF::addToStringTable):
4099         (WTF::AtomicString::add):
4100         (WTF::AtomicString::addFromLiteralData):
4101         (WTF::AtomicString::addSlowCase):
4102         * wtf/text/AtomicString.h:
4103         * wtf/text/StringImpl.cpp:
4104         (WTF::StringImpl::createFromLiteral):
4105         (WTF::StringImpl::createWithoutCopying):
4106         (WTF::StringImpl::createUninitializedInternal):
4107         (WTF::StringImpl::createUninitializedInternalNonEmpty):
4108         (WTF::StringImpl::createUninitialized):
4109         (WTF::StringImpl::reallocateInternal):
4110         (WTF::StringImpl::reallocate):
4111         (WTF::StringImpl::createInternal):
4112         (WTF::StringImpl::create):
4113         (WTF::StringImpl::create8BitIfPossible):
4114         (WTF::StringImpl::substring):
4115         (WTF::StringImpl::lower):
4116         (WTF::StringImpl::upper):
4117         (WTF::StringImpl::fill):
4118         (WTF::StringImpl::foldCase):
4119         (WTF::StringImpl::convertToASCIILowercase):
4120         (WTF::StringImpl::stripMatchedCharacters):
4121         (WTF::StringImpl::stripWhiteSpace):
4122         (WTF::StringImpl::removeCharacters):
4123         (WTF::StringImpl::simplifyMatchedCharactersToSpace):
4124         (WTF::StringImpl::simplifyWhiteSpace):
4125         (WTF::StringImpl::replace):
4126         (WTF::StringImpl::adopt):
4127         * wtf/text/StringImpl.h:
4128         (WTF::StringImpl::create8BitIfPossible):
4129         (WTF::StringImpl::create):
4130         (WTF::StringImpl::createSubstringSharingImpl8):
4131         (WTF::StringImpl::createSubstringSharingImpl):
4132         (WTF::StringImpl::createFromLiteral):
4133         (WTF::StringImpl::createEmptyUnique):
4134         (WTF::StringImpl::adopt):
4135         (WTF::StringImpl::replace):
4136         (WTF::StringImpl::constructInternal<LChar>):
4137         (WTF::StringImpl::constructInternal<UChar>):
4138         (WTF::StringImpl::isolatedCopy):
4139         * wtf/text/WTFString.h:
4140         (WTF::String::String):
4141
4142 2014-12-10  Geoffrey Garen  <ggaren@apple.com>
4143
4144         Please disable the webkitFirstVersionWithInitConstructorSupport check on Apple TV
4145         https://bugs.webkit.org/show_bug.cgi?id=139501
4146
4147         Reviewed by Gavin Barraclough.
4148
4149         Added a platform definition for APPLETV.
4150
4151         (It's not an OS because it's not mutually exclusive with other OS definitions.)
4152
4153         * wtf/Platform.h:
4154
4155 2014-12-10  Martin Robinson  <mrobinson@igalia.com>
4156
4157         [GTK] Add support for text-decoration-skip
4158         https://bugs.webkit.org/show_bug.cgi?id=131540
4159
4160         Reviewed by Gustavo Noronha Silva.
4161
4162         * wtf/Platform.h: Enable text decoration skip by default.
4163
4164 2014-12-09  David Kilzer  <ddkilzer@apple.com>
4165
4166         Switch from using PLATFORM_NAME to SDK selectors in ANGLE, bmalloc, gtest, JavaScriptCore, WTF
4167         <http://webkit.org/b/139212>
4168
4169         Reviewed by Joseph Pecoraro.
4170
4171         * Configurations/Base.xcconfig:
4172         - Only set GCC_ENABLE_OBJC_GC, GCC_MODEL_TUNING and TOOLCHAINS
4173           on OS X.
4174         * Configurations/DebugRelease.xcconfig:
4175         - Only set MACOSX_DEPLOYMENT_TARGET and SDKROOT on OS X.
4176
4177 2014-12-09  Dean Jackson  <dino@apple.com>
4178
4179         [Apple] Use Accelerate framework to speed-up FEGaussianBlur
4180         https://bugs.webkit.org/show_bug.cgi?id=139310
4181
4182         Unreviewed followup, after comments by Andreas Kling.
4183
4184         It was pointed out that we already have a USE(ACCELERATE), so
4185         we don't need a HAVE(ACCELERATE) :)
4186
4187         * wtf/Platform.h:
4188
4189 2014-12-09  Alberto Garcia  <berto@igalia.com>
4190
4191         Undefined Symbol build error "_objc_registerThreadWithCollector" when building WebKit GTK Mac OS X on Snow Leopard
4192         https://bugs.webkit.org/show_bug.cgi?id=58737
4193
4194         Reviewed by Darin Adler.
4195
4196         Replace OS(MAC_OS_X) with PLATFORM(MAC) to prevent using
4197         osx-specific code in WebKitGTK+ builds.
4198
4199         * wtf/ThreadingPthreads.cpp:
4200         (WTF::initializeCurrentThreadInternal):
4201
4202 2014-12-08  Dean Jackson  <dino@apple.com>
4203
4204         [Apple] Use Accelerate framework to speed-up FEGaussianBlur
4205         https://bugs.webkit.org/show_bug.cgi?id=139310
4206         <rdar://problem/18434594>
4207
4208         Reviewed by Simon Fraser.
4209
4210         Add a HAVE_ACCELERATE flag, true on Apple platforms.
4211
4212         * wtf/Platform.h:
4213
4214 2014-12-08  Myles C. Maxfield  <mmaxfield@apple.com>
4215
4216         Fix iOS build after r176971.
4217
4218         I had previously modified the WTF forwarding header instead of modifying the real source.
4219
4220         * wtf/unicode/CharacterNames.h:
4221
4222 2014-12-08  Anders Carlsson  <andersca@apple.com>
4223
4224         Change WTF::currentCPUTime to return std::chrono::microseconds and get rid of currentCPUTimeMS
4225         https://bugs.webkit.org/show_bug.cgi?id=139410
4226
4227         Reviewed by Andreas Kling.
4228
4229         * wtf/CurrentTime.cpp:
4230         (WTF::currentCPUTime):
4231         (WTF::currentCPUTimeMS): Deleted.
4232         * wtf/CurrentTime.h:
4233
4234 2014-12-08  Chris Dumez  <cdumez@apple.com>
4235
4236         Revert r176293 & r176275
4237
4238         Unreviewed, revert r176293 & r176275 changing the Vector API to use unsigned type
4239         instead of size_t. There is some disagreement regarding the long-term direction
4240         of the API and we shouldn’t leave the API partly transitioned to unsigned type
4241         while making a decision.
4242
4243         * wtf/Forward.h:
4244         * wtf/Vector.h:
4245         (WTF::VectorTypeOperations::compare):
4246         (WTF::VectorBufferBase::allocateBuffer):
4247         (WTF::VectorBufferBase::tryAllocateBuffer):
4248         (WTF::VectorBufferBase::shouldReallocateBuffer):
4249         (WTF::VectorBufferBase::reallocateBuffer):
4250         (WTF::VectorBufferBase::capacity):
4251         (WTF::VectorBufferBase::VectorBufferBase):
4252         (WTF::VectorBuffer::VectorBuffer):
4253         (WTF::VectorBuffer::allocateBuffer):
4254         (WTF::VectorBuffer::tryAllocateBuffer):
4255         (WTF::VectorBuffer::shouldReallocateBuffer):
4256         (WTF::VectorBuffer::reallocateBuffer):
4257         (WTF::VectorBuffer::swap):
4258         (WTF::VectorBuffer::swapInlineBuffer):
4259         (WTF::VectorBuffer::swapInlineBuffers):
4260         (WTF::Vector::Vector):
4261         (WTF::Vector::capacity):
4262         (WTF::Vector::at):
4263         (WTF::Vector::operator[]):
4264         (WTF::OverflowHandler>::find):
4265         (WTF::OverflowHandler>::reverseFind):
4266         (WTF::OverflowHandler>::fill):
4267         (WTF::OverflowHandler>::expandCapacity):
4268         (WTF::OverflowHandler>::tryExpandCapacity):
4269         (WTF::OverflowHandler>::resize):
4270         (WTF::OverflowHandler>::resizeToFit):
4271         (WTF::OverflowHandler>::shrink):
4272         (WTF::OverflowHandler>::grow):
4273         (WTF::OverflowHandler>::reserveCapacity):
4274         (WTF::OverflowHandler>::tryReserveCapacity):
4275         (WTF::OverflowHandler>::reserveInitialCapacity):
4276         (WTF::OverflowHandler>::shrinkCapacity):
4277         (WTF::OverflowHandler>::append):
4278         (WTF::OverflowHandler>::tryAppend):
4279         (WTF::OverflowHandler>::insert):
4280         (WTF::OverflowHandler>::insertVector):
4281         (WTF::OverflowHandler>::remove):
4282         (WTF::OverflowHandler>::reverse):
4283         (WTF::OverflowHandler>::checkConsistency):
4284         * wtf/text/AtomicString.h:
4285         * wtf/text/StringImpl.h:
4286         (WTF::StringImpl::adopt):
4287         (WTF::equalIgnoringNullity):
4288         * wtf/text/StringView.h:
4289         (WTF::append):
4290         * wtf/text/WTFString.h: