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