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