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