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