1 2015-02-26 Csaba Osztrogonác <ossy@webkit.org>
3 UNREACHABLE_FOR_PLATFORM() should be release assert
4 https://bugs.webkit.org/show_bug.cgi?id=141904
6 Reviewed by Darin Adler.
9 (UNREACHABLE_FOR_PLATFORM):
11 2015-02-25 Filip Pizlo <fpizlo@apple.com>
13 Enable concurrent JIT on GTK
14 https://bugs.webkit.org/show_bug.cgi?id=142007
16 Reviewed by Benjamin Poulain.
18 Seems weird that GTK keeps it off. No good reason for that as far as I can tell.
22 2015-02-23 Brent Fulgham <bfulgham@apple.com>
24 WTF::WeakPtr should rename 'forgot' to 'clear' and support nullptr assignment
25 https://bugs.webkit.org/show_bug.cgi?id=141935
27 Reviewed by Myles C. Maxfield.
30 (WTF::WeakPtr::operator=): Added 'nullptr_t' overload.
31 (WTF::WeakPtr::clear): Renamed from 'forget'
32 (WTF::WeakPtr::forget): Deleted.
34 2015-02-23 Brent Fulgham <bfulgham@apple.com>
36 WTF::WeakPtr should have a 'forget' method
37 https://bugs.webkit.org/show_bug.cgi?id=141923
39 Reviewed by Myles C. Maxfield.
42 (WTF::WeakPtr::forget): Added.
44 2015-02-20 Geoffrey Garen <ggaren@apple.com>
47 https://bugs.webkit.org/show_bug.cgi?id=141844
49 Reviewed by Andreas Kling.
53 * WTF.vcxproj/WTF.vcxproj:
54 * WTF.vcxproj/WTF.vcxproj.filters:
55 * WTF.xcodeproj/project.pbxproj:
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.
214 2015-02-20 Alexey Proskuryakov <ap@apple.com>
216 Remove svn:keywords property.
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.
221 * wtf/DecimalNumber.cpp: Removed property svn:keywords.
222 * wtf/spi/darwin/XPCSPI.h: Removed property svn:keywords.
224 2015-02-20 Csaba Osztrogonác <ossy@webkit.org>
228 * wtf/PlatformEfl.cmake:
230 2015-02-20 Simon Fraser <simon.fraser@apple.com>
232 RunLoop::dispatch() should drop the mutex before calling wakeUp().
233 https://bugs.webkit.org/show_bug.cgi?id=141820
235 Reviewed by Alexey Proskuryakov.
237 RunLoop::wakeUp() calls into CoreFoundation which could take time,
238 so scope the mutex just to protect m_functionQueue.
241 (WTF::RunLoop::dispatch):
243 2015-02-20 Gyuyoung Kim <gyuyoung.kim@samsung.com>
245 Unreviewed, EFL build fix since r180410.
247 * wtf/PlatformEfl.cmake: Add WEBKIT2/Platform/efl path in order to include DispatchQueueEfl.h.
249 2015-02-20 Antti Koivisto <antti@apple.com>
251 Move WorkQueue from WK2 to WTF
252 https://bugs.webkit.org/show_bug.cgi?id=141797
254 Reviewed by Anders Carlsson.
256 It may be useful in WebCore.
258 Windows implementation is still missing.
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.
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.
270 2015-02-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>
272 [EFL] Enable bmalloc for EFL port
273 https://bugs.webkit.org/show_bug.cgi?id=141459
275 Reviewed by Csaba Osztrogonác.
277 * wtf/CMakeLists.txt: Remove TCSystemAlloc.cpp/h.
278 * wtf/FastMalloc.cpp: Enable BMALLOC for EFL port.
280 2015-02-13 Anders Carlsson <andersca@apple.com>
282 Add a move constructor and move assignment operator to Deque
283 https://bugs.webkit.org/show_bug.cgi?id=141571
285 Reviewed by Andreas Kling.
288 (WTF::inlineCapacity>::Deque):
291 2015-02-13 Anders Carlsson <andersca@apple.com>
293 Add an initializer list constructor to Deque
294 https://bugs.webkit.org/show_bug.cgi?id=141565
296 Reviewed by Andreas Kling.
299 (WTF::inlineCapacity>::Deque):
301 2015-02-13 Anders Carlsson <andersca@apple.com>
305 Rubber-stamped by Antti Koivisto.
309 2015-02-11 Brent Fulgham <bfulgham@apple.com>
311 [Win] [64-bit] Work around MSVC2013 Runtime Bug
312 https://bugs.webkit.org/show_bug.cgi?id=141498
313 <rdar://problem/19803642>
315 Reviewed by Anders Carlsson.
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.
321 * WTF.vcxproj/WTF.vcxproj: Add new files.
322 * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
323 * wtf/win/WTFDLL.cpp: Added.
325 2015-02-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
327 [EFL][GTK] Use bmalloc instead of tcmalloc
328 https://bugs.webkit.org/show_bug.cgi?id=140162
330 Reviewed by Carlos Garcia Campos.
332 * wtf/CMakeLists.txt:
333 * wtf/FastMalloc.cpp:
334 Enable bmalloc on GTK ports, but EFL port will enable it when bmalloc supports
337 2015-02-10 Darin Adler <darin@apple.com>
339 Add the crash-on-failure behavior to bmalloc-based fastMalloc
340 https://bugs.webkit.org/show_bug.cgi?id=141434
342 Reviewed by Alexey Proskuryakov.
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.
358 2015-02-10 Carlos Garcia Campos <cgarcia@igalia.com>
360 [GTK] GMutexLocker build issue
361 https://bugs.webkit.org/show_bug.cgi?id=141381
363 Reviewed by Žan Doberšek.
365 Remove using WTF::GMutexLocker from the header, since newer glib
366 versions have a GMutexLocker in the public API.
368 * wtf/gobject/GMutexLocker.h:
370 2015-02-09 Alexey Proskuryakov <ap@apple.com>
372 REGRESSION: tryFastCalloc is no longer "try"
373 https://bugs.webkit.org/show_bug.cgi?id=141406
375 Reviewed by Darin Adler.
377 This causes crashes on some WebKit regression test bots.
379 * wtf/FastMalloc.cpp: (WTF::tryFastCalloc): Fix what looks like a copy/paste mistake.
381 2015-02-07 Csaba Osztrogonác <ossy@webkit.org>
383 [ARM] GC sometimes stuck in an infinite loop if parallel GC is enabled
384 https://bugs.webkit.org/show_bug.cgi?id=141290
386 Reviewed by Anders Carlsson.
390 2015-02-07 Chris Dumez <cdumez@apple.com>
392 Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
393 https://bugs.webkit.org/show_bug.cgi?id=141321
395 Reviewed by Darin Adler.
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.
404 2015-02-06 Commit Queue <commit-queue@webkit.org>
406 Unreviewed, rolling out r179743.
407 https://bugs.webkit.org/show_bug.cgi?id=141335
409 caused missing symbols in non-WebKit clients of WTF::Vector
410 (Requested by kling on #webkit).
414 "Remove WTF::fastMallocGoodSize()."
415 https://bugs.webkit.org/show_bug.cgi?id=141020
416 http://trac.webkit.org/changeset/179743
418 2015-02-06 Andreas Kling <akling@apple.com>
420 Remove WTF::fastMallocGoodSize().
421 <https://webkit.org/b/141020>
423 Reviewed by Anders Carlsson.
425 bmalloc's good-size API just returns exactly whatever you pass it,
426 so it's of no utility to us anymore.
428 This gets rid of a bunch of pointless out-of-line calls in Vector
429 construction and growth.
431 * wtf/Compression.cpp:
432 (WTF::GenericCompressedData::create):
433 * wtf/FastMalloc.cpp:
434 (WTF::fastMallocGoodSize): Deleted.
437 (WTF::VectorBufferBase::allocateBuffer):
438 (WTF::VectorBufferBase::tryAllocateBuffer):
439 (WTF::VectorBufferBase::reallocateBuffer):
441 2015-02-05 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
443 [Streams API] Implement a barebone ReadableStream interface
444 https://bugs.webkit.org/show_bug.cgi?id=141045
446 Reviewed by Benjamin Poulain.
448 * wtf/FeatureDefines.h:
450 2015-02-04 Alexey Proskuryakov <ap@apple.com>
452 Optimized equal() functions in StringImpl.h are not ASan compatible
453 https://bugs.webkit.org/show_bug.cgi?id=141258
455 Reviewed by Daniel Bates.
457 * wtf/text/StringImpl.h: (WTF::equal): Add custom implementations for ASan.
459 2015-02-04 Chris Dumez <cdumez@apple.com>
461 Add removeFirst(value) / removeAll(value) methods to WTF::Vector
462 https://bugs.webkit.org/show_bug.cgi?id=141192
464 Reviewed by Benjamin Poulain.
466 Add removeFirst(value) / removeAll(value) convenience methods to
467 WTF::Vector to reduce complexity a bit at call sites.
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.
474 (WTF::OverflowHandler>::removeFirst):
475 (WTF::OverflowHandler>::removeAll):
477 2015-02-02 Dhi Aurrahman <diorahman@rockybars.com>
479 Optimize matchesLangPseudoClass() of :lang()
480 https://bugs.webkit.org/show_bug.cgi?id=140873
482 Reviewed by Darin Adler.
484 Add some basic equality comparison operators.
486 * wtf/text/StringView.h:
490 (WTF::equalIgnoringASCIICase):
492 2015-02-02 Geoffrey Garen <ggaren@apple.com>
494 Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
495 https://bugs.webkit.org/show_bug.cgi?id=140900
497 Reviewed by Mark Hahnenberg.
499 Re-landing just the HandleBlock piece of this patch.
501 * wtf/FastMalloc.cpp:
502 (WTF::fastAlignedMalloc):
503 (WTF::fastAlignedFree):
504 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
507 2015-02-02 Daniel Bates <dabates@apple.com>
509 [iOS] ASSERTION FAILED: m_scriptExecutionContext->isContextThread() in ContextDestructionObserver::observeContext
510 https://bugs.webkit.org/show_bug.cgi?id=141057
511 <rdar://problem/19068790>
513 Reviewed by Alexey Proskuryakov.
516 * wtf/mac/MainThreadMac.mm:
517 (WTF::callOnWebThreadOrDispatchAsyncOnMainThread): Added.
519 2015-01-31 Sam Weinig <sam@webkit.org>
521 Remove even more Mountain Lion support
522 https://bugs.webkit.org/show_bug.cgi?id=141124
524 Reviewed by Alexey Proskuryakov.
526 * Configurations/Base.xcconfig:
527 * Configurations/DebugRelease.xcconfig:
528 * wtf/Assertions.cpp:
529 * wtf/FeatureDefines.h:
532 2015-01-31 Commit Queue <commit-queue@webkit.org>
534 Unreviewed, rolling out r179426.
535 https://bugs.webkit.org/show_bug.cgi?id=141119
537 "caused a memory use regression" (Requested by Guest45 on
542 "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
544 https://bugs.webkit.org/show_bug.cgi?id=140900
545 http://trac.webkit.org/changeset/179426
547 2015-01-31 Commit Queue <commit-queue@webkit.org>
549 Unreviewed, rolling out r179408.
550 https://bugs.webkit.org/show_bug.cgi?id=141117
552 This didn't fully fix the issue (Requested by anttik on
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
561 2015-01-30 Yusuke Suzuki <utatane.tea@gmail.com>
564 https://bugs.webkit.org/show_bug.cgi?id=140435
566 Reviewed by Geoffrey Garen.
568 Introduce new unique string mechanizm into StringImpl.
569 It is used for implementing Symbol which holds a [[Description]] value.
571 * wtf/text/AtomicString.h:
572 (WTF::AtomicString::add):
573 (WTF::AtomicString::addWithStringTableProvider):
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()`.
578 * wtf/text/StringImpl.cpp:
579 (WTF::StringImpl::~StringImpl):
580 (WTF::StringImpl::createUnique):
582 In createUnique, we leverage Substring mechanizm to produce a new unique
583 string from an existing string.
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.
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.
599 * wtf/text/StringStatics.cpp:
600 (WTF::StringImpl::hashAndFlagsForUnique):
601 (WTF::StringImpl::hashAndFlagsForEmptyUnique): Deleted.
603 2015-01-30 Geoffrey Garen <ggaren@apple.com>
605 Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
606 https://bugs.webkit.org/show_bug.cgi?id=140900
608 Reviewed by Mark Hahnenberg.
610 Re-landing just the HandleBlock piece of this patch.
612 * wtf/FastMalloc.cpp:
613 (WTF::fastAlignedMalloc):
614 (WTF::fastAlignedFree):
615 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
618 2015-01-30 Namhoon Kim <yanhkim@gmail.com>
620 Call vsnprintf instead of _vsnprintf in vprintf_stderr_common
621 https://bugs.webkit.org/show_bug.cgi?id=141078
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.
627 Reviewed by Brent Fulgham.
629 * wtf/Assertions.cpp:
631 2015-01-30 Brian J. Burg <burg@cs.washington.edu>
633 Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
634 https://bugs.webkit.org/show_bug.cgi?id=141039
636 Reviewed by Timothy Hatcher.
638 Add messages to Stopwatch assertions, and clean up constructor.
641 (WTF::Stopwatch::Stopwatch):
642 (WTF::Stopwatch::start):
643 (WTF::Stopwatch::stop):
645 2015-01-30 Chris Dumez <cdumez@apple.com>
647 Add match_constness<Reference, T> helper struct
648 https://bugs.webkit.org/show_bug.cgi?id=140905
650 Reviewed by Benjamin Poulain.
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
659 2015-01-30 Chris Dumez <cdumez@apple.com>
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
664 Reviewed by Anders Carlsson.
666 Add assertion in RefPtr's operator*() to make sure we don't dereference
670 (WTF::RefPtr::operator*):
672 2015-01-30 Geoffrey Garen <ggaren@apple.com>
674 GC marking threads should clear malloc caches
675 https://bugs.webkit.org/show_bug.cgi?id=141097
677 Reviewed by Andreas Kling.
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.
682 * wtf/FastMalloc.cpp:
683 (WTF::releaseFastMallocFreeMemoryForThisThread):
684 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
687 2015-01-30 Antti Koivisto <antti@apple.com>
689 OSObjectPtr does not work with dispatch_data_t on Maverics
690 https://bugs.webkit.org/show_bug.cgi?id=141081
692 Reviewed by Pratik Solanki.
694 Trying to use OSObjectPtr<dispatch_data_t> throws
696 -[OS_dispatch_data _xref_dispose]: unrecognized selector sent to instance 0
699 (WTF::retainOSObject<dispatch_data_t>):
700 (WTF::releaseOSObject<dispatch_data_t>):
702 Add specialization for dispatch_data_t on Maverics.
704 2015-01-29 Santosh Mahto <santoshbit2007@gmail.com>
706 Refactor String::format to handle unreached va_end.
707 https://bugs.webkit.org/show_bug.cgi?id=140938
709 Reviewed by Alexey Proskuryakov.
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.
716 * wtf/text/WTFString.cpp:
718 2015-01-29 Csaba Osztrogonác <ossy@webkit.org>
720 Move HAVE_DTRACE definition back to Platform.h
721 https://bugs.webkit.org/show_bug.cgi?id=141033
723 Reviewed by Dan Bernstein.
727 2015-01-28 Namhoon Kim <namkim@ea.com>
729 Windows return -1 when calling vsnprintf with arguments that exceed target buffer size
730 https://bugs.webkit.org/show_bug.cgi?id=140917
732 Reviewed by Brent Fulgham.
734 Fix return value of vsnprintf when windows API return -1 to denote
735 requested buffer exceeded. Replace return value by calling vscprintf.
737 * wtf/StringExtras.h:
738 (snprintf): Fix return value by calling vscprintf when buffer exceeded.
739 (wtf_vsnprintf): Ditto.
741 2015-01-28 Geoffrey Garen <ggaren@apple.com>
743 Removed fastMallocForbid / fastMallocAllow
744 https://bugs.webkit.org/show_bug.cgi?id=141012
746 Reviewed by Mark Hahnenberg.
748 Removed the forbid / allow API because it is no longer used.
750 * wtf/FastMalloc.cpp:
751 (WTF::tryFastMalloc):
753 (WTF::tryFastCalloc):
756 (WTF::tryFastRealloc):
758 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
759 (WTF::isForbidden): Deleted.
760 (WTF::fastMallocForbid): Deleted.
761 (WTF::fastMallocAllow): Deleted.
762 (WTF::initializeIsForbiddenKey): Deleted.
765 2015-01-28 Dana Burkart <dburkart@apple.com>
767 Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
768 https://bugs.webkit.org/show_bug.cgi?id=136765
770 Reviewed by Alexey Proskuryakov.
772 * Configurations/Base.xcconfig:
773 * Configurations/DebugRelease.xcconfig:
775 2015-01-28 Darin Adler <darin@apple.com>
777 Fix small leak in Collator
778 https://bugs.webkit.org/show_bug.cgi?id=140990
780 Reviewed by Andreas Kling.
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.
787 2015-01-27 Geoffrey Garen <ggaren@apple.com>
789 Removed WTF_MALLOC_VALIDATION
790 https://bugs.webkit.org/show_bug.cgi?id=140958
792 Reviewed by Anders Carlsson.
794 I don't think anyone has been using this, and the #ifdefs were driving
797 We have other options for validation -- like MallocGuardEdges,
798 MallocCheckHeapEach, MallocScribble, and GuardMalloc.
800 * wtf/FastMalloc.cpp:
801 (WTF::tryFastMalloc):
803 (WTF::tryFastCalloc):
806 (WTF::tryFastRealloc):
808 (WTF::fastMallocSize):
809 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
810 (WTF::Internal::fastMallocMatchFailed): Deleted.
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.
820 2015-01-27 Commit Queue <commit-queue@webkit.org>
822 Unreviewed, rolling out r179192.
823 https://bugs.webkit.org/show_bug.cgi?id=140953
825 Caused numerous layout test failures (Requested by mattbaker_
830 "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
832 https://bugs.webkit.org/show_bug.cgi?id=140900
833 http://trac.webkit.org/changeset/179192
835 2015-01-26 Geoffrey Garen <ggaren@apple.com>
837 Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
838 https://bugs.webkit.org/show_bug.cgi?id=140900
840 Reviewed by Mark Hahnenberg.
842 New interface for aligned allocation: fastAlignedMalloc / fastAlignedFree.
843 We require a special function call on free because Windows.
845 * wtf/FastMalloc.cpp:
846 (WTF::fastAlignedMalloc):
847 (WTF::fastAlignedFree): Do it.
849 (WTF::do_memalign): Un-ifdef this, since we use it now.
851 * wtf/FastMalloc.h: Make our new function names visible like the rest
854 2015-01-26 Brent Fulgham <bfulgham@apple.com>
856 [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
857 https://bugs.webkit.org/show_bug.cgi?id=87426
858 <rdar://problem/11527899>
860 Reviewed by Darin Adler.
862 Revise internal containers to use std::addressof in preference to
863 to using the '&' operator.
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):
875 (WTF::HashTableBucketInitializer<false>::initialize):
877 (WTF::SimpleClassHashTraits::constructDeletedValue):
878 (WTF::CustomHashTraits::constructDeletedValue):
880 (WTF::ListHashSetConstIterator::get):
883 (WTF::OverflowHandler>::append):
884 (WTF::OverflowHandler>::tryAppend):
885 (WTF::OverflowHandler>::insert):
887 2015-01-24 Chris Dumez <cdumez@apple.com>
889 Provide implementation for WTF::DefaultHash<bool>
890 https://bugs.webkit.org/show_bug.cgi?id=140848
892 Reviewed by Anders Carlsson.
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.
898 * wtf/HashFunctions.h:
900 2015-01-23 Carlos Garcia Campos <cgarcia@igalia.com>
902 [GTK] Add missing null check in some derefGPtr implementations
903 https://bugs.webkit.org/show_bug.cgi?id=140822
905 Reviewed by Sergio Villar Senin.
907 It's missing in GHashTable and GVariant implementations.
909 * wtf/gobject/GRefPtr.cpp:
912 2015-01-23 Carlos Garcia Campos <cgarcia@igalia.com>
914 [GTK] Add initial database process support
915 https://bugs.webkit.org/show_bug.cgi?id=139491
917 Reviewed by Sergio Villar Senin.
919 Add support for using GRefPtr with GVariantBuilder.
921 * wtf/gobject/GRefPtr.cpp:
924 * wtf/gobject/GRefPtr.h:
925 * wtf/gobject/GTypedefs.h:
927 2015-01-22 Ryosuke Niwa <rniwa@webkit.org>
929 Add a build flag for ES6 class syntax
930 https://bugs.webkit.org/show_bug.cgi?id=140760
932 Reviewed by Michael Saboff.
934 * wtf/FeatureDefines.h:
936 2015-01-21 Csaba Osztrogonác <ossy@webkit.org>
938 Remove ENABLE(INSPECTOR) ifdef guards
939 https://bugs.webkit.org/show_bug.cgi?id=140668
941 Reviewed by Darin Adler.
943 * wtf/FeatureDefines.h:
945 2015-01-20 YunQiang Su <wzssyqa@gmail.com>
947 Fix failed to build for Linux/MIPS64EL
948 https://bugs.webkit.org/show_bug.cgi?id=124370
950 Reviewed by Darin Adler.
952 Add MIPS64EL support.
957 2015-01-19 Alexey Proskuryakov <ap@apple.com>
959 Make ASan do bounds checks for WTF::Vector
960 https://bugs.webkit.org/show_bug.cgi?id=140631
961 rdar://problem/19437718
963 Reviewed by Darin Adler.
965 * wtf/SizeLimits.cpp: Disable Vector object size checks for ASan enabled builds.
968 (WTF::VectorBuffer::endOfBuffer):
969 (WTF::Vector::Vector):
970 (WTF::Vector::~Vector):
972 (WTF::OverflowHandler>::Vector):
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):
992 * wtf/Compiler.h: Changed ASAN_ENABLED macro fallback value from false to 0,
993 MSVC was not happy with false.
995 2015-01-20 Csaba Osztrogonác <ossy@webkit.org>
997 Remove non-Windows cruft from WebKit/win/Plugins
998 https://bugs.webkit.org/show_bug.cgi?id=140675
1000 Reviewed by Anders Carlsson.
1002 * wtf/FeatureDefines.h:
1004 2015-01-16 Myles C. Maxfield <mmaxfield@apple.com>
1006 WeakPtr functions crash when created with default constructor
1007 https://bugs.webkit.org/show_bug.cgi?id=140479
1009 Reviewed by Andreas Kling.
1011 This patch rearranges how WeakPtr works, and has the following ideas behind it:
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
1027 Tests: WTF_WeakPtr API tests
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.
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
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.
1048 2015-01-16 Yusuke Suzuki <utatane.tea@gmail.com>
1050 std::all_of requires complete C++ iterators in GCC 4.8
1051 https://bugs.webkit.org/show_bug.cgi?id=140530
1053 Reviewed by Darin Adler.
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.
1060 This patch inherits std::iterator with appropriate type parameters.
1061 It automatically defines required typedefs including iterator_category.
1063 * wtf/HashIterators.h:
1065 2015-01-15 Csaba Osztrogonác <ossy@webkit.org>
1067 Remove ENABLE(SQL_DATABASE) guards
1068 https://bugs.webkit.org/show_bug.cgi?id=140434
1070 Reviewed by Darin Adler.
1072 * wtf/FeatureDefines.h:
1074 2015-01-14 Csaba Osztrogonác <ossy@webkit.org>
1076 Unreviewed fix after r163330.
1078 * wtf/Platform.h: Use C style comment.
1080 2015-01-14 Marc Juul <juul@sudomesh.org>
1082 C++ style comment was preventing compile if CPU(ARM_NEON)
1083 https://bugs.webkit.org/show_bug.cgi?id=133827
1085 Reviewed by Csaba Osztrogonác.
1089 2015-01-13 Chris Dumez <cdumez@apple.com>
1091 Make WTF::Optional work with msvc 2013
1092 https://bugs.webkit.org/show_bug.cgi?id=140401
1094 Reviewed by Anders Carlsson.
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.
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.
1103 This change is covered by the existing Optional WTF test.
1107 2015-01-11 Sam Weinig <sam@webkit.org>
1109 Remove support for SharedWorkers
1110 https://bugs.webkit.org/show_bug.cgi?id=140344
1112 Reviewed by Anders Carlsson.
1114 * wtf/FeatureDefines.h:
1116 2015-01-12 Darin Adler <darin@apple.com>
1118 Modernize and streamline HTMLTokenizer
1119 https://bugs.webkit.org/show_bug.cgi?id=140166
1121 Reviewed by Sam Weinig.
1123 * wtf/Forward.h: Removed PassRef, added OrdinalNumber and TextPosition.
1125 2015-01-09 Commit Queue <commit-queue@webkit.org>
1127 Unreviewed, rolling out r178154, r178163, and r178164.
1128 https://bugs.webkit.org/show_bug.cgi?id=140292
1130 Still multiple assertion failures on tests (Requested by ap on
1133 Reverted changesets:
1135 "Modernize and streamline HTMLTokenizer"
1136 https://bugs.webkit.org/show_bug.cgi?id=140166
1137 http://trac.webkit.org/changeset/178154
1139 "Unreviewed speculative buildfix after r178154."
1140 http://trac.webkit.org/changeset/178163
1142 "One more unreviewed speculative buildfix after r178154."
1143 http://trac.webkit.org/changeset/178164
1145 2015-01-08 Darin Adler <darin@apple.com>
1147 Modernize and streamline HTMLTokenizer
1148 https://bugs.webkit.org/show_bug.cgi?id=140166
1150 Reviewed by Sam Weinig.
1152 * wtf/Forward.h: Removed PassRef, added OrdinalNumber and TextPosition.
1154 2015-01-08 Benjamin Poulain <benjamin@webkit.org>
1156 [WK2] Start a prototype for declarative site specific extensions
1157 https://bugs.webkit.org/show_bug.cgi?id=140160
1159 Reviewed by Andreas Kling.
1161 * wtf/FeatureDefines.h:
1163 2015-01-07 Daniel Bates <dabates@apple.com>
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
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.
1174 2015-01-07 Daniel Bates <dabates@apple.com>
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
1179 Reviewed by David Kilzer.
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).
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).
1190 2015-01-07 Commit Queue <commit-queue@webkit.org>
1192 Unreviewed, rolling out r178068.
1193 https://bugs.webkit.org/show_bug.cgi?id=140235
1195 Breaks the iOS build (Requested by enrica on #webkit).
1199 "[iOS] Make WebKit2 build with public iOS SDK and more build
1201 https://bugs.webkit.org/show_bug.cgi?id=137371
1202 http://trac.webkit.org/changeset/178068
1204 2015-01-07 Daniel Bates <dabates@apple.com>
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
1209 Reviewed by David Kilzer.
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).
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).
1220 2015-01-07 Brian J. Burg <burg@cs.washington.edu>
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
1225 Reviewed by Andreas Kling.
1228 (WTF::Stopwatch::create): Return a Ref.
1230 2015-01-07 Commit Queue <commit-queue@webkit.org>
1232 Unreviewed, rolling out r178039.
1233 https://bugs.webkit.org/show_bug.cgi?id=140187
1235 Breaks ObjC Inspector Protocol (Requested by JoePeck on
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
1245 2015-01-06 Brian J. Burg <burg@cs.washington.edu>
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
1250 Reviewed by Andreas Kling.
1253 (WTF::Stopwatch::create): Return a Ref.
1255 2015-01-06 Alexey Proskuryakov <ap@apple.com>
1257 ADDRESS_SANITIZER macro is overloaded
1258 https://bugs.webkit.org/show_bug.cgi?id=140130
1260 Reviewed by Anders Carlsson.
1262 * wtf/Compiler.h: Added an ASAN_ENABLED macro. The abbreviation should become well
1263 known - we already use it in tools.
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.
1271 2015-01-05 Andreas Kling <akling@apple.com>
1273 Purge PassRefPtr from Page.
1274 <https://webkit.org/b/140089>
1276 Reviewed by Anders Carlsson.
1278 Make SchedulePair::create() return Ref since it never fails.
1280 * wtf/SchedulePair.h:
1281 (WTF::SchedulePair::create):
1283 2015-01-01 Darin Adler <darin@apple.com>
1285 Rework code that hides characters in password fields to streamline a little
1286 https://bugs.webkit.org/show_bug.cgi?id=140035
1288 Reviewed by Sam Weinig.
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.
1296 2014-12-26 Dan Bernstein <mitz@apple.com>
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>.
1302 * wtf/SaturatedArithmetic.h:
1303 (signedAddOverflows):
1304 (signedSubtractOverflows):
1306 2014-12-26 Dan Bernstein <mitz@apple.com>
1308 <rdar://problem/19348208> REGRESSION (r177027): iOS builds use the wrong toolchain
1309 https://bugs.webkit.org/show_bug.cgi?id=139950
1311 Reviewed by David Kilzer.
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.
1316 2014-12-25 Dan Bernstein <mitz@apple.com>
1318 Try to fix the Windows build after r177733.
1322 2014-12-25 Alexey Proskuryakov <ap@apple.com>
1324 Simplify saturated integer add/sub
1325 https://bugs.webkit.org/show_bug.cgi?id=139854
1327 Address Darin's post-commit feedback to fix API tests.
1329 * wtf/SaturatedArithmetic.h: (saturatedSubtraction):
1331 2014-12-24 Benjamin Poulain <benjamin@webkit.org>
1333 Simplify saturated integer add/sub
1334 https://bugs.webkit.org/show_bug.cgi?id=139854
1336 Reviewed by Darin Adler.
1339 Make a wrapper for __has_builtin for compilers that do not support it.
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.
1347 2014-12-23 Anders Carlsson <andersca@apple.com>
1349 Move dynamic_objc_cast to RetainPtr.h
1350 https://bugs.webkit.org/show_bug.cgi?id=139915
1352 Reviewed by Sam Weinig.
1355 (WTF::dynamic_objc_cast):
1357 2014-12-23 Anders Carlsson <andersca@apple.com>
1359 Re-indent RefPtr.h and RetainPtr.h.
1361 Rubber-stamped by Sam Weinig.
1366 2014-12-20 Eric Carlson <eric.carlson@apple.com>
1368 [iOS] add optimized fullscreen API
1369 https://bugs.webkit.org/show_bug.cgi?id=139833
1370 <rdar://problem/18844486>
1372 Reviewed by Simon Fraser.
1374 * wtf/Platform.h: Define ENABLE_VIDEO_PRESENTATION_MODE.
1376 2014-12-18 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1378 Fix build break on EFL and GTK since r177523
1379 https://bugs.webkit.org/show_bug.cgi?id=139805
1381 Reviewed by Csaba Osztrogonác.
1383 * wtf/Ref.h: Include <wtf/StdLibExtras.h> to use std::exchange().
1385 2014-12-18 Gavin Barraclough <barraclough@apple.com>
1387 Add strong typing to RefCounter interface, return value as a bool.
1388 https://bugs.webkit.org/show_bug.cgi?id=139776
1390 Unreviewed style fixes.
1395 2014-12-18 Brent Fulgham <bfulgham@apple.com>
1397 [Win] Build correction after r177541.
1400 (WTF::RefCounter::Token<T>::Token): Revise constructor inlines to correct
1403 2014-12-18 Gavin Barraclough <barraclough@apple.com>
1405 Add strong typing to RefCounter interface, return value as a bool.
1406 https://bugs.webkit.org/show_bug.cgi?id=139776
1408 Reviewed by Geoff Garen.
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>.
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.
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.
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):
1445 - Tokens can be copied & assigned.
1446 (WTF::RefCounter::count): Deleted.
1447 - renamed to token<>().
1449 2014-12-18 Anders Carlsson <andersca@apple.com>
1451 Simplify smart pointer classes by using std::exchange
1452 https://bugs.webkit.org/show_bug.cgi?id=139790
1454 Reviewed by Andreas Kling.
1457 * wtf/OSObjectPtr.h:
1459 (WTF::OwnPtr<T>::clear):
1460 (WTF::OwnPtr<T>::release):
1461 (WTF::OwnPtr<T>::leakPtr):
1464 (WTF::PassOwnPtr<T>::leakPtr):
1466 (WTF::PassRefPtr<T>::leakRef):
1469 (WTF::RefPtr<T>::clear):
1470 (WTF::RefPtr<T>::leakRef):
1472 (WTF::RetainPtr<T>::leakRef):
1474 2014-12-18 Anders Carlsson <andersca@apple.com>
1476 Clean up MachSendRight and add a copySendRight member function
1477 https://bugs.webkit.org/show_bug.cgi?id=139788
1479 Reviewed by Tim Horton.
1481 * wtf/StdLibExtras.h:
1483 Add an implementation of std::exchange.
1485 2014-12-17 Chris Dumez <cdumez@apple.com>
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>
1491 Reviewed by Andreas Kling.
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.
1496 * WTF.vcxproj/WTF.vcxproj:
1497 * WTF.xcodeproj/project.pbxproj:
1498 * wtf/CMakeLists.txt:
1500 2014-12-17 Brent Fulgham <bfulgham@apple.com>
1502 [Win] Correct DebugSuffix builds under MSBuild
1503 https://bugs.webkit.org/show_bug.cgi?id=139733
1504 <rdar://problem/19276880>
1506 Reviewed by Simon Fraser.
1508 * WTF.vcxproj/WTF.proj: Make sure to use the '_debug' suffix
1509 when building the DebugSuffix target.
1511 2014-12-17 Anders Carlsson <andersca@apple.com>
1513 Make Ref::copyRef const and ref-qualified
1514 https://bugs.webkit.org/show_bug.cgi?id=139730
1516 Reviewed by Andreas Kling.
1520 2014-12-16 Daniel Bates <dabates@apple.com>
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
1525 Reviewed by Chris Dumez.
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.
1531 * wtf/FeatureCounter.cpp:
1532 * wtf/ios/FeatureCounter.mm:
1534 2014-12-16 Geoffrey Garen <ggaren@apple.com>
1536 Enable FastMalloc in debug builds
1537 https://bugs.webkit.org/show_bug.cgi?id=139692
1539 Reviewed by Alexey Proskuryakov.
1541 This will give debug builds greater fidelity to the real thing.
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
1548 * wtf/FastMalloc.cpp:
1550 2014-12-16 Anders Carlsson <andersca@apple.com>
1552 RefPtr::copyRef should be const
1553 https://bugs.webkit.org/show_bug.cgi?id=139689
1555 Reviewed by Andreas Kling.
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.
1563 2014-12-15 Chris Dumez <cdumez@apple.com>
1565 [iOS] Add feature counting support
1566 https://bugs.webkit.org/show_bug.cgi?id=139652
1567 <rdar://problem/19255690>
1569 Reviewed by Gavin Barraclough.
1571 Add a FeatureCounter API for to log / count when a feature
1572 is used. For now, this is only implementated on iOS.
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):
1585 2014-12-12 Anders Carlsson <andersca@apple.com>
1587 Get rid of the DONT_FINALIZE_ON_MAIN_THREAD #define
1588 https://bugs.webkit.org/show_bug.cgi?id=139613
1590 Reviewed by Sam Weinig.
1595 2014-12-15 Commit Queue <commit-queue@webkit.org>
1597 Unreviewed, rolling out r177284.
1598 https://bugs.webkit.org/show_bug.cgi?id=139658
1600 "Breaks API tests and LayoutTests on Yosemite Debug"
1601 (Requested by msaboff on #webkit).
1605 "Make sure range based iteration of Vector<> still receives
1607 https://bugs.webkit.org/show_bug.cgi?id=138821
1608 http://trac.webkit.org/changeset/177284
1610 2014-12-15 Andreas Kling <akling@apple.com>
1612 Purge PassRefPtr from FocusEvent code.
1613 <https://webkit.org/b/139647>
1615 Reviewed by Anders Carlsson.
1617 Add a RefPtr::copyRef() to use when passing a RefPtr to a RefPtr&& without
1618 transferring the ownership.
1622 2014-12-15 Oliver Hunt <oliver@apple.com>
1624 Make sure range based iteration of Vector<> still receives bounds checking
1625 https://bugs.webkit.org/show_bug.cgi?id=138821
1627 Reviewed by Mark Lam.
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.
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.
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.
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):
1680 (WTF::IndexedIteratorSelector::makeIterator):
1681 (WTF::IndexedIteratorSelector::makeConstIterator):
1682 * wtf/RefCountedArray.h:
1683 (WTF::RefCountedArray::RefCountedArray):
1685 (WTF::Vector::Vector):
1686 (WTF::Vector::begin):
1688 (WTF::OverflowHandler>::Vector):
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):
1708 2014-12-14 Andreas Kling <akling@apple.com>
1710 Minor follow-up tweaks suggested by Darin on bug 139587.
1712 * wtf/text/WTFString.h:
1713 (WTF::String::String):
1715 2014-12-14 Andreas Kling <akling@apple.com>
1717 Replace PassRef with Ref/Ref&& across the board.
1718 <https://webkit.org/b/139587>
1720 Reviewed by Darin Adler.
1722 Kill the PassRef class and replace it by Ref/Ref&&.
1725 - For locals and members, keep using Ref<T>.
1726 - For return types, use Ref<T>.
1727 - For (ownership-transferring) arguments, use Ref<T>&&.
1729 When passing to a Ref&&, use WTF::move() to mobilize the value
1730 at the call site, e.g:
1732 void myFunction(Ref<Foo>&&);
1734 Ref<Foo> myFoo(Foo::create());
1735 myFunction(WTF::move(myFoo));
1736 // 'myFoo' is invalid from this point forward.
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.
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:
1744 Ref<Foo> foo() { return m_foo; }
1748 Ref<Foo> foo() { return m_foo.copyRef(); }
1750 This makes it explicit that a refcount bump will occur.
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.
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.
1765 (WTF::PassRefPtr::PassRefPtr):
1770 (WTF::Ref::operator=):
1771 (WTF::Ref::operator->):
1774 (WTF::Ref::operator T&):
1775 (WTF::Ref::operator const T&):
1776 (WTF::Ref<T>::replace):
1779 (WTF::RefCounter::count):
1781 (WTF::RefPtr::releaseNonNull):
1782 (WTF::RefPtr<T>::RefPtr):
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):
1829 2014-12-10 Geoffrey Garen <ggaren@apple.com>
1831 Please disable the webkitFirstVersionWithInitConstructorSupport check on Apple TV
1832 https://bugs.webkit.org/show_bug.cgi?id=139501
1834 Reviewed by Gavin Barraclough.
1836 Added a platform definition for APPLETV.
1838 (It's not an OS because it's not mutually exclusive with other OS definitions.)
1842 2014-12-10 Martin Robinson <mrobinson@igalia.com>
1844 [GTK] Add support for text-decoration-skip
1845 https://bugs.webkit.org/show_bug.cgi?id=131540
1847 Reviewed by Gustavo Noronha Silva.
1849 * wtf/Platform.h: Enable text decoration skip by default.
1851 2014-12-09 David Kilzer <ddkilzer@apple.com>
1853 Switch from using PLATFORM_NAME to SDK selectors in ANGLE, bmalloc, gtest, JavaScriptCore, WTF
1854 <http://webkit.org/b/139212>
1856 Reviewed by Joseph Pecoraro.
1858 * Configurations/Base.xcconfig:
1859 - Only set GCC_ENABLE_OBJC_GC, GCC_MODEL_TUNING and TOOLCHAINS
1861 * Configurations/DebugRelease.xcconfig:
1862 - Only set MACOSX_DEPLOYMENT_TARGET and SDKROOT on OS X.
1864 2014-12-09 Dean Jackson <dino@apple.com>
1866 [Apple] Use Accelerate framework to speed-up FEGaussianBlur
1867 https://bugs.webkit.org/show_bug.cgi?id=139310
1869 Unreviewed followup, after comments by Andreas Kling.
1871 It was pointed out that we already have a USE(ACCELERATE), so
1872 we don't need a HAVE(ACCELERATE) :)
1876 2014-12-09 Alberto Garcia <berto@igalia.com>
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
1881 Reviewed by Darin Adler.
1883 Replace OS(MAC_OS_X) with PLATFORM(MAC) to prevent using
1884 osx-specific code in WebKitGTK+ builds.
1886 * wtf/ThreadingPthreads.cpp:
1887 (WTF::initializeCurrentThreadInternal):
1889 2014-12-08 Dean Jackson <dino@apple.com>
1891 [Apple] Use Accelerate framework to speed-up FEGaussianBlur
1892 https://bugs.webkit.org/show_bug.cgi?id=139310
1893 <rdar://problem/18434594>
1895 Reviewed by Simon Fraser.
1897 Add a HAVE_ACCELERATE flag, true on Apple platforms.
1901 2014-12-08 Myles C. Maxfield <mmaxfield@apple.com>
1903 Fix iOS build after r176971.
1905 I had previously modified the WTF forwarding header instead of modifying the real source.
1907 * wtf/unicode/CharacterNames.h:
1909 2014-12-08 Anders Carlsson <andersca@apple.com>
1911 Change WTF::currentCPUTime to return std::chrono::microseconds and get rid of currentCPUTimeMS
1912 https://bugs.webkit.org/show_bug.cgi?id=139410
1914 Reviewed by Andreas Kling.
1916 * wtf/CurrentTime.cpp:
1917 (WTF::currentCPUTime):
1918 (WTF::currentCPUTimeMS): Deleted.
1919 * wtf/CurrentTime.h:
1921 2014-12-08 Chris Dumez <cdumez@apple.com>
1923 Revert r176293 & r176275
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.
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):
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:
1977 * wtf/text/WTFString.h:
1979 2014-12-07 Andreas Kling <akling@apple.com>
1981 Use more PassRef in AtomicString.
1982 <https://webkit.org/b/139319>
1984 Reviewed by Antti Koivisto.
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.
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):
2001 2014-12-05 Roger Fong <roger_fong@apple.com>
2003 [Win] proj files copying over too many resources..
2004 https://bugs.webkit.org/show_bug.cgi?id=139315.
2005 <rdar://problem/19148278>
2007 Reviewed by Brent Fulgham.
2009 * WTF.vcxproj/WTF.proj: Only copy WTF.dll.
2011 2014-12-05 Andreas Kling <akling@apple.com>
2013 PassRef should deref on destruction if pointee was not moved.
2014 <https://webkit.org/b/139309>
2016 Reviewed by Antti Koivisto.
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.
2022 This should make it possible for all ::create()-style construction helpers to
2023 return PassRef, removing a branch in each case.
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.
2033 2014-12-05 Jer Noble <jer.noble@apple.com>
2035 [WTF] MediaTime should support round-tripping from and to doubles.
2036 https://bugs.webkit.org/show_bug.cgi?id=139248
2038 Reviewed by Eric Carlson.
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
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.
2056 (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double.
2058 2014-12-05 peavo@outlook.com <peavo@outlook.com>
2060 [WinCairo] WTF project is missing a GStreamer source file.
2061 https://bugs.webkit.org/show_bug.cgi?id=139296
2063 Reviewed by Philippe Normand.
2065 The WTF project file is missing a GStreamer source file,
2066 causing a link error when compiling with GStreamer enabled.
2068 * WTF.vcxproj/WTF.vcxproj:
2069 * WTF.vcxproj/WTF.vcxproj.filters:
2071 2014-12-04 David Kilzer <ddkilzer@apple.com>
2073 REGRESSION (r176683): RefCounter.h is installed outside SDKROOT
2075 * WTF.xcodeproj/project.pbxproj: Don't mark RefCounter.h as a
2076 private header. WTF headers use a special build phase script to
2079 2014-12-04 Anders Carlsson <andersca@apple.com>
2081 Make API::String copy the underlying strings if needed, for thread safety
2082 https://bugs.webkit.org/show_bug.cgi?id=139261
2084 Reviewed by Sam Weinig.
2087 (WTF::RefPtr<T>::leakRef):
2088 Add a leakRef() to RefPtr so we don't have to go through PassRefPtr.
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.
2096 2014-12-04 Csaba Osztrogonác <ossy@webkit.org>
2098 Fix cast-align warning in StringImpl.h
2099 https://bugs.webkit.org/show_bug.cgi?id=139222
2101 Reviewed by Anders Carlsson.
2103 * wtf/text/StringImpl.h:
2104 (WTF::StringImpl::tailPointer):
2106 2014-12-02 Mark Lam <mark.lam@apple.com>
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
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):
2120 (WTF::Vector::Vector):
2121 (WTF::Vector::begin):
2123 (WTF::OverflowHandler>::Vector):
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):
2143 2014-12-02 Oliver Hunt <oliver@apple.com>
2147 * wtf/IndexedIterator.h:
2149 2014-12-02 Gavin Barraclough <barraclough@apple.com>
2151 Generalize PageActivityAssertionToken
2152 https://bugs.webkit.org/show_bug.cgi?id=139106
2154 Reviewed by Sam Weinig.
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.
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).
2171 In the reimplementation:
2172 - a callback is provided via a lambda function, which allows for easy reuse without a lot of
2174 - the counter, callback and ownership of the otherwise weakly-owned token is encapsulated within the
2176 - a single count within RefCounter::Count stores the counter value, and also manage the lifetime
2178 - standard RefPtrs are used to manage references to the RefCounter::Count.
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.
2201 2014-12-01 Andreas Kling <akling@apple.com>
2203 Optimize constructing JSC::Identifier from AtomicString.
2204 <https://webkit.org/b/139157>
2206 Reviewed by Michael Saboff.
2208 Make AtomicString::isInAtomicStringTable() public so it can be used
2209 in some Identifier assertions.
2211 * wtf/text/AtomicString.h:
2213 2014-12-01 Oliver Hunt <oliver@apple.com>
2217 * wtf/IndexedIterator.h:
2219 2014-12-01 Oliver Hunt <oliver@apple.com>
2223 * wtf/IndexedIterator.h:
2225 2014-11-17 Oliver Hunt <oliver@apple.com>
2227 Make sure range based iteration of Vector<> still receives bounds checking
2228 https://bugs.webkit.org/show_bug.cgi?id=138821
2230 Reviewed by Mark Lam.
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
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.
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.
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.
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):
2292 (WTF::IndexedIteratorSelector::makeIterator):
2293 (WTF::IndexedIteratorSelector::makeConstIterator):
2294 * wtf/RefCountedArray.h:
2295 (WTF::RefCountedArray::RefCountedArray):
2297 (WTF::Vector::Vector):
2298 (WTF::Vector::begin):
2300 (WTF::OverflowHandler>::Vector):
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):
2320 2014-11-30 Ryuan Choi <ryuan.choi@navercorp.com>
2322 [EFL] Drop support for the EFL 1.7
2323 https://bugs.webkit.org/show_bug.cgi?id=139114
2325 Reviewed by Gyuyoung Kim.
2327 * wtf/efl/EflTypedefs.h: Removed old definitions which EFL 1.7 used.
2329 2014-11-21 Anders Carlsson <andersca@apple.com>
2331 Remove the Timer parameters from timer callbacks
2332 https://bugs.webkit.org/show_bug.cgi?id=138974
2334 Reviewed by Antti Koivisto.
2336 * wtf/RunLoopTimer.h:
2337 (WTF::RunLoopTimer::RunLoopTimer):
2338 (WTF::RunLoopTimer::fired):
2340 2014-11-18 Chris Dumez <cdumez@apple.com>
2342 Have Vector::capacity() return an unsigned instead of a size_t
2343 https://bugs.webkit.org/show_bug.cgi?id=138842
2345 Reviewed by Andreas Kling.
2347 Have Vector::capacity() return an unsigned instead of a size_t as
2348 capacity is stored as an unsigned internally.
2351 (WTF::Vector::capacity):
2352 (WTF::OverflowHandler>::expandCapacity):
2353 (WTF::OverflowHandler>::tryExpandCapacity):
2355 2014-11-18 Geoffrey Garen <ggaren@apple.com>
2357 Removed the custom allocator for ListHashSet nodes
2358 https://bugs.webkit.org/show_bug.cgi?id=138841
2360 Reviewed by Andreas Kling.
2362 bmalloc is fast, so we don't need a custom allocator.
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.
2369 * wtf/ListHashSet.h:
2370 (WTF::ListHashSetNode::ListHashSetNode):
2371 (WTF::ListHashSetTranslator::translate):
2372 (WTF::U>::ListHashSet):
2375 (WTF::U>::~ListHashSet):
2377 (WTF::U>::capacity):
2380 (WTF::U>::removeFirst):
2381 (WTF::U>::takeFirst):
2383 (WTF::U>::removeLast):
2384 (WTF::U>::takeLast):
2385 (WTF::U>::contains):
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.
2403 2014-11-18 Chris Dumez <cdumez@apple.com>
2405 Update the Vector API to deal with unsigned types instead of size_t
2406 https://bugs.webkit.org/show_bug.cgi?id=138824
2408 Reviewed by Andreas Kling.
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.
2415 The rest of the Vector API will be ported in follow-up patches to
2416 make the change smaller and more easily reviewable.
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):
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:
2464 * wtf/text/WTFString.h:
2466 2014-11-18 peavo@outlook.com <peavo@outlook.com>
2468 [WinCairo] Compile errors when GStreamer is enabled.
2469 https://bugs.webkit.org/show_bug.cgi?id=137000
2471 Reviewed by Philippe Normand.
2473 MSVC does not allow the keyword default on move constructors and move assignment operators.
2475 * wtf/gobject/GMainLoopSource.cpp:
2476 (WTF::GMainLoopSource::cancel):
2477 (WTF::GMainLoopSource::socketCallback):
2478 * wtf/gobject/GMainLoopSource.h:
2479 (WTF::GMainLoopSource::Context::operator=):
2481 2014-11-17 Anders Carlsson <andersca@apple.com>
2483 Fix WTF build with newer versions of clang.
2484 <rdar://problem/18978705>
2487 (WTF::removeIterator):
2489 (WTF::double_conversion::BitCast):
2491 2014-11-13 Myles C. Maxfield <mmaxfield@apple.com>
2493 Allow constructing a base PassRef with a derived Ref
2494 https://bugs.webkit.org/show_bug.cgi?id=138701
2496 Reviewed by Andreas Kling
2499 (WTF::PassRef<T>::PassRef):
2501 2014-11-12 Ryuan Choi <ryuan.choi@navercorp.com>
2503 [EFL] Fix the build with EFL 1.12
2504 https://bugs.webkit.org/show_bug.cgi?id=138245
2506 Reviewed by Gyuyoung Kim.
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.
2512 2014-11-12 Mark Lam <mark.lam@apple.com>
2514 Rename USE(MASM_PROBE) to ENABLE(MASM_PROBE).
2515 <https://webkit.org/b/138661>
2517 Reviewed by Michael Saboff.
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.
2525 2014-11-09 Antti Koivisto <antti@apple.com>
2527 Remove BloomFilter size limit
2528 https://bugs.webkit.org/show_bug.cgi?id=138549
2530 Reviewed by Andreas Kling.
2532 * wtf/BloomFilter.h: Remove the static_assert, the code works fine with somewhat larger sizes.
2534 2014-11-09 Chris Dumez <cdumez@apple.com>
2536 Add a more correct way to compare floating point numbers and use it
2537 https://bugs.webkit.org/show_bug.cgi?id=138527
2539 Reviewed by Darin Adler.
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()
2545 However, this is not correct for arbitrary floating point values, and
2546 will fail for values that are not close to zero.
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
2553 [1] Knuth, D. E. "Accuracy of Floating Point Arithmetic." The Art of
2554 Computer Programming. 3rd ed. Vol. 2. Boston: Addison-Wesley, 1998.
2556 [2] http://www.boost.org/doc/libs/1_34_0/libs/test/doc/components/test_tools/floating_point_comparison.html
2559 (WTF::safeFPDivision):
2560 (WTF::areEssentiallyEqual):
2561 (WTF::withinEpsilon): Deleted.
2563 2014-11-08 Darin Adler <darin@apple.com>
2565 Replace FileThread class with a single function
2566 https://bugs.webkit.org/show_bug.cgi?id=138282
2568 Reviewed by Alexey Proskuryakov.
2570 * wtf/MessageQueue.h: Made queue work on any type and not require wrapping
2571 everything in a unique_ptr.
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.
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.
2583 2014-11-05 Chris Dumez <cdumez@apple.com>
2585 Assertion hit DOMTimer::updateTimerIntervalIfNecessary()
2586 https://bugs.webkit.org/show_bug.cgi?id=138440
2588 Reviewed by Geoffrey Garen.
2590 Move the withinEpsilon() function to WTF to avoid code duplication.
2593 (WTF::withinEpsilon):
2595 2014-11-05 Chris Dumez <cdumez@apple.com>
2597 Allow constructing a PassRef from a Ref
2598 https://bugs.webkit.org/show_bug.cgi?id=138389
2600 Reviewed by Andreas Kling.
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.
2607 (WTF::PassRef<T>::PassRef):
2609 2014-11-05 Dan Bernstein <mitz@apple.com>
2611 Remove the unused deletion UI feature
2612 https://bugs.webkit.org/show_bug.cgi?id=138442
2614 Rubber-stamped by Alexey Proskuryakov.
2616 * wtf/FeatureDefines.h: Removed definition of ENABLE_DELETION_UI.
2618 2014-11-03 Dean Jackson <dino@apple.com>
2620 Add ENABLE_FILTERS_LEVEL_2 feature guard.
2621 https://bugs.webkit.org/show_bug.cgi?id=138362
2623 Reviewed by Tim Horton.
2625 Add a new feature define for Level 2 of CSS Filters.
2626 http://dev.w3.org/fxtf/filters-2/
2628 * wtf/FeatureDefines.h:
2630 2014-11-05 Csaba Osztrogonác <ossy@webkit.org>
2632 Enable ARMv7 disassembler for all platforms
2633 https://bugs.webkit.org/show_bug.cgi?id=138415
2635 Reviewed by Darin Adler.
2639 2014-11-04 Chris Dumez <cdumez@apple.com>
2641 Add ptr() method to Ref class
2642 https://bugs.webkit.org/show_bug.cgi?id=138361
2644 Reviewed by Darin Adler.
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.
2652 (WTF::PassRef<T>::ptr):
2655 (WTF::GetPtrHelper<Ref<T>>::getPtr):
2657 2014-11-04 Dániel Bátyai <dbatyai.u-szeged@partner.samsung.com>
2659 ATTR_USED incorrectly applying to Clang
2660 https://bugs.webkit.org/show_bug.cgi?id=138313
2662 Reviewed by Csaba Osztrogonác.
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.
2669 2014-11-03 Chris Dumez <cdumez@apple.com>
2671 Allow implicit conversion from Ref<T> to T&
2672 https://bugs.webkit.org/show_bug.cgi?id=138331
2674 Reviewed by Andreas Kling.
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.
2681 (WTF::Ref::operator T&):
2682 (WTF::Ref::operator const T&):
2684 (WTF::RunLoop::Holder::runLoop):
2686 2014-10-31 Jeffrey Pfau <jpfau@apple.com>
2688 Unreviewed, fix ASan build after r175382
2690 * wtf/SizeLimits.cpp:
2692 2014-10-31 Geoffrey Garen <ggaren@apple.com>
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.
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.
2705 Enable bmalloc in 32bit builds
2706 https://bugs.webkit.org/show_bug.cgi?id=138232
2708 Reviewed by Andreas Kling.
2710 * wtf/FastMalloc.cpp:
2712 2014-10-31 Lucas Forschler <lforschler@apple.com>
2714 Unreviewed rollout r175389.
2716 2014-10-30 Dana Burkart <dburkart@apple.com>
2718 <rdar://problem/18821260> Prepare for the mysterious future
2720 Reviewed by Lucas Forschler.
2722 * Configurations/Base.xcconfig:
2723 * Configurations/DebugRelease.xcconfig:
2725 2014-10-30 Geoffrey Garen <ggaren@apple.com>
2727 Enable bmalloc in 32bit builds
2728 https://bugs.webkit.org/show_bug.cgi?id=138232
2730 Reviewed by Andreas Kling.
2734 * wtf/FastMalloc.cpp:
2736 2014-10-30 Jeffrey Pfau <jpfau@apple.com>
2738 ASSERT(!m_deletionHasBegun) in RefCounted.h should be ASSERT_WITH_SECURITY_IMPLICATION
2739 https://bugs.webkit.org/show_bug.cgi?id=138141
2741 Reviewed by Alexey Proskuryakov.
2744 (WTF::RefCountedBase::ref):
2745 (WTF::RefCountedBase::relaxAdoptionRequirement):
2746 (WTF::RefCountedBase::derefBase):
2749 2014-10-28 Milan Crha <mcrha@redhat.com>
2751 Use constants from wtf/MathExtras.h
2752 https://bugs.webkit.org/show_bug.cgi?id=137967
2754 Reviewed by Darin Adler.
2758 2014-10-28 Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com>
2760 [EFL] Remove unnecessary defines from OptionsEfl.cmake
2761 https://bugs.webkit.org/show_bug.cgi?id=138132
2763 Reviewed by Csaba Osztrogonác.
2767 2014-10-27 Chris Dumez <cdumez@apple.com>
2769 Use separate HashMaps for common and uncommon headers in HTTPHeaderMap
2770 https://bugs.webkit.org/show_bug.cgi?id=138079
2772 Reviewed by Anders Carlsson.
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.
2779 (WTF::StrongEnumHashTraits::emptyValue):
2780 (WTF::StrongEnumHashTraits::constructDeletedValue):
2781 (WTF::StrongEnumHashTraits::isDeletedValue):
2783 2014-10-25 Brian J. Burg <burg@cs.washington.edu>
2785 Web Inspector: timelines should not count time elapsed while paused in the debugger
2786 https://bugs.webkit.org/show_bug.cgi?id=136351
2788 Unreviewed, follow-up fix after r175203. The debugger agent should not assume
2789 that the inspector environment's stopwatch has already been started.
2792 (WTF::Stopwatch::isActive): Added. Allow peeking at the stopwatch state.
2794 2014-10-18 Brian J. Burg <burg@cs.washington.edu>
2796 Web Inspector: timelines should not count time elapsed while paused in the debugger
2797 https://bugs.webkit.org/show_bug.cgi?id=136351
2799 Reviewed by Timothy Hatcher.
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):
2813 2014-10-23 Joseph Pecoraro <pecoraro@apple.com>
2815 Web Inspector: Provide a way to have alternate inspector agents
2816 https://bugs.webkit.org/show_bug.cgi?id=137901
2818 Reviewed by Brian Burg.
2820 * wtf/FeatureDefines.h:
2822 2014-10-23 Alberto Garcia <berto@igalia.com>
2824 [GTK] Fix build on Hurd
2825 https://bugs.webkit.org/show_bug.cgi?id=138003
2827 Reviewed by Carlos Garcia Campos.
2832 2014-10-22 Byungseon Shin <sun.shin@lge.com>
2834 String(new Date(Mar 30 2014 01:00:00)) is wrong in CET
2835 https://bugs.webkit.org/show_bug.cgi?id=130967
2837 Reviewed by Mark Lam.
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.
2845 (WTF::calculateLocalTimeOffset):
2846 (WTF::parseDateFromNullTerminatedCharacters):
2847 Compensate time offset depends on UTC time or local time.
2849 Add argument to differenciate UTC or local time.
2851 2014-10-21 Dániel Bátyai <dbatyai.u-szeged@partner.samsung.com>
2853 Fix FTL Native Inlining for EFL
2854 https://bugs.webkit.org/show_bug.cgi?id=137774
2856 Reviewed by Michael Saboff.
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.
2863 2014-10-20 Chris Dumez <cdumez@apple.com>
2865 Use is<>() / downcast<>() for Accessibility objects
2866 https://bugs.webkit.org/show_bug.cgi?id=137286
2868 Reviewed by Darin Adler.
2870 Remove the legacy TYPE_CASTS_BASE() macro now that it is no longer
2875 2014-10-18 Dan Bernstein <mitz@apple.com>
2877 WorkQueue dispatches functions but isn’t a FunctionDispatcher
2878 https://bugs.webkit.org/show_bug.cgi?id=137853
2880 Reviewed by Anders Carlsson.
2882 * wtf/FunctionDispatcher.h: Added header guards.
2884 2014-10-17 Carlos Garcia Campos <cgarcia@igalia.com>
2886 [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
2887 https://bugs.webkit.org/show_bug.cgi?id=137782
2889 Reviewed by Sergio Villar Senin.
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.
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:
2902 2014-10-17 Dan Bernstein <mitz@apple.com>
2904 Reverted incorrect build fix attempt.
2906 * wtf/Threading.cpp:
2908 2014-10-17 Dan Bernstein <mitz@apple.com>
2910 Tried to fix the Yosemite build.
2912 * wtf/Threading.cpp:
2914 2014-10-16 Dan Bernstein <mitz@apple.com>
2916 OSObjectPtr is missing leakRef()
2917 https://bugs.webkit.org/show_bug.cgi?id=137798
2919 Reviewed by Sam Weinig.
2921 * wtf/OSObjectPtr.h:
2923 2014-10-14 Brent Fulgham <bfulgham@apple.com>
2925 [Win] Unreviewed gardening. Ignore Visual Studio *.sdf files.
2927 * WTF.vcxproj: Modified property svn:ignore.
2929 2014-10-13 Antti Koivisto <antti@apple.com>
2931 Add StringCapture helper for thread-safe lambda capture
2932 https://bugs.webkit.org/show_bug.cgi?id=137664
2934 Reviewed by Anders Carlsson.
2936 There is currently no clean way to capture a String in a thread-safe manner. This will now work:
2938 StringCapture stringCapture(string);
2939 auto lambdaThatRunsInAnotherThread = [stringCapture] { String string = stringCapture.string(); ... }
2941 This type won't be necessary with C++14 initialized lambda capture: [string = string.isolatedCopy()].
2943 * wtf/text/WTFString.h:
2944 (WTF::StringCapture::StringCapture): Create isolated copy in copy-constructor.
2945 (WTF::StringCapture::string):
2947 2014-10-11 KwangHyuk Kim <hyuki.kim@samsung.com>
2949 [EFL] Enable WebP support.
2950 https://bugs.webkit.org/show_bug.cgi?id=136156
2952 Reviewed by Gyuyoung Kim.
2954 Enable WTF_USE_WEBP macro for WK2 Efl.
2958 2014-10-11 Carlos Garcia Campos <cgarcia@igalia.com>
2960 [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource
2961 https://bugs.webkit.org/show_bug.cgi?id=137485
2963 Reviewed by Sergio Villar Senin.
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.
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.
3013 2014-10-09 Dean Jackson <dino@apple.com>
3015 Remove ENABLE_CSS3_CONDITIONAL_RULES
3016 https://bugs.webkit.org/show_bug.cgi?id=137571
3018 Reviewed by Simon Fraser.
3020 * wtf/FeatureDefines.h:
3022 2014-10-09 Akos Kiss <akiss@inf.u-szeged.hu>
3024 Enable ARM64 disassembler for all platforms
3025 https://bugs.webkit.org/show_bug.cgi?id=137560
3027 Reviewed by Michael Saboff.
3029 Remove PLATFORM conditions from around WTF_USE_ARM64_DISASSEMBLER since
3030 the ARM64 disassembler has no platform dependencies anymore.
3034 2014-10-08 peavo@outlook.com <peavo@outlook.com>
3036 [WinCairo] Enable JIT on 32-bit.
3037 https://bugs.webkit.org/show_bug.cgi?id=137521
3039 Reviewed by Mark Lam.
3041 Enable JIT on Windows 32-bit, but disable it at runtime if SSE2 is not present.
3045 2014-10-08 Brent Fulgham <bfulgham@apple.com>
3047 [Win] Resolve warnings about missing __has_include macro under MSVC
3048 https://bugs.webkit.org/show_bug.cgi?id=137524
3050 Reviewed by Anders Carlsson.
3052 * wtf/Compiler.h: Provide a dummy implementation of __has_include that
3053 avoids the warning without changing compile behavior.
3055 2014-10-07 Brent Fulgham <bfulgham@apple.com>
3057 [Win] Resolve some MSVC static analyzer warnings
3058 https://bugs.webkit.org/show_bug.cgi?id=137504
3060 Reviewed by Dean Jackson.
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.
3071 2014-10-07 Christophe Dumez <cdumez@apple.com>
3073 [WK2] Use is<>() / downcast<>() for DrawingAreaProxy subclasses
3074 https://bugs.webkit.org/show_bug.cgi?id=137477
3076 Reviewed by Andreas Kling.
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.
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):
3087 2014-10-07 Anders Carlsson <andersca@apple.com>
3089 Try to fix the Mountain Lion build.
3091 * wtf/text/StringView.h:
3092 (WTF::StringView::underlyingStringIsValid):
3093 (WTF::StringView::setUnderlyingString):
3094 (WTF::StringView::invalidate):
3096 2014-10-07 Anders Carlsson <andersca@apple.com>
3098 Use "1", not "true".
3100 * wtf/text/StringView.h:
3102 2014-10-07 Anders Carlsson <andersca@apple.com>
3104 Temporarily disable the StringView lifetime checking.
3106 * wtf/text/StringView.h:
3108 2014-10-07 Anders Carlsson <andersca@apple.com>
3110 Another build fix attempt.
3112 * wtf/text/StringView.cpp:
3113 (WTF::StringView::UnderlyingString::UnderlyingString):
3115 2014-10-07 Anders Carlsson <andersca@apple.com>
3117 Try to fix the Windows build.
3119 * wtf/text/StringView.cpp:
3120 (WTF::StringView::UnderlyingString::UnderlyingString):
3122 2014-10-06 Darin Adler <darin@apple.com>
3124 Make StringView check the lifetime of the StringImpl it's created from
3125 https://bugs.webkit.org/show_bug.cgi?id=137202
3127 Reviewed by Anders Carlsson.
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.
3134 * wtf/text/StringImpl.cpp:
3135 (WTF::StringImpl::~StringImpl): Call StringView::invalidate.
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.
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
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
3166 (WTF::StringView::underlyingStringIsValid): Ditto.
3167 (WTF::StringView::setUnderlyingString): Ditto.
3169 2014-10-06 Brent Fulgham <bfulgham@apple.com>
3171 [Win] DateMath's calculateUTFOffset does not account for DST.
3172 https://bugs.webkit.org/show_bug.cgi?id=137458
3173 <rdar://problem/18559172>
3175 Reviewed by Geoffrey Garen.
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).
3181 Also, handle possible error cases in the FileTimeToSystemTime
3182 and SystemTimeToTzSpecificLocalTime, rather than using potentially
3183 uninitialized values.
3186 (WTF::calculateUTCOffset): Use proper daylight-savings-time state.
3187 (WTF::calculateDSTOffset): Avoid uninitialized data due to failing
3190 2014-10-06 Christophe Dumez <cdumez@apple.com>
3192 Add is<>() / downcast<>() support for RenderObject subclasses
3193 https://bugs.webkit.org/show_bug.cgi?id=137424
3195 Reviewed by Benjamin Poulain.
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
3208 2014-10-06 Brent Fulgham <bfulgham@apple.com>
3210 [Win] Project file gardening.
3212 * WTF.vcxproj/WTF.vcxproj.filters: Move HashMethod.h and
3213 FastBitVector.cpp to proper places in hierarchy.
3215 2014-10-04 Brian J. Burg <burg@cs.washington.edu>
3217 Unreviewed, rolling out r174319.
3219 Causes assertions in fast/profiler tests. Needs nontrivial
3220 investigation, will take offline.
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
3229 2014-10-04 Brian J. Burg <burg@cs.washington.edu>
3231 Web Inspector: timelines should not count time elapsed while paused in the debugger
3232 https://bugs.webkit.org/show_bug.cgi?id=136351
3234 Reviewed by Timothy Hatcher.
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):
3245 2014-10-04 Filip Pizlo <fpizlo@apple.com>
3247 FTL should sink PutLocals
3248 https://bugs.webkit.org/show_bug.cgi?id=137168
3250 Reviewed by Oliver Hunt.
3252 Make the set bits of a BitVector iterable.
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):
3265 2014-10-03 Commit Queue <commit-queue@webkit.org>
3267 Unreviewed, rolling out r174275.
3268 https://bugs.webkit.org/show_bug.cgi?id=137408
3270 Build failures on the internal bots. (Requested by dethbakin
3275 "FTL should sink PutLocals"
3276 https://bugs.webkit.org/show_bug.cgi?id=137168
3277 http://trac.webkit.org/changeset/174275
3279 2014-10-03 Christophe Dumez <cdumez@apple.com>
3281 Add TypeCasts.h to xcodeproject
3282 https://bugs.webkit.org/show_bug.cgi?id=137403
3284 Reviewed by Benjamin Poulain.
3286 Add TypeCasts.h to xcodeproject.
3288 * WTF.xcodeproj/project.pbxproj:
3290 2014-09-28 Filip Pizlo <fpizlo@apple.com>
3292 FTL should sink PutLocals
3293 https://bugs.webkit.org/show_bug.cgi?id=137168
3295 Reviewed by Oliver Hunt.
3297 Make the set bits of a BitVector iterable.
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):
3310 2014-10-03 Myles C. Maxfield <mmaxfield@apple.com>
3312 Support modern for loops over StringViews
3313 https://bugs.webkit.org/show_bug.cgi?id=137165
3315 Reviewed by Darin Adler.
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
3323 Using these new objects looks like this:
3324 for (UChar codeunit : stringView.codeUnits()) { } and
3325 for (UChar32 codepoint : stringView.codePoints()) { }.
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!=):
3339 2014-09-28 Sam Weinig <sam@webkit.org>
3341 Remove RefPtrHashMap
3342 https://bugs.webkit.org/show_bug.cgi?id=137200
3344 Reviewed by Darin Adler.
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:
3350 For HashMap<RefPtr<Foo>, Bar> map:
3352 RefPtr<Foo> foo = ...;
3353 map.add(WTF::move(foo), Bar());
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.
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.
3364 * wtf/RefPtrHashMap.h: Removed.
3367 Remove #include of RefPtrHashMap.h and add inlineGet to match the interface
3368 exposed by the RefPtrHashMap specialization.
3370 2014-10-02 Anders Carlsson <andersca@apple.com>
3372 Add back debugging/testing code that I accidentally removed.
3374 * wtf/text/StringConcatenate.h:
3375 (WTF::StringTypeAdapter<String>::writeTo):
3377 2014-10-02 Anders Carlsson <andersca@apple.com>
3379 Simplify StringTypeAdapter templates
3380 https://bugs.webkit.org/show_bug.cgi?id=137356
3382 Reviewed by Andreas Kling.
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.
3387 * wtf/text/StringView.h:
3388 Move enough functions out of line so we can include WTFString.h after the StringView class definition.
3390 2014-10-01 Christophe Dumez <cdumez@apple.com>
3392 Have is<>(T*) function do a null check on the pointer argument
3393 https://bugs.webkit.org/show_bug.cgi?id=137333
3395 Reviewed by Gavin Barraclough.
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
3407 2014-10-02 Daniel Bates <dabates@apple.com>
3409 Clean up: Move XPC forward declarations in JavaScriptCore to WTF SPI wrapper header
3410 https://bugs.webkit.org/show_bug.cgi?id=137277
3412 Reviewed by Alexey Proskuryakov.
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.
3420 * WTF.xcodeproj/project.pbxproj:
3421 * wtf/spi/darwin/XPCSPI.h: Added.
3423 2014-10-01 Christophe Dumez <cdumez@apple.com>
3425 Unreviewed build fix after r174193.
3427 Adding a return statement as that function is returning a boolean.
3430 (WTF::TypeCastTraits::isOfType):
3432 2014-10-01 Christophe Dumez <cdumez@apple.com>
3434 Fail better when is<>() / downcast<>() is used for an unsupported type
3435 https://bugs.webkit.org/show_bug.cgi?id=137323
3437 Reviewed by Benjamin Poulain.
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.
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
3451 (WTF::TypeCastTraits::isOfType):
3453 2014-10-01 Commit Queue <commit-queue@webkit.org>
3455 Unreviewed, rolling out r174180, r174183, and r174186.
3456 https://bugs.webkit.org/show_bug.cgi?id=137320
3458 Broke the Mac MountainLion build. Will investigate offline.
3459 (Requested by dydz on #webkit).
3461 Reverted changesets:
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
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
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
3478 2014-10-01 Daniel Bates <dabates@apple.com>
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)
3483 Include header AvailabilityMacros.h instead of Availability.h, which actually defines the
3484 macro __MAC_OS_X_VERSION_MIN_REQUIRED.
3486 * wtf/spi/darwin/XPCSPI.h:
3488 2014-10-01 Daniel Bates <dabates@apple.com>
3490 Attempt to fix the build after <https://trac.webkit.org/changeset/174180>
3491 (https://bugs.webkit.org/show_bug.cgi?id=137277)
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
3497 * wtf/spi/darwin/XPCSPI.h:
3499 2014-10-01 Daniel Bates <dabates@apple.com>
3501 Clean up: Move XPC forward declarations in JavaScriptCore to WTF SPI wrapper header
3502 https://bugs.webkit.org/show_bug.cgi?id=137277
3504 Reviewed by Alexey Proskuryakov.
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.
3512 * WTF.xcodeproj/project.pbxproj:
3513 * wtf/spi/darwin/XPCSPI.h: Added.
3515 2014-10-01 Brent Fulgham <bfulgham@apple.com>
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>
3521 Reviewed by Michael Saboff.
3523 * wtf/Platform.h: Force the C loop when building for 32-bit Windows.
3525 2014-09-30 Christophe Dumez <cdumez@apple.com>
3527 Generalize is<>() / downcast<>() support to all types
3528 https://bugs.webkit.org/show_bug.cgi?id=137243
3530 Reviewed by Benjamin Poulain.
3532 Generalize is<>() / downcast<>() support to all types, not just Nodes.
3535 * wtf/TypeCasts.h: Added.
3539 2014-09-30 Anders Carlsson <andersca@apple.com>
3541 Get the STRING_STATS codepath compiling again, and add calls to ref/deref
3542 https://bugs.webkit.org/show_bug.cgi?id=137259
3544 Reviewed by Andreas Kling.
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.
3557 2014-09-30 Daniel Bates <dabates@apple.com>
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>
3563 Reviewed by Geoffrey Garen.
3565 Add SPI wrapper header, NSMapTableSPI.h.
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
3575 extern "C" const int x;
3577 when used in a C and C++ file, respectively.
3579 * WTF.xcodeproj/project.pbxproj:
3581 * wtf/spi/cocoa/NSMapTableSPI.h: Added.
3583 2014-09-29 Commit Queue <commit-queue@webkit.org>
3585 Unreviewed, rolling out r174045.
3586 https://bugs.webkit.org/show_bug.cgi?id=137231
3588 Introduced a crash during page loading tests on Mac (Requested
3589 by rniwa on #webkit).
3593 "Replace OSObjectPtr with RetainPtr/adoptOS"
3594 https://bugs.webkit.org/show_bug.cgi?id=137158
3595 http://trac.webkit.org/changeset/174045
3597 2014-09-26 Sam Weinig <sam@webkit.org>
3599 Replace OSObjectPtr with RetainPtr/adoptOS
3600 https://bugs.webkit.org/show_bug.cgi?id=137158
3602 Reviewed by Dan Bernstein.
3604 * WTF.xcodeproj/project.pbxproj:
3605 * wtf/OSObjectPtr.h: Removed.
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).
3614 2014-09-24 Filip Pizlo <fpizlo@apple.com>
3616 FTL should sink object allocations
3617 https://bugs.webkit.org/show_bug.cgi?id=136330
3619 Reviewed by Oliver Hunt.
3621 Make it possible to reset a Bag.
3628 2014-09-25 Roger Fong <roger_fong@apple.com>
3630 [Windows] Unreviewed build fix. Ensure that python2.7 is used for Windows builds.
3632 * WTF.vcxproj/WTFGenerated.make:
3634 2014-09-25 Csaba Osztrogonác <ossy@webkit.org>
3636 Remove WinCE port from trunk
3637 https://bugs.webkit.org/show_bug.cgi?id=136951
3639 Reviewed by Alex Christensen.
3642 * wtf/Assertions.cpp:
3645 (WTF::weakCompareAndSwap):
3646 * wtf/CurrentTime.cpp:
3647 (WTF::lowResUTCTime):
3650 (WTF::getLocalTime):
3651 (WTF::calculateDSTOffset):
3652 * wtf/FastMalloc.cpp:
3653 * wtf/FeatureDefines.h:
3654 * wtf/OSAllocator.h:
3655 (WTF::OSAllocator::decommitAndRelease):
3657 * wtf/PlatformWin.cmake:
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.
3672 * wtf/ThreadSpecific.h:
3673 * wtf/ThreadingWin.cpp:
3674 (WTF::createThreadInternal):
3675 * wtf/WindowsExtras.h:
3676 (WTF::getRegistryValue):
3677 (WTF::getWindowPointer):
3678 (WTF::setWindowPointer):
3680 * wtf/text/WTFString.cpp:
3681 (WTF::String::format):
3683 2014-09-24 Geoffrey Garen <ggaren@apple.com>
3686 https://bugs.webkit.org/show_bug.cgi?id=132629
3688 Reviewed by Gavin Barraclough.
3690 64-bit only for now, just to try it out.
3692 * wtf/FastMalloc.cpp:
3694 2014-09-23 Geoffrey Garen <ggaren@apple.com>
3698 bmalloc should honor the FastMalloc statistics API
3699 https://bugs.webkit.org/show_bug.cgi?id=136592
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
3706 * wtf/FastMalloc.cpp:
3707 (WTF::fastMallocStatistics):
3709 2014-09-23 Joseph Pecoraro <pecoraro@apple.com>
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
3714 Reviewed by Timothy Hatcher.
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.
3721 * wtf/Assertions.cpp:
3724 2014-09-22 Sam Weinig <sam@webkit.org>
3726 Eliminate redundant PtrHash specializations
3727 https://bugs.webkit.org/show_bug.cgi?id=136990
3729 Reviewed by Darin Adler.
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.
3735 No changes of behavior intended.
3738 Remove unnecessary const_cast that Darin noticed.
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.
3749 Remove include of GetPtr.h that is now included by HashFunctions.h
3752 (WTF::PtrHash<OwnPtr<P>>::hash): Deleted.
3753 (WTF::PtrHash<OwnPtr<P>>::equal): Deleted.
3754 Remove unnecessary specialization of PtrHash.
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).
3762 2014-09-20 Sam Weinig <sam@webkit.org>
3764 Make possible HashSet<std::unique_ptr<>>
3765 https://bugs.webkit.org/show_bug.cgi?id=136166
3767 Reviewed by Darin Adler.
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
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
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.
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().
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.
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
3805 Update for the less verbose GetPtrHelper specialization.
3807 2014-09-19 Chris Dumez <cdumez@apple.com>
3809 Allow DOM methods to return references instead of pointers
3810 https://bugs.webkit.org/show_bug.cgi?id=136931
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
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.
3824 Reviewed by Sam Weinig.
3829 (WTF::getPtr): Deleted.
3831 (WTF::getPtr): Deleted.
3833 (WTF::getPtr): Deleted.
3836 (WTF::getPtr): Deleted.
3837 * wtf/gobject/GRefPtr.h:
3838 (WTF::getPtr): Deleted.
3840 2014-09-19 Daniel Bates <dabates@apple.com>
3842 Always assume internal SDK when building configuration Production
3843 https://bugs.webkit.org/show_bug.cgi?id=136925
3844 <rdar://problem/18362399>
3846 Reviewed by Dan Bernstein.
3848 * Configurations/Base.xcconfig:
3850 2014-09-19 Diego Pino Garcia <dpino@igalia.com>
3852 Simple ES6 feature:String prototype additions
3853 https://bugs.webkit.org/show_bug.cgi?id=131704
3855 Reviewed by Darin Adler.
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):
3871 2014-09-18 Carlos Garcia Campos <cgarcia@igalia.com>
3873 [GTK] Dot not allow to create delete-on-destroy GMainLoopSources
3874 https://bugs.webkit.org/show_bug.cgi?id=136923
3876 Reviewed by Gustavo Noronha Silva.
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
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.
3902 2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
3904 Unreviewed rollout r173731. Broke multiple builds.
3906 * wtf/Assertions.cpp:
3909 2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
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
3914 Reviewed by Timothy Hatcher.
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.
3921 * wtf/Assertions.cpp:
3924 2014-09-18 Zan Dobersek <zdobersek@igalia.com>
3926 GMainLoopSource is exposed to race conditions
3927 https://bugs.webkit.org/show_bug.cgi?id=135800
3929 Reviewed by Carlos Garcia Campos.
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
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.
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.
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.
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.
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:
3981 2014-09-17 Daniel Bates <dabates@apple.com>
3983 Unreviewed, rolling out r173695.
3985 Broke building third-party Legacy WebKit apps; will
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
3994 2014-09-17 Benjamin Poulain <bpoulain@apple.com>
3996 CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc.
3997 https://bugs.webkit.org/show_bug.cgi?id=136807
3999 Reviewed by Antti Koivisto.
4001 * wtf/text/AtomicString.h:
4002 (WTF::AtomicString::find):
4004 2014-09-17 Daniel Bates <dabates@apple.com>
4006 [iOS] Make WebCore build with public iOS SDK
4007 https://bugs.webkit.org/show_bug.cgi?id=136487
4009 Reviewed by David Kilzer.
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:
4018 extern "C" const int x;
4020 when used in a C and C++ file, respectively.
4024 2014-09-16 Filip Pizlo <fpizlo@apple.com>
4026 Unreviewed, disable native inlining because it causes build failures.
4030 2014-09-15 Jer Noble <jer.noble@apple.com>
4032 [Mac] Support audioSourceProvider() in MediaPlayerPrivateAVFoundationObjC
4033 https://bugs.webkit.org/show_bug.cgi?id=135042
4035 Reviewed by Eric Carlson.
4037 * wtf/Platform.h: Add WTF_USE_MEDIATOOLBOX.
4039 2014-09-15 peavo@outlook.com <peavo@outlook.com>
4041 [WinCairo] Make it easier to enable/disable GStreamer.
4042 https://bugs.webkit.org/show_bug.cgi?id=135766
4044 Reviewed by Brent Fulgham.
4046 Make it possible to enable/disable GStreamer by editing the new user macro ENABLE_GSTREAMER_WINCAIRO.
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.
4052 2014-09-10 Jon Honeycutt <jhoneycutt@apple.com>
4054 Re-add the request autocomplete feature
4056 <https://bugs.webkit.org/show_bug.cgi?id=136730>
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
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
4066 Reviewed by Andy Estes.
4068 * wtf/FeatureDefines.h:
4070 2014-09-12 Tim Horton <timothy_horton@apple.com>
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>
4076 Reviewed by Darin Adler and Sam Weinig.
4079 (WTF::RunLoop::TimerBase::startRepeating):
4080 Add a std::chrono veresion of RunLoop::TimerBase::startRepeating.
4082 2014-09-12 Geoffrey Garen <ggaren@apple.com>
4086 It broke the Membuster performance bot, and it's still slightly profligate
4090 https://bugs.webkit.org/show_bug.cgi?id=132629
4092 * wtf/FastMalloc.cpp:
4094 2014-09-11 Geoffrey Garen <ggaren@apple.com>
4097 https://bugs.webkit.org/show_bug.cgi?id=132629
4099 Reviewed by Michael Saboff.
4101 64-bit only for now, just to try it out.
4103 * wtf/FastMalloc.cpp:
4105 2014-09-09 Benjamin Poulain <bpoulain@apple.com>
4107 Disable the "unreachable-code" warning
4108 https://bugs.webkit.org/show_bug.cgi?id=136677
4110 Reviewed by Darin Adler.
4112 The warning causes various build errors depending on which Clang you are using.
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.
4118 // Somethign for 64 bits.
4120 * Configurations/Base.xcconfig:
4122 2014-09-07 Filip Pizlo <fpizlo@apple.com>
4124 DFG should have a reusable SSA builder
4125 https://bugs.webkit.org/show_bug.cgi?id=136331
4127 Reviewed by Oliver Hunt.
4129 Update the alloc() method to use variadic templates. This makes it more natural to use.
4131 * wtf/SegmentedVector.h:
4132 (WTF::SegmentedVector::alloc):
4134 2014-09-08 Eva Balazsfalvi <evab.u-szeged@partner.samsung.com>
4137 https://bugs.webkit.org/show_bug.cgi?id=136571
4139 Reviewed by Darin Adler.
4141 * wtf/FeatureDefines.h:
4143 2014-09-08 Dan Bernstein <mitz@apple.com>
4145 HAVE(VOUCHERS) is not available outside of WebKit2
4146 https://bugs.webkit.org/show_bug.cgi?id=136637
4148 Reviewed by Tim Horton.
4150 * wtf/Platform.h: Moved the definition of HAVE_VOUCHERS from WebKit2’s config.h here.
4152 2014-09-08 Tim Horton <timothy_horton@apple.com>
4154 Try to fix the build after r173383, part 2.
4156 * wtf/OSObjectPtr.h:
4158 2014-09-08 Tim Horton <timothy_horton@apple.com>
4160 Try to fix the build after r173383.
4162 * wtf/OSObjectPtr.h:
4164 2014-09-07 Sam Weinig <sam@webkit.org>
4166 Make OSObjectPtr a bit more like RefPtr
4167 https://bugs.webkit.org/show_bug.cgi?id=136613
4169 Reviewed by Darin Adler.
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.
4176 * wtf/OSObjectPtr.h:
4177 (WTF::OSObjectPtr::operator=):
4178 (WTF::OSObjectPtr::swap):
4179 (WTF::OSObjectPtr::OSObjectPtr):
4181 2014-09-08 Jessie Berlin <jberlin@apple.com>
4183 More build fixes after r173374.
4185 * wtf/dtoa/strtod.cc:
4187 2014-09-08 Jessie Berlin <jberlin@apple.com>
4189 Build fix after r173374.
4191 * wtf/dtoa/strtod.cc:
4193 2014-09-08 Jessie Berlin <jberlin@apple.com>
4195 Speculative build fix after r173364.
4197 * wtf/dtoa/strtod.cc:
4199 2014-09-07 Maciej Stachowiak <mjs@apple.com>
4201 Introduce COMPILER_QUIRK(CONSIDERS_UNREACHABLE_CODE) and use it
4202 https://bugs.webkit.org/show_bug.cgi?id=136616
4204 Reviewed by Darin Adler.
4206 * wtf/Compiler.h: Define the quirk for all compilers but clang.
4208 2014-09-06 Sam Weinig <sam@webkit.org>
4210 XPCPtr should be converted into an all purpose smart pointer for os_objects
4211 https://bugs.webkit.org/show_bug.cgi?id=136602
4213 Reviewed by Darin Adler.
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.
4229 2014-09-06 Darin Adler <darin@apple.com>
4231 Make updates suggested by new version of Xcode
4232 https://bugs.webkit.org/show_bug.cgi?id=136603
4234 Reviewed by Mark Rowe.
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.
4240 * WTF.xcodeproj/project.pbxproj: Updated LastUpgradeCheck.
4242 2014-09-05 Geoffrey Garen <ggaren@apple.com>
4244 bmalloc should honor the FastMalloc statistics API
4245 https://bugs.webkit.org/show_bug.cgi?id=136592
4247 Reviewed by Gavin Barraclough.
4249 * wtf/FastMalloc.cpp:
4250 (WTF::fastMallocStatistics):
4252 2014-09-05 Geoffrey Garen <ggaren@apple.com>
4254 bmalloc should honor the FastMalloc scavenging API
4255 https://bugs.webkit.org/show_bug.cgi?id=136588
4257 Reviewed by Andreas Kling.
4259 * wtf/FastMalloc.cpp:
4260 (WTF::releaseFastMallocFreeMemory):
4262 2014-09-05 Geoffrey Garen <ggaren@apple.com>
4264 Rolled out <http://trac.webkit.org/changeset/173313>.
4266 It seems to have broken the PLT bot.
4269 https://bugs.webkit.org/show_bug.cgi?id=132629
4271 * wtf/FastMalloc.cpp:
4273 2014-06-06 Jer Noble <jer.noble@apple.com>
4275 Refactoring: make MediaTime the primary time type for audiovisual times.
4276 https://bugs.webkit.org/show_bug.cgi?id=133579
4278 Reviewed by Eric Carlson.
4280 Add a unary minus operator, and add unimplemented private casting operators, to make
4281 unintentional double->MediaTime and MediaTime->double casts hard errors.
4283 * wtf/MediaTime.cpp:
4284 (WTF::MediaTime::operator-):
4287 2014-09-04 Geoffrey Garen <ggaren@apple.com>
4290 https://bugs.webkit.org/show_bug.cgi?id=132629
4292 Reviewed by Michael Saboff.
4294 64-bit only for now, just to try it out.
4296 * wtf/FastMalloc.cpp:
4298 2014-09-05 Dániel Bátyai <dbatyai.u-szeged@partner.samsung.com>
4300 Enable GenGC on ARM Traditional
4301 https://bugs.webkit.org/show_bug.cgi?id=136567
4303 Reviewed by Csaba Osztrogonác.