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