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