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