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