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