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