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