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