1 2015-01-31 Commit Queue <commit-queue@webkit.org>
3 Unreviewed, rolling out r179426.
4 https://bugs.webkit.org/show_bug.cgi?id=141119
6 "caused a memory use regression" (Requested by Guest45 on
11 "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
13 https://bugs.webkit.org/show_bug.cgi?id=140900
14 http://trac.webkit.org/changeset/179426
16 2015-01-31 Commit Queue <commit-queue@webkit.org>
18 Unreviewed, rolling out r179408.
19 https://bugs.webkit.org/show_bug.cgi?id=141117
21 This didn't fully fix the issue (Requested by anttik on
26 "OSObjectPtr does not work with dispatch_data_t on Maverics"
27 https://bugs.webkit.org/show_bug.cgi?id=141081
28 http://trac.webkit.org/changeset/179408
30 2015-01-30 Yusuke Suzuki <utatane.tea@gmail.com>
33 https://bugs.webkit.org/show_bug.cgi?id=140435
35 Reviewed by Geoffrey Garen.
37 Introduce new unique string mechanizm into StringImpl.
38 It is used for implementing Symbol which holds a [[Description]] value.
40 * wtf/text/AtomicString.h:
41 (WTF::AtomicString::add):
42 (WTF::AtomicString::addWithStringTableProvider):
44 Previously, we checked `isAtomic()` or `!length()`. This guard can filter out EmptyUnique.
45 But now, we introduced new unique StringImpl. Since it has an actual string value, we need to check `isUnique()`.
47 * wtf/text/StringImpl.cpp:
48 (WTF::StringImpl::~StringImpl):
49 (WTF::StringImpl::createUnique):
51 In createUnique, we leverage Substring mechanizm to produce a new unique
52 string from an existing string.
54 * wtf/text/StringImpl.h:
55 (WTF::StringImpl::StringImpl):
56 (WTF::StringImpl::createUniqueEmpty):
57 (WTF::StringImpl::flagIsUnique):
58 (WTF::StringImpl::isUnique):
59 (WTF::StringImpl::setIsAtomic):
60 (WTF::StringImpl::createEmptyUnique): Deleted.
61 (WTF::StringImpl::isEmptyUnique): Deleted.
63 Instead of EmptyUnique, we introduced new flag to StringImpl, `isUnique`.
64 While EmptyUnique cannot hold any string values except for empty string,
65 the unique StringImpl can hold any String values.
66 We fold the Symbol's descriptiveString value here.
68 * wtf/text/StringStatics.cpp:
69 (WTF::StringImpl::hashAndFlagsForUnique):
70 (WTF::StringImpl::hashAndFlagsForEmptyUnique): Deleted.
72 2015-01-30 Geoffrey Garen <ggaren@apple.com>
74 Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
75 https://bugs.webkit.org/show_bug.cgi?id=140900
77 Reviewed by Mark Hahnenberg.
79 Re-landing just the HandleBlock piece of this patch.
82 (WTF::fastAlignedMalloc):
83 (WTF::fastAlignedFree):
84 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
87 2015-01-30 Namhoon Kim <yanhkim@gmail.com>
89 Call vsnprintf instead of _vsnprintf in vprintf_stderr_common
90 https://bugs.webkit.org/show_bug.cgi?id=141078
92 In windows _vsnprintf api does not place null character
93 automatically. Simply replace it with vsnprintf. Which is
94 polyfill to call wtf_vsnprintf in windows.
96 Reviewed by Brent Fulgham.
100 2015-01-30 Brian J. Burg <burg@cs.washington.edu>
102 Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
103 https://bugs.webkit.org/show_bug.cgi?id=141039
105 Reviewed by Timothy Hatcher.
107 Add messages to Stopwatch assertions, and clean up constructor.
110 (WTF::Stopwatch::Stopwatch):
111 (WTF::Stopwatch::start):
112 (WTF::Stopwatch::stop):
114 2015-01-30 Chris Dumez <cdumez@apple.com>
116 Add match_constness<Reference, T> helper struct
117 https://bugs.webkit.org/show_bug.cgi?id=140905
119 Reviewed by Benjamin Poulain.
121 Add match_constness<Reference, T> helper struct to simplify downcast<>()
122 a bit. The purpose of this helper is to update T's constness to match
128 2015-01-30 Chris Dumez <cdumez@apple.com>
130 Add assertion in RefPtr's operator*() to make sure we don't dereference nullptr
131 https://bugs.webkit.org/show_bug.cgi?id=141092
133 Reviewed by Anders Carlsson.
135 Add assertion in RefPtr's operator*() to make sure we don't dereference
139 (WTF::RefPtr::operator*):
141 2015-01-30 Geoffrey Garen <ggaren@apple.com>
143 GC marking threads should clear malloc caches
144 https://bugs.webkit.org/show_bug.cgi?id=141097
146 Reviewed by Andreas Kling.
148 Split the scavenging API into per-thread vs global, so that you can
149 request to scavenge your own thread without scavenging the whole heap.
151 * wtf/FastMalloc.cpp:
152 (WTF::releaseFastMallocFreeMemoryForThisThread):
153 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
156 2015-01-30 Antti Koivisto <antti@apple.com>
158 OSObjectPtr does not work with dispatch_data_t on Maverics
159 https://bugs.webkit.org/show_bug.cgi?id=141081
161 Reviewed by Pratik Solanki.
163 Trying to use OSObjectPtr<dispatch_data_t> throws
165 -[OS_dispatch_data _xref_dispose]: unrecognized selector sent to instance 0
168 (WTF::retainOSObject<dispatch_data_t>):
169 (WTF::releaseOSObject<dispatch_data_t>):
171 Add specialization for dispatch_data_t on Maverics.
173 2015-01-29 Santosh Mahto <santoshbit2007@gmail.com>
175 Refactor String::format to handle unreached va_end.
176 https://bugs.webkit.org/show_bug.cgi?id=140938
178 Reviewed by Alexey Proskuryakov.
180 Now va_end is called for all platform after getting length
181 of formatted string and again va_start/va_end is called to write
182 formatted string in buffer. This way it ensure va_end is always
183 reached for each va_start.
185 * wtf/text/WTFString.cpp:
187 2015-01-29 Csaba Osztrogonác <ossy@webkit.org>
189 Move HAVE_DTRACE definition back to Platform.h
190 https://bugs.webkit.org/show_bug.cgi?id=141033
192 Reviewed by Dan Bernstein.
196 2015-01-28 Namhoon Kim <namkim@ea.com>
198 Windows return -1 when calling vsnprintf with arguments that exceed target buffer size
199 https://bugs.webkit.org/show_bug.cgi?id=140917
201 Reviewed by Brent Fulgham.
203 Fix return value of vsnprintf when windows API return -1 to denote
204 requested buffer exceeded. Replace return value by calling vscprintf.
206 * wtf/StringExtras.h:
207 (snprintf): Fix return value by calling vscprintf when buffer exceeded.
208 (wtf_vsnprintf): Ditto.
210 2015-01-28 Geoffrey Garen <ggaren@apple.com>
212 Removed fastMallocForbid / fastMallocAllow
213 https://bugs.webkit.org/show_bug.cgi?id=141012
215 Reviewed by Mark Hahnenberg.
217 Removed the forbid / allow API because it is no longer used.
219 * wtf/FastMalloc.cpp:
220 (WTF::tryFastMalloc):
222 (WTF::tryFastCalloc):
225 (WTF::tryFastRealloc):
227 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
228 (WTF::isForbidden): Deleted.
229 (WTF::fastMallocForbid): Deleted.
230 (WTF::fastMallocAllow): Deleted.
231 (WTF::initializeIsForbiddenKey): Deleted.
234 2015-01-28 Dana Burkart <dburkart@apple.com>
236 Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
237 https://bugs.webkit.org/show_bug.cgi?id=136765
239 Reviewed by Alexey Proskuryakov.
241 * Configurations/Base.xcconfig:
242 * Configurations/DebugRelease.xcconfig:
244 2015-01-28 Darin Adler <darin@apple.com>
246 Fix small leak in Collator
247 https://bugs.webkit.org/show_bug.cgi?id=140990
249 Reviewed by Andreas Kling.
251 * wtf/unicode/icu/CollatorICU.cpp:
252 (WTF::Collator::Collator): Use fastStrDup instead of strdup.
253 (WTF::Collator::~Collator): Use fastFree on the collator locale that we
254 are abandoning. The old code instead just called free on a null pointer.
256 2015-01-27 Geoffrey Garen <ggaren@apple.com>
258 Removed WTF_MALLOC_VALIDATION
259 https://bugs.webkit.org/show_bug.cgi?id=140958
261 Reviewed by Anders Carlsson.
263 I don't think anyone has been using this, and the #ifdefs were driving
266 We have other options for validation -- like MallocGuardEdges,
267 MallocCheckHeapEach, MallocScribble, and GuardMalloc.
269 * wtf/FastMalloc.cpp:
270 (WTF::tryFastMalloc):
272 (WTF::tryFastCalloc):
275 (WTF::tryFastRealloc):
277 (WTF::fastMallocSize):
278 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
279 (WTF::Internal::fastMallocMatchFailed): Deleted.
281 (WTF::Internal::fastMallocValidationHeader): Deleted.
282 (WTF::Internal::fastMallocValidationSuffix): Deleted.
283 (WTF::Internal::fastMallocMatchValidationType): Deleted.
284 (WTF::Internal::setFastMallocMatchValidationType): Deleted.
285 (WTF::fastMallocMatchValidateMalloc): Deleted.
286 (WTF::fastMallocMatchValidateFree): Deleted.
287 (WTF::fastMallocValidate): Deleted.
289 2015-01-27 Commit Queue <commit-queue@webkit.org>
291 Unreviewed, rolling out r179192.
292 https://bugs.webkit.org/show_bug.cgi?id=140953
294 Caused numerous layout test failures (Requested by mattbaker_
299 "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
301 https://bugs.webkit.org/show_bug.cgi?id=140900
302 http://trac.webkit.org/changeset/179192
304 2015-01-26 Geoffrey Garen <ggaren@apple.com>
306 Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
307 https://bugs.webkit.org/show_bug.cgi?id=140900
309 Reviewed by Mark Hahnenberg.
311 New interface for aligned allocation: fastAlignedMalloc / fastAlignedFree.
312 We require a special function call on free because Windows.
314 * wtf/FastMalloc.cpp:
315 (WTF::fastAlignedMalloc):
316 (WTF::fastAlignedFree): Do it.
318 (WTF::do_memalign): Un-ifdef this, since we use it now.
320 * wtf/FastMalloc.h: Make our new function names visible like the rest
323 2015-01-26 Brent Fulgham <bfulgham@apple.com>
325 [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
326 https://bugs.webkit.org/show_bug.cgi?id=87426
327 <rdar://problem/11527899>
329 Reviewed by Darin Adler.
331 Revise internal containers to use std::addressof in preference to
332 to using the '&' operator.
335 (WTF::inlineCapacity>::append):
336 (WTF::inlineCapacity>::prepend):
337 (WTF::inlineCapacity>::removeFirst):
338 (WTF::inlineCapacity>::removeLast):
339 (WTF::inlineCapacity>::remove):
340 (WTF::inlineCapacity>::after):
341 (WTF::inlineCapacity>::before):
344 (WTF::HashTableBucketInitializer<false>::initialize):
346 (WTF::SimpleClassHashTraits::constructDeletedValue):
347 (WTF::CustomHashTraits::constructDeletedValue):
349 (WTF::ListHashSetConstIterator::get):
352 (WTF::OverflowHandler>::append):
353 (WTF::OverflowHandler>::tryAppend):
354 (WTF::OverflowHandler>::insert):
356 2015-01-24 Chris Dumez <cdumez@apple.com>
358 Provide implementation for WTF::DefaultHash<bool>
359 https://bugs.webkit.org/show_bug.cgi?id=140848
361 Reviewed by Anders Carlsson.
363 Provide implementation for WTF::DefaultHash<bool> so that we can use
364 HashMap<std::pair<XXX, bool>> in the code base. Right now, we need to
365 use some integer type to work around the issue.
367 * wtf/HashFunctions.h:
369 2015-01-23 Carlos Garcia Campos <cgarcia@igalia.com>
371 [GTK] Add missing null check in some derefGPtr implementations
372 https://bugs.webkit.org/show_bug.cgi?id=140822
374 Reviewed by Sergio Villar Senin.
376 It's missing in GHashTable and GVariant implementations.
378 * wtf/gobject/GRefPtr.cpp:
381 2015-01-23 Carlos Garcia Campos <cgarcia@igalia.com>
383 [GTK] Add initial database process support
384 https://bugs.webkit.org/show_bug.cgi?id=139491
386 Reviewed by Sergio Villar Senin.
388 Add support for using GRefPtr with GVariantBuilder.
390 * wtf/gobject/GRefPtr.cpp:
393 * wtf/gobject/GRefPtr.h:
394 * wtf/gobject/GTypedefs.h:
396 2015-01-22 Ryosuke Niwa <rniwa@webkit.org>
398 Add a build flag for ES6 class syntax
399 https://bugs.webkit.org/show_bug.cgi?id=140760
401 Reviewed by Michael Saboff.
403 * wtf/FeatureDefines.h:
405 2015-01-21 Csaba Osztrogonác <ossy@webkit.org>
407 Remove ENABLE(INSPECTOR) ifdef guards
408 https://bugs.webkit.org/show_bug.cgi?id=140668
410 Reviewed by Darin Adler.
412 * wtf/FeatureDefines.h:
414 2015-01-20 YunQiang Su <wzssyqa@gmail.com>
416 Fix failed to build for Linux/MIPS64EL
417 https://bugs.webkit.org/show_bug.cgi?id=124370
419 Reviewed by Darin Adler.
421 Add MIPS64EL support.
426 2015-01-19 Alexey Proskuryakov <ap@apple.com>
428 Make ASan do bounds checks for WTF::Vector
429 https://bugs.webkit.org/show_bug.cgi?id=140631
430 rdar://problem/19437718
432 Reviewed by Darin Adler.
434 * wtf/SizeLimits.cpp: Disable Vector object size checks for ASan enabled builds.
437 (WTF::VectorBuffer::endOfBuffer):
438 (WTF::Vector::Vector):
439 (WTF::Vector::~Vector):
441 (WTF::OverflowHandler>::Vector):
443 (WTF::OverflowHandler>::fill):
444 (WTF::OverflowHandler>::resize):
445 (WTF::OverflowHandler>::shrink):
446 (WTF::OverflowHandler>::grow):
447 (WTF::OverflowHandler>::asanSetInitialBufferSizeTo):
448 (WTF::OverflowHandler>::asanSetBufferSizeToFullCapacity):
449 (WTF::OverflowHandler>::asanBufferSizeWillChangeTo):
450 (WTF::OverflowHandler>::reserveCapacity):
451 (WTF::OverflowHandler>::tryReserveCapacity):
452 (WTF::OverflowHandler>::shrinkCapacity):
453 (WTF::OverflowHandler>::append):
454 (WTF::OverflowHandler>::tryAppend):
455 (WTF::OverflowHandler>::appendSlowCase):
456 (WTF::OverflowHandler>::uncheckedAppend):
457 (WTF::OverflowHandler>::insert):
458 (WTF::OverflowHandler>::remove):
459 (WTF::OverflowHandler>::releaseBuffer):
461 * wtf/Compiler.h: Changed ASAN_ENABLED macro fallback value from false to 0,
462 MSVC was not happy with false.
464 2015-01-20 Csaba Osztrogonác <ossy@webkit.org>
466 Remove non-Windows cruft from WebKit/win/Plugins
467 https://bugs.webkit.org/show_bug.cgi?id=140675
469 Reviewed by Anders Carlsson.
471 * wtf/FeatureDefines.h:
473 2015-01-16 Myles C. Maxfield <mmaxfield@apple.com>
475 WeakPtr functions crash when created with default constructor
476 https://bugs.webkit.org/show_bug.cgi?id=140479
478 Reviewed by Andreas Kling.
480 This patch rearranges how WeakPtr works, and has the following ideas behind it:
482 1. WeakPtr should use Ref internally. This solves the crash by always having a
484 2. Clients should not be able to construct WeakReferences directly. Instead,
485 only WeakPtrFactory (and WeakPtr's default constructor) should be able to
486 construct them. They are considered an implementation detail of WeakPtr.
487 3. Except for the default constructor, clients should not be able to construct
488 WeakPtrs directly. Instead, the WeakPtrFactory must construct them. This
489 guarantees that the WeakPtrs all reference the same WeakReference.
490 4. Clients can construct a WeakPtr using its default constructor, and then
491 use the assignment operator to make it non-null. (Or they could use
492 WeakPtrFactory to make it non-null at creation-time.)
493 5. No one was using WeakReference::bindTo(), and it doesn't seem useful, so I
496 Tests: WTF_WeakPtr API tests
499 (WTF::Ref::Ref): Added extra ASSERT()s, and explicitly deleted copy
500 constructors with a comment.
501 (WTF::Ref::operator=): Added extra ASSERT()s, and explicitly deleted copy
502 assignment operators with a comment.
504 (WTF::WeakReference::clear): Used nullptr.
505 (WTF::WeakReference::create): Moved to private:
506 (WTF::WeakPtr::WeakPtr): For the default constructor, initialized the Ref with
507 a new WeakReference. For the other constructor, moved it to private:. Also added
508 copy constructors and copy assignment operators (since Ref doesn't have them but
509 RefPtr does). These constructors/operators are relied upon in various places
511 (WTF::WeakPtr::operator bool): Made non-explicit.
512 (WTF::WeakReference::createUnbound): Deleted.
513 (WTF::WeakReference::bindTo): Deleted.
514 (WTF::WeakReference::WeakReference): Deleted.
515 (WTF::WeakPtrFactory::WeakPtrFactory): Deleted.
517 2015-01-16 Yusuke Suzuki <utatane.tea@gmail.com>
519 std::all_of requires complete C++ iterators in GCC 4.8
520 https://bugs.webkit.org/show_bug.cgi?id=140530
522 Reviewed by Darin Adler.
524 In the WebKit2/UIProcess/WebProcessLifetimeObserver.cpp, std::all_of
525 is used for HashIterators. However, std::all_of requires the complete
526 C++ iterator interface including iterator_category typedef member and
527 it raises compile error in GCC 4.8 (and libstdc++) environment.
529 This patch inherits std::iterator with appropriate type parameters.
530 It automatically defines required typedefs including iterator_category.
532 * wtf/HashIterators.h:
534 2015-01-15 Csaba Osztrogonác <ossy@webkit.org>
536 Remove ENABLE(SQL_DATABASE) guards
537 https://bugs.webkit.org/show_bug.cgi?id=140434
539 Reviewed by Darin Adler.
541 * wtf/FeatureDefines.h:
543 2015-01-14 Csaba Osztrogonác <ossy@webkit.org>
545 Unreviewed fix after r163330.
547 * wtf/Platform.h: Use C style comment.
549 2015-01-14 Marc Juul <juul@sudomesh.org>
551 C++ style comment was preventing compile if CPU(ARM_NEON)
552 https://bugs.webkit.org/show_bug.cgi?id=133827
554 Reviewed by Csaba Osztrogonác.
558 2015-01-13 Chris Dumez <cdumez@apple.com>
560 Make WTF::Optional work with msvc 2013
561 https://bugs.webkit.org/show_bug.cgi?id=140401
563 Reviewed by Anders Carlsson.
565 Update the WTF::Optional implementation to use std::aligned_memory and
566 placement new instead of an unrestricted union because msvc 2013 still
567 doesn't support unrestricted unions.
569 This change is a pre-requirement to fix Bug 140347 as this change uses
570 WTF::Optional with types that have non-trivial copy constructors.
572 This change is covered by the existing Optional WTF test.
576 2015-01-11 Sam Weinig <sam@webkit.org>
578 Remove support for SharedWorkers
579 https://bugs.webkit.org/show_bug.cgi?id=140344
581 Reviewed by Anders Carlsson.
583 * wtf/FeatureDefines.h:
585 2015-01-12 Darin Adler <darin@apple.com>
587 Modernize and streamline HTMLTokenizer
588 https://bugs.webkit.org/show_bug.cgi?id=140166
590 Reviewed by Sam Weinig.
592 * wtf/Forward.h: Removed PassRef, added OrdinalNumber and TextPosition.
594 2015-01-09 Commit Queue <commit-queue@webkit.org>
596 Unreviewed, rolling out r178154, r178163, and r178164.
597 https://bugs.webkit.org/show_bug.cgi?id=140292
599 Still multiple assertion failures on tests (Requested by ap on
604 "Modernize and streamline HTMLTokenizer"
605 https://bugs.webkit.org/show_bug.cgi?id=140166
606 http://trac.webkit.org/changeset/178154
608 "Unreviewed speculative buildfix after r178154."
609 http://trac.webkit.org/changeset/178163
611 "One more unreviewed speculative buildfix after r178154."
612 http://trac.webkit.org/changeset/178164
614 2015-01-08 Darin Adler <darin@apple.com>
616 Modernize and streamline HTMLTokenizer
617 https://bugs.webkit.org/show_bug.cgi?id=140166
619 Reviewed by Sam Weinig.
621 * wtf/Forward.h: Removed PassRef, added OrdinalNumber and TextPosition.
623 2015-01-08 Benjamin Poulain <benjamin@webkit.org>
625 [WK2] Start a prototype for declarative site specific extensions
626 https://bugs.webkit.org/show_bug.cgi?id=140160
628 Reviewed by Andreas Kling.
630 * wtf/FeatureDefines.h:
632 2015-01-07 Daniel Bates <dabates@apple.com>
634 [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
635 https://bugs.webkit.org/show_bug.cgi?id=137371
637 As pointed out by Tim Horton, use C-style comment instead of C++-style comment as
638 wtf/Compiler.h is included in the sandbox profile and the sandbox profile compiler
639 doesn't understand C++-style comments.
643 2015-01-07 Daniel Bates <dabates@apple.com>
645 [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
646 https://bugs.webkit.org/show_bug.cgi?id=137371
648 Reviewed by David Kilzer.
650 Move EXTERN_C_BEGIN and EXTERN_C_END macros from file WebKit2/config.h to here and
651 rename them to WTF_EXTERN_C_BEGIN and WTF_EXTERN_C_END, respectively, so that we
652 can make use of these macros in SPI wrapper headers (e.g. UIKitSPI.h).
654 I'll look to transition existing code to WTF_EXTERN_C_BEGIN/WTF_EXTERN_C_END and
655 remove EXTERN_C in a subsequent commit(s).
659 2015-01-07 Commit Queue <commit-queue@webkit.org>
661 Unreviewed, rolling out r178068.
662 https://bugs.webkit.org/show_bug.cgi?id=140235
664 Breaks the iOS build (Requested by enrica on #webkit).
668 "[iOS] Make WebKit2 build with public iOS SDK and more build
670 https://bugs.webkit.org/show_bug.cgi?id=137371
671 http://trac.webkit.org/changeset/178068
673 2015-01-07 Daniel Bates <dabates@apple.com>
675 [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
676 https://bugs.webkit.org/show_bug.cgi?id=137371
678 Reviewed by David Kilzer.
680 Move EXTERN_C_BEGIN and EXTERN_C_END macros from file WebKit2/config.h to here and
681 rename them to WTF_EXTERN_C_BEGIN and WTF_EXTERN_C_END, respectively, so that we
682 can make use of these macros in SPI wrapper headers (e.g. UIKitSPI.h).
684 I'll look to transition existing code to WTF_EXTERN_C_BEGIN/WTF_EXTERN_C_END and
685 remove EXTERN_C in a subsequent commit(s).
689 2015-01-07 Brian J. Burg <burg@cs.washington.edu>
691 Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
692 https://bugs.webkit.org/show_bug.cgi?id=140053
694 Reviewed by Andreas Kling.
697 (WTF::Stopwatch::create): Return a Ref.
699 2015-01-07 Commit Queue <commit-queue@webkit.org>
701 Unreviewed, rolling out r178039.
702 https://bugs.webkit.org/show_bug.cgi?id=140187
704 Breaks ObjC Inspector Protocol (Requested by JoePeck on
709 "Web Inspector: purge PassRefPtr from Inspector code and use
710 Ref for typed and untyped protocol objects"
711 https://bugs.webkit.org/show_bug.cgi?id=140053
712 http://trac.webkit.org/changeset/178039
714 2015-01-06 Brian J. Burg <burg@cs.washington.edu>
716 Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
717 https://bugs.webkit.org/show_bug.cgi?id=140053
719 Reviewed by Andreas Kling.
722 (WTF::Stopwatch::create): Return a Ref.
724 2015-01-06 Alexey Proskuryakov <ap@apple.com>
726 ADDRESS_SANITIZER macro is overloaded
727 https://bugs.webkit.org/show_bug.cgi?id=140130
729 Reviewed by Anders Carlsson.
731 * wtf/Compiler.h: Added an ASAN_ENABLED macro. The abbreviation should become well
732 known - we already use it in tools.
736 * wtf/SizeLimits.cpp:
737 Change the conditional to ENABLE(SECURITY_ASSERTIONS). These checks will be used
738 in debug builds, and also when one explicitly passes -DENABLE_SECURITY_ASSERTIONS.
740 2015-01-05 Andreas Kling <akling@apple.com>
742 Purge PassRefPtr from Page.
743 <https://webkit.org/b/140089>
745 Reviewed by Anders Carlsson.
747 Make SchedulePair::create() return Ref since it never fails.
749 * wtf/SchedulePair.h:
750 (WTF::SchedulePair::create):
752 2015-01-01 Darin Adler <darin@apple.com>
754 Rework code that hides characters in password fields to streamline a little
755 https://bugs.webkit.org/show_bug.cgi?id=140035
757 Reviewed by Sam Weinig.
759 * wtf/text/StringImpl.cpp:
760 (WTF::StringImpl::fill): Deleted.
761 * wtf/text/StringImpl.h: Deleted StringImpl::fill.
762 * wtf/text/WTFString.h:
763 (WTF::String::fill): Deleted.
765 2014-12-26 Dan Bernstein <mitz@apple.com>
769 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>.
771 * wtf/SaturatedArithmetic.h:
772 (signedAddOverflows):
773 (signedSubtractOverflows):
775 2014-12-26 Dan Bernstein <mitz@apple.com>
777 <rdar://problem/19348208> REGRESSION (r177027): iOS builds use the wrong toolchain
778 https://bugs.webkit.org/show_bug.cgi?id=139950
780 Reviewed by David Kilzer.
782 * Configurations/Base.xcconfig: Only define TOOLCHAINS when building for OS X, doing so
783 in a manner that works with Xcode 5.1.1.
785 2014-12-25 Dan Bernstein <mitz@apple.com>
787 Try to fix the Windows build after r177733.
791 2014-12-25 Alexey Proskuryakov <ap@apple.com>
793 Simplify saturated integer add/sub
794 https://bugs.webkit.org/show_bug.cgi?id=139854
796 Address Darin's post-commit feedback to fix API tests.
798 * wtf/SaturatedArithmetic.h: (saturatedSubtraction):
800 2014-12-24 Benjamin Poulain <benjamin@webkit.org>
802 Simplify saturated integer add/sub
803 https://bugs.webkit.org/show_bug.cgi?id=139854
805 Reviewed by Darin Adler.
808 Make a wrapper for __has_builtin for compilers that do not support it.
810 * wtf/SaturatedArithmetic.h:
812 (saturatedSubtraction):
813 Use the builtins when possible instead of reinventing the wheel.
814 On ARMv7, use the saturated math instructions.
816 2014-12-23 Anders Carlsson <andersca@apple.com>
818 Move dynamic_objc_cast to RetainPtr.h
819 https://bugs.webkit.org/show_bug.cgi?id=139915
821 Reviewed by Sam Weinig.
824 (WTF::dynamic_objc_cast):
826 2014-12-23 Anders Carlsson <andersca@apple.com>
828 Re-indent RefPtr.h and RetainPtr.h.
830 Rubber-stamped by Sam Weinig.
835 2014-12-20 Eric Carlson <eric.carlson@apple.com>
837 [iOS] add optimized fullscreen API
838 https://bugs.webkit.org/show_bug.cgi?id=139833
839 <rdar://problem/18844486>
841 Reviewed by Simon Fraser.
843 * wtf/Platform.h: Define ENABLE_VIDEO_PRESENTATION_MODE.
845 2014-12-18 Gyuyoung Kim <gyuyoung.kim@samsung.com>
847 Fix build break on EFL and GTK since r177523
848 https://bugs.webkit.org/show_bug.cgi?id=139805
850 Reviewed by Csaba Osztrogonác.
852 * wtf/Ref.h: Include <wtf/StdLibExtras.h> to use std::exchange().
854 2014-12-18 Gavin Barraclough <barraclough@apple.com>
856 Add strong typing to RefCounter interface, return value as a bool.
857 https://bugs.webkit.org/show_bug.cgi?id=139776
859 Unreviewed style fixes.
864 2014-12-18 Brent Fulgham <bfulgham@apple.com>
866 [Win] Build correction after r177541.
869 (WTF::RefCounter::Token<T>::Token): Revise constructor inlines to correct
872 2014-12-18 Gavin Barraclough <barraclough@apple.com>
874 Add strong typing to RefCounter interface, return value as a bool.
875 https://bugs.webkit.org/show_bug.cgi?id=139776
877 Reviewed by Geoff Garen.
879 Currently all token vended by a RefCounter have the same type - Ref<RefCounter::Count>.
880 This means there is no compile time type checking to prevent mistakes. Update the count()
881 method to token<>(), templated on type used to identify the token being returned.
882 Calls to token<T>() will return a result of type RefCounter::Token<T>.
884 There are a few problems with the fact the counter will return you an exact count of the
885 number of outstanding tokens:
886 - It is desirable to only fire the callback on zero-edge changes; it is more consistent
887 to do so if the value is only readable as a boolean.
888 - It is desirable to provide the value as an argument to the callback, however to make
889 this useful for integer values it is also necessary to indicate the direction of change
890 (0->1 is often interesting where 2->1 is not).
891 - There is a mismatch between the precision of returning a count, and the inherent
892 imprecision of a token based mechanism, where it may be difficult to guarantee
893 absolutely no unnecessary refcount churn, and thus unintentional counter values.
895 * wtf/RefCounter.cpp:
896 (WTF::RefCounter::Count::ref):
897 (WTF::RefCounter::Count::deref):
898 - only call the callback on zero-edge changes; provide the value.
899 (WTF::RefCounter::RefCounter):
900 - callback now takes a bool argument.
902 (WTF::RefCounter::Token::Token):
903 - New opaque type to reference the RefCounter::Count.
904 (WTF::RefCounter::Token::operator!):
905 - ! operator checks for null / anasigned Tokens.
906 (WTF::RefCounter::RefCounter):
907 - callback now takes a bool argument.
908 (WTF::RefCounter::token):
909 - renamed from count(), templated on type of token returned.
910 (WTF::RefCounter::value):
911 - now returns a bool.
912 (WTF::RefCounter::Token<T>::Token):
914 - Tokens can be copied & assigned.
915 (WTF::RefCounter::count): Deleted.
916 - renamed to token<>().
918 2014-12-18 Anders Carlsson <andersca@apple.com>
920 Simplify smart pointer classes by using std::exchange
921 https://bugs.webkit.org/show_bug.cgi?id=139790
923 Reviewed by Andreas Kling.
928 (WTF::OwnPtr<T>::clear):
929 (WTF::OwnPtr<T>::release):
930 (WTF::OwnPtr<T>::leakPtr):
933 (WTF::PassOwnPtr<T>::leakPtr):
935 (WTF::PassRefPtr<T>::leakRef):
938 (WTF::RefPtr<T>::clear):
939 (WTF::RefPtr<T>::leakRef):
941 (WTF::RetainPtr<T>::leakRef):
943 2014-12-18 Anders Carlsson <andersca@apple.com>
945 Clean up MachSendRight and add a copySendRight member function
946 https://bugs.webkit.org/show_bug.cgi?id=139788
948 Reviewed by Tim Horton.
950 * wtf/StdLibExtras.h:
952 Add an implementation of std::exchange.
954 2014-12-17 Chris Dumez <cdumez@apple.com>
956 [iOS] Make it possible to toggle FeatureCounter support at runtime
957 https://bugs.webkit.org/show_bug.cgi?id=139688
958 <rdar://problem/19266254>
960 Reviewed by Andreas Kling.
962 Remove FeatureCounter API from WTF and move it to WebCore/platform
963 instead so that it can log conditionally based on a WebCore setting.
965 * WTF.vcxproj/WTF.vcxproj:
966 * WTF.xcodeproj/project.pbxproj:
967 * wtf/CMakeLists.txt:
969 2014-12-17 Brent Fulgham <bfulgham@apple.com>
971 [Win] Correct DebugSuffix builds under MSBuild
972 https://bugs.webkit.org/show_bug.cgi?id=139733
973 <rdar://problem/19276880>
975 Reviewed by Simon Fraser.
977 * WTF.vcxproj/WTF.proj: Make sure to use the '_debug' suffix
978 when building the DebugSuffix target.
980 2014-12-17 Anders Carlsson <andersca@apple.com>
982 Make Ref::copyRef const and ref-qualified
983 https://bugs.webkit.org/show_bug.cgi?id=139730
985 Reviewed by Andreas Kling.
989 2014-12-16 Daniel Bates <dabates@apple.com>
991 [iOS] WTF fails to build with public SDK due to missing header CPAggregateDictionary.h
992 https://bugs.webkit.org/show_bug.cgi?id=139695
994 Reviewed by Chris Dumez.
996 Add USE(APPLE_INTERNAL_SDK)-guard around iOS-specific feature counter implementation
997 as we are only interested in counting features in builds of iOS WebKit that were built
998 with the Apple Internal SDK.
1000 * wtf/FeatureCounter.cpp:
1001 * wtf/ios/FeatureCounter.mm:
1003 2014-12-16 Geoffrey Garen <ggaren@apple.com>
1005 Enable FastMalloc in debug builds
1006 https://bugs.webkit.org/show_bug.cgi?id=139692
1008 Reviewed by Alexey Proskuryakov.
1010 This will give debug builds greater fidelity to the real thing.
1012 FastMalloc now transparently supports all the malloc debugging APIs I
1013 know of by disabling itself at runtime -- and it should be easy to add
1014 support for any APIs I missed -- so there's no need to turn it off in
1017 * wtf/FastMalloc.cpp:
1019 2014-12-16 Anders Carlsson <andersca@apple.com>
1021 RefPtr::copyRef should be const
1022 https://bugs.webkit.org/show_bug.cgi?id=139689
1024 Reviewed by Andreas Kling.
1026 copyRef() doesn't modify the original object so it should be const.
1027 Also, add a && qualified overload and mark it deleted so that calls to copyRef() where
1028 the object is an rvalue will fail to compile.
1032 2014-12-15 Chris Dumez <cdumez@apple.com>
1034 [iOS] Add feature counting support
1035 https://bugs.webkit.org/show_bug.cgi?id=139652
1036 <rdar://problem/19255690>
1038 Reviewed by Gavin Barraclough.
1040 Add a FeatureCounter API for to log / count when a feature
1041 is used. For now, this is only implementated on iOS.
1043 * WTF.vcxproj/WTF.vcxproj:
1044 * WTF.xcodeproj/project.pbxproj:
1045 * wtf/CMakeLists.txt:
1046 * wtf/FeatureCounter.cpp: Added.
1047 (WTF::incrementFeatureCounterKey):
1048 (WTF::setFeatureCounterKey):
1049 * wtf/FeatureCounter.h: Added.
1050 * wtf/ios/FeatureCounter.mm: Added.
1051 (WTF::incrementFeatureCounterKey):
1052 (WTF::setFeatureCounterKey):
1054 2014-12-12 Anders Carlsson <andersca@apple.com>
1056 Get rid of the DONT_FINALIZE_ON_MAIN_THREAD #define
1057 https://bugs.webkit.org/show_bug.cgi?id=139613
1059 Reviewed by Sam Weinig.
1064 2014-12-15 Commit Queue <commit-queue@webkit.org>
1066 Unreviewed, rolling out r177284.
1067 https://bugs.webkit.org/show_bug.cgi?id=139658
1069 "Breaks API tests and LayoutTests on Yosemite Debug"
1070 (Requested by msaboff on #webkit).
1074 "Make sure range based iteration of Vector<> still receives
1076 https://bugs.webkit.org/show_bug.cgi?id=138821
1077 http://trac.webkit.org/changeset/177284
1079 2014-12-15 Andreas Kling <akling@apple.com>
1081 Purge PassRefPtr from FocusEvent code.
1082 <https://webkit.org/b/139647>
1084 Reviewed by Anders Carlsson.
1086 Add a RefPtr::copyRef() to use when passing a RefPtr to a RefPtr&& without
1087 transferring the ownership.
1091 2014-12-15 Oliver Hunt <oliver@apple.com>
1093 Make sure range based iteration of Vector<> still receives bounds checking
1094 https://bugs.webkit.org/show_bug.cgi?id=138821
1096 Reviewed by Mark Lam.
1098 Add a new IndexedIterator struct to WTF that wraps a
1099 Vector type and index to provide pointer like semantics
1100 while still performing runtime bounds checking, even in
1101 release builds. We store a simple index into the vector
1102 which means that this iterator allows vector resizing
1103 during iteration. If the vector is resized such that the
1104 iterator is out of bounds, then any attempt to dereference
1105 the iterator will crash safely.
1107 For the purpose of retaining semantically equivalent
1108 behaviour, the iterator can be moved to m_index == size()
1109 as that is the standard "end" terminator for these types.
1110 Attempting to dereference at that point will still crash
1111 rather than perform an unsafe memory operation.
1113 By necessity there are many overrides for operator + and - as
1114 we otherwise hit many different type promotion ambiguities when
1115 performing arithmetic with iterators. These ambiguities are also
1116 different for 32- vs. 64-bit, so duplicating the functions
1117 and then forwarding to the core implementations that performed
1118 the bounds checking and mutation seemed like the right call.
1120 * WTF.vcxproj/WTF.vcxproj:
1121 * WTF.vcxproj/WTF.vcxproj.filters:
1122 * WTF.xcodeproj/project.pbxproj:
1123 * wtf/IndexedIterator.h: Added.
1124 (WTF::IndexedIterator::IndexedIterator):
1125 (WTF::IndexedIterator::operator->):
1126 (WTF::IndexedIterator::operator*):
1127 (WTF::IndexedIterator::get):
1128 (WTF::IndexedIterator::operator++):
1129 (WTF::IndexedIterator::operator--):
1130 (WTF::IndexedIterator::operator UnspecifiedBoolType):
1131 (WTF::IndexedIterator::operator-):
1132 (WTF::IndexedIterator::operator=):
1133 (WTF::IndexedIterator::operator==):
1134 (WTF::IndexedIterator::operator!=):
1135 (WTF::IndexedIterator::operator<):
1136 (WTF::IndexedIterator::operator<=):
1137 (WTF::IndexedIterator::operator>):
1138 (WTF::IndexedIterator::operator>=):
1139 (WTF::IndexedIterator::operator const_iterator):
1140 (WTF::IndexedIterator::unsafeGet):
1149 (WTF::IndexedIteratorSelector::makeIterator):
1150 (WTF::IndexedIteratorSelector::makeConstIterator):
1151 * wtf/RefCountedArray.h:
1152 (WTF::RefCountedArray::RefCountedArray):
1154 (WTF::Vector::Vector):
1155 (WTF::Vector::begin):
1157 (WTF::OverflowHandler>::Vector):
1159 (WTF::OverflowHandler>::fill):
1160 (WTF::OverflowHandler>::expandCapacity):
1161 (WTF::OverflowHandler>::tryExpandCapacity):
1162 (WTF::OverflowHandler>::resize):
1163 (WTF::OverflowHandler>::shrink):
1164 (WTF::OverflowHandler>::grow):
1165 (WTF::OverflowHandler>::reserveCapacity):
1166 (WTF::OverflowHandler>::tryReserveCapacity):
1167 (WTF::OverflowHandler>::shrinkCapacity):
1168 (WTF::OverflowHandler>::append):
1169 (WTF::OverflowHandler>::tryAppend):
1170 (WTF::OverflowHandler>::appendSlowCase):
1171 (WTF::OverflowHandler>::uncheckedAppend):
1172 (WTF::OverflowHandler>::appendVector):
1173 (WTF::OverflowHandler>::insert):
1174 (WTF::OverflowHandler>::insertVector):
1175 (WTF::OverflowHandler>::remove):
1177 2014-12-14 Andreas Kling <akling@apple.com>
1179 Minor follow-up tweaks suggested by Darin on bug 139587.
1181 * wtf/text/WTFString.h:
1182 (WTF::String::String):
1184 2014-12-14 Andreas Kling <akling@apple.com>
1186 Replace PassRef with Ref/Ref&& across the board.
1187 <https://webkit.org/b/139587>
1189 Reviewed by Darin Adler.
1191 Kill the PassRef class and replace it by Ref/Ref&&.
1194 - For locals and members, keep using Ref<T>.
1195 - For return types, use Ref<T>.
1196 - For (ownership-transferring) arguments, use Ref<T>&&.
1198 When passing to a Ref&&, use WTF::move() to mobilize the value
1199 at the call site, e.g:
1201 void myFunction(Ref<Foo>&&);
1203 Ref<Foo> myFoo(Foo::create());
1204 myFunction(WTF::move(myFoo));
1205 // 'myFoo' is invalid from this point forward.
1207 As you can see, it works a lot like PassRefPtr, but unlike PassRefPtr
1208 it won't surprise you by becoming null *unless* you WTF::move it.
1210 I've also added a Ref::copyRef() for instances where you want to
1211 return a Ref *without* transferring ownership, e.g code like:
1213 Ref<Foo> foo() { return m_foo; }
1217 Ref<Foo> foo() { return m_foo.copyRef(); }
1219 This makes it explicit that a refcount bump will occur.
1221 Finally, do note that unlike last year's PassRef, Ref&& does not
1222 require you to move it to avoid leaking; it will clean itself up.
1225 (WTF::adopted): Deleted.
1226 (WTF::PassRef<T>::PassRef): Deleted.
1227 (WTF::PassRef<T>::~PassRef): Deleted.
1228 (WTF::PassRef<T>::get): Deleted.
1229 (WTF::PassRef<T>::ptr): Deleted.
1230 (WTF::PassRef<T>::leakRef): Deleted.
1231 (WTF::adoptRef): Deleted.
1232 (WTF::createRefCounted): Deleted.
1234 (WTF::PassRefPtr::PassRefPtr):
1239 (WTF::Ref::operator=):
1240 (WTF::Ref::operator->):
1243 (WTF::Ref::operator T&):
1244 (WTF::Ref::operator const T&):
1245 (WTF::Ref<T>::replace):
1248 (WTF::RefCounter::count):
1250 (WTF::RefPtr::releaseNonNull):
1251 (WTF::RefPtr<T>::RefPtr):
1253 * wtf/text/AtomicString.cpp:
1254 (WTF::addToStringTable):
1255 (WTF::AtomicString::add):
1256 (WTF::AtomicString::addFromLiteralData):
1257 (WTF::AtomicString::addSlowCase):
1258 * wtf/text/AtomicString.h:
1259 * wtf/text/StringImpl.cpp:
1260 (WTF::StringImpl::createFromLiteral):
1261 (WTF::StringImpl::createWithoutCopying):
1262 (WTF::StringImpl::createUninitializedInternal):
1263 (WTF::StringImpl::createUninitializedInternalNonEmpty):
1264 (WTF::StringImpl::createUninitialized):
1265 (WTF::StringImpl::reallocateInternal):
1266 (WTF::StringImpl::reallocate):
1267 (WTF::StringImpl::createInternal):
1268 (WTF::StringImpl::create):
1269 (WTF::StringImpl::create8BitIfPossible):
1270 (WTF::StringImpl::substring):
1271 (WTF::StringImpl::lower):
1272 (WTF::StringImpl::upper):
1273 (WTF::StringImpl::fill):
1274 (WTF::StringImpl::foldCase):
1275 (WTF::StringImpl::convertToASCIILowercase):
1276 (WTF::StringImpl::stripMatchedCharacters):
1277 (WTF::StringImpl::stripWhiteSpace):
1278 (WTF::StringImpl::removeCharacters):
1279 (WTF::StringImpl::simplifyMatchedCharactersToSpace):
1280 (WTF::StringImpl::simplifyWhiteSpace):
1281 (WTF::StringImpl::replace):
1282 (WTF::StringImpl::adopt):
1283 * wtf/text/StringImpl.h:
1284 (WTF::StringImpl::create8BitIfPossible):
1285 (WTF::StringImpl::create):
1286 (WTF::StringImpl::createSubstringSharingImpl8):
1287 (WTF::StringImpl::createSubstringSharingImpl):
1288 (WTF::StringImpl::createFromLiteral):
1289 (WTF::StringImpl::createEmptyUnique):
1290 (WTF::StringImpl::adopt):
1291 (WTF::StringImpl::replace):
1292 (WTF::StringImpl::constructInternal<LChar>):
1293 (WTF::StringImpl::constructInternal<UChar>):
1294 (WTF::StringImpl::isolatedCopy):
1295 * wtf/text/WTFString.h:
1296 (WTF::String::String):
1298 2014-12-10 Geoffrey Garen <ggaren@apple.com>
1300 Please disable the webkitFirstVersionWithInitConstructorSupport check on Apple TV
1301 https://bugs.webkit.org/show_bug.cgi?id=139501
1303 Reviewed by Gavin Barraclough.
1305 Added a platform definition for APPLETV.
1307 (It's not an OS because it's not mutually exclusive with other OS definitions.)
1311 2014-12-10 Martin Robinson <mrobinson@igalia.com>
1313 [GTK] Add support for text-decoration-skip
1314 https://bugs.webkit.org/show_bug.cgi?id=131540
1316 Reviewed by Gustavo Noronha Silva.
1318 * wtf/Platform.h: Enable text decoration skip by default.
1320 2014-12-09 David Kilzer <ddkilzer@apple.com>
1322 Switch from using PLATFORM_NAME to SDK selectors in ANGLE, bmalloc, gtest, JavaScriptCore, WTF
1323 <http://webkit.org/b/139212>
1325 Reviewed by Joseph Pecoraro.
1327 * Configurations/Base.xcconfig:
1328 - Only set GCC_ENABLE_OBJC_GC, GCC_MODEL_TUNING and TOOLCHAINS
1330 * Configurations/DebugRelease.xcconfig:
1331 - Only set MACOSX_DEPLOYMENT_TARGET and SDKROOT on OS X.
1333 2014-12-09 Dean Jackson <dino@apple.com>
1335 [Apple] Use Accelerate framework to speed-up FEGaussianBlur
1336 https://bugs.webkit.org/show_bug.cgi?id=139310
1338 Unreviewed followup, after comments by Andreas Kling.
1340 It was pointed out that we already have a USE(ACCELERATE), so
1341 we don't need a HAVE(ACCELERATE) :)
1345 2014-12-09 Alberto Garcia <berto@igalia.com>
1347 Undefined Symbol build error "_objc_registerThreadWithCollector" when building WebKit GTK Mac OS X on Snow Leopard
1348 https://bugs.webkit.org/show_bug.cgi?id=58737
1350 Reviewed by Darin Adler.
1352 Replace OS(MAC_OS_X) with PLATFORM(MAC) to prevent using
1353 osx-specific code in WebKitGTK+ builds.
1355 * wtf/ThreadingPthreads.cpp:
1356 (WTF::initializeCurrentThreadInternal):
1358 2014-12-08 Dean Jackson <dino@apple.com>
1360 [Apple] Use Accelerate framework to speed-up FEGaussianBlur
1361 https://bugs.webkit.org/show_bug.cgi?id=139310
1362 <rdar://problem/18434594>
1364 Reviewed by Simon Fraser.
1366 Add a HAVE_ACCELERATE flag, true on Apple platforms.
1370 2014-12-08 Myles C. Maxfield <mmaxfield@apple.com>
1372 Fix iOS build after r176971.
1374 I had previously modified the WTF forwarding header instead of modifying the real source.
1376 * wtf/unicode/CharacterNames.h:
1378 2014-12-08 Anders Carlsson <andersca@apple.com>
1380 Change WTF::currentCPUTime to return std::chrono::microseconds and get rid of currentCPUTimeMS
1381 https://bugs.webkit.org/show_bug.cgi?id=139410
1383 Reviewed by Andreas Kling.
1385 * wtf/CurrentTime.cpp:
1386 (WTF::currentCPUTime):
1387 (WTF::currentCPUTimeMS): Deleted.
1388 * wtf/CurrentTime.h:
1390 2014-12-08 Chris Dumez <cdumez@apple.com>
1392 Revert r176293 & r176275
1394 Unreviewed, revert r176293 & r176275 changing the Vector API to use unsigned type
1395 instead of size_t. There is some disagreement regarding the long-term direction
1396 of the API and we shouldn’t leave the API partly transitioned to unsigned type
1397 while making a decision.
1401 (WTF::VectorTypeOperations::compare):
1402 (WTF::VectorBufferBase::allocateBuffer):
1403 (WTF::VectorBufferBase::tryAllocateBuffer):
1404 (WTF::VectorBufferBase::shouldReallocateBuffer):
1405 (WTF::VectorBufferBase::reallocateBuffer):
1406 (WTF::VectorBufferBase::capacity):
1407 (WTF::VectorBufferBase::VectorBufferBase):
1408 (WTF::VectorBuffer::VectorBuffer):
1409 (WTF::VectorBuffer::allocateBuffer):
1410 (WTF::VectorBuffer::tryAllocateBuffer):
1411 (WTF::VectorBuffer::shouldReallocateBuffer):
1412 (WTF::VectorBuffer::reallocateBuffer):
1413 (WTF::VectorBuffer::swap):
1414 (WTF::VectorBuffer::swapInlineBuffer):
1415 (WTF::VectorBuffer::swapInlineBuffers):
1416 (WTF::Vector::Vector):
1417 (WTF::Vector::capacity):
1419 (WTF::Vector::operator[]):
1420 (WTF::OverflowHandler>::find):
1421 (WTF::OverflowHandler>::reverseFind):
1422 (WTF::OverflowHandler>::fill):
1423 (WTF::OverflowHandler>::expandCapacity):
1424 (WTF::OverflowHandler>::tryExpandCapacity):
1425 (WTF::OverflowHandler>::resize):
1426 (WTF::OverflowHandler>::resizeToFit):
1427 (WTF::OverflowHandler>::shrink):
1428 (WTF::OverflowHandler>::grow):
1429 (WTF::OverflowHandler>::reserveCapacity):
1430 (WTF::OverflowHandler>::tryReserveCapacity):
1431 (WTF::OverflowHandler>::reserveInitialCapacity):
1432 (WTF::OverflowHandler>::shrinkCapacity):
1433 (WTF::OverflowHandler>::append):
1434 (WTF::OverflowHandler>::tryAppend):
1435 (WTF::OverflowHandler>::insert):
1436 (WTF::OverflowHandler>::insertVector):
1437 (WTF::OverflowHandler>::remove):
1438 (WTF::OverflowHandler>::reverse):
1439 (WTF::OverflowHandler>::checkConsistency):
1440 * wtf/text/AtomicString.h:
1441 * wtf/text/StringImpl.h:
1442 (WTF::StringImpl::adopt):
1443 (WTF::equalIgnoringNullity):
1444 * wtf/text/StringView.h:
1446 * wtf/text/WTFString.h:
1448 2014-12-07 Andreas Kling <akling@apple.com>
1450 Use more PassRef in AtomicString.
1451 <https://webkit.org/b/139319>
1453 Reviewed by Antti Koivisto.
1455 Make a pass over AtomicString and convert functions that return PassRefPtr
1456 into returning RefPtr (where it may be null) and PassRef otherwise.
1457 This allows the compiler to skip null checks in many places.
1459 * wtf/text/AtomicString.cpp:
1460 (WTF::addToStringTable):
1461 (WTF::AtomicString::add):
1462 (WTF::AtomicString::addFromLiteralData):
1463 (WTF::AtomicString::addSlowCase):
1464 * wtf/text/AtomicString.h:
1465 (WTF::AtomicString::add):
1466 (WTF::AtomicString::addWithStringTableProvider):
1467 * wtf/text/cf/AtomicStringCF.cpp:
1468 (WTF::AtomicString::add):
1470 2014-12-05 Roger Fong <roger_fong@apple.com>
1472 [Win] proj files copying over too many resources..
1473 https://bugs.webkit.org/show_bug.cgi?id=139315.
1474 <rdar://problem/19148278>
1476 Reviewed by Brent Fulgham.
1478 * WTF.vcxproj/WTF.proj: Only copy WTF.dll.
1480 2014-12-05 Andreas Kling <akling@apple.com>
1482 PassRef should deref on destruction if pointee was not moved.
1483 <https://webkit.org/b/139309>
1485 Reviewed by Antti Koivisto.
1487 Let PassRef become nullptr internally after having WTF::move()'d the pointee.
1488 This means that PassRef is now essentially a PassRefPtr that can only be
1489 constructed with a non-null pointee.
1491 This should make it possible for all ::create()-style construction helpers to
1492 return PassRef, removing a branch in each case.
1495 (WTF::PassRef<T>::PassRef):
1496 (WTF::PassRef<T>::~PassRef):
1497 (WTF::PassRef<T>::get):
1498 (WTF::PassRef<T>::ptr):
1499 (WTF::PassRef<T>::leakRef):
1500 (WTF::PassRef<T>::dropRef): Deleted.
1502 2014-12-05 Jer Noble <jer.noble@apple.com>
1504 [WTF] MediaTime should support round-tripping from and to doubles.
1505 https://bugs.webkit.org/show_bug.cgi?id=139248
1507 Reviewed by Eric Carlson.
1509 MediaTimes should be able to return precisely the same double value as was used
1510 when the MediaTime was created, so long as that MediaTime was not modified in a
1511 non-destructive way. This will allow API which accepts floating-point values to
1512 return the exact same value when asked, but still be able to store that value
1515 * wtf/MediaTime.cpp:
1516 (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union.
1517 (WTF::MediaTime::createWithDouble): Ditto.
1518 (WTF::MediaTime::toFloat): If the value is a double, just return it.
1519 (WTF::MediaTime::toDouble): Ditto.
1520 (WTF::MediaTime::operator+): Special case when one or both sides are doubles.
1521 (WTF::MediaTime::operator-): Ditto.
1522 (WTF::MediaTime::operator*): Ditto.
1523 (WTF::MediaTime::compare): Ditto.
1525 (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double.
1527 2014-12-05 peavo@outlook.com <peavo@outlook.com>
1529 [WinCairo] WTF project is missing a GStreamer source file.
1530 https://bugs.webkit.org/show_bug.cgi?id=139296
1532 Reviewed by Philippe Normand.
1534 The WTF project file is missing a GStreamer source file,
1535 causing a link error when compiling with GStreamer enabled.
1537 * WTF.vcxproj/WTF.vcxproj:
1538 * WTF.vcxproj/WTF.vcxproj.filters:
1540 2014-12-04 David Kilzer <ddkilzer@apple.com>
1542 REGRESSION (r176683): RefCounter.h is installed outside SDKROOT
1544 * WTF.xcodeproj/project.pbxproj: Don't mark RefCounter.h as a
1545 private header. WTF headers use a special build phase script to
1548 2014-12-04 Anders Carlsson <andersca@apple.com>
1550 Make API::String copy the underlying strings if needed, for thread safety
1551 https://bugs.webkit.org/show_bug.cgi?id=139261
1553 Reviewed by Sam Weinig.
1556 (WTF::RefPtr<T>::leakRef):
1557 Add a leakRef() to RefPtr so we don't have to go through PassRefPtr.
1559 * wtf/text/WTFString.cpp:
1560 (WTF::String::isSafeToSendToAnotherThread):
1561 Check if the string is empty before checking whether it's in an atomic string table.
1562 It's safe to send empty strings to other threads even if they're in the atomic string table
1563 since they will never be deallocated.
1565 2014-12-04 Csaba Osztrogonác <ossy@webkit.org>
1567 Fix cast-align warning in StringImpl.h
1568 https://bugs.webkit.org/show_bug.cgi?id=139222
1570 Reviewed by Anders Carlsson.
1572 * wtf/text/StringImpl.h:
1573 (WTF::StringImpl::tailPointer):
1575 2014-12-02 Mark Lam <mark.lam@apple.com>
1577 Rolling out r176592, r176603, r176616, and r176705 until build and perf issues are resolved.
1578 https://bugs.webkit.org/show_bug.cgi?id=138821
1582 * WTF.vcxproj/WTF.vcxproj:
1583 * WTF.vcxproj/WTF.vcxproj.filters:
1584 * WTF.xcodeproj/project.pbxproj:
1585 * wtf/IndexedIterator.h: Removed.
1586 * wtf/RefCountedArray.h:
1587 (WTF::RefCountedArray::RefCountedArray):
1589 (WTF::Vector::Vector):
1590 (WTF::Vector::begin):
1592 (WTF::OverflowHandler>::Vector):
1594 (WTF::OverflowHandler>::fill):
1595 (WTF::OverflowHandler>::expandCapacity):
1596 (WTF::OverflowHandler>::tryExpandCapacity):
1597 (WTF::OverflowHandler>::resize):
1598 (WTF::OverflowHandler>::shrink):
1599 (WTF::OverflowHandler>::grow):
1600 (WTF::OverflowHandler>::reserveCapacity):
1601 (WTF::OverflowHandler>::tryReserveCapacity):
1602 (WTF::OverflowHandler>::shrinkCapacity):
1603 (WTF::OverflowHandler>::append):
1604 (WTF::OverflowHandler>::tryAppend):
1605 (WTF::OverflowHandler>::appendSlowCase):
1606 (WTF::OverflowHandler>::uncheckedAppend):
1607 (WTF::OverflowHandler>::appendVector):
1608 (WTF::OverflowHandler>::insert):
1609 (WTF::OverflowHandler>::insertVector):
1610 (WTF::OverflowHandler>::remove):
1612 2014-12-02 Oliver Hunt <oliver@apple.com>
1616 * wtf/IndexedIterator.h:
1618 2014-12-02 Gavin Barraclough <barraclough@apple.com>
1620 Generalize PageActivityAssertionToken
1621 https://bugs.webkit.org/show_bug.cgi?id=139106
1623 Reviewed by Sam Weinig.
1625 PageActivityAssertionToken is a RAII mechanism implementing a counter, used by PageThrottler
1626 to count user visible activity in progress on the page (currently page load and media playback).
1627 Use of an RAII type is prevents a number of possible errors, including double counting a single
1628 media element, or failing to decrement the count after a media element has been deallocated.
1630 The current implementation has a number of drawbacks that have been addressed by this refactoring:
1631 - specific to single use in PageThrottler class - not reusable.
1632 - incomplete encapsulation - the counter and WeakPtrFactory that comprise the current implementation
1633 are not encapsulated (are in the client type, PageThrottler).
1634 - tokens are not shared - PageActivityAssertionToken instances are managed by std::unique, every
1635 increment requires an object allocation.
1636 - redundancy - the current implementation uses a WeakPtr to safely reference the PageThrottler, this
1637 is internally implemented using a reference counted type, resulting in two counters being
1638 incremented (one in the PageActivityAssertionToken, one in the PageThrottler).
1640 In the reimplementation:
1641 - a callback is provided via a lambda function, which allows for easy reuse without a lot of
1643 - the counter, callback and ownership of the otherwise weakly-owned token is encapsulated within the
1645 - a single count within RefCounter::Count stores the counter value, and also manage the lifetime
1647 - standard RefPtrs are used to manage references to the RefCounter::Count.
1649 * WTF.xcodeproj/project.pbxproj:
1650 - added RefCounter.cpp/.h
1651 * wtf/RefCounter.cpp: Added.
1652 (WTF::RefCounter::Count::ref):
1653 - increment the counter.
1654 (WTF::RefCounter::Count::deref):
1655 - decrement the counter, and delete as necessary.
1656 (WTF::RefCounter::RefCounter):
1657 - create a RefCounter::Count.
1658 (WTF::RefCounter::~RefCounter):
1659 - eagerly delete the Counter if it has no references, otherwise let it be deleted on last deref.
1660 * wtf/RefCounter.h: Added.
1661 (WTF::RefCounter::Count::Count):
1662 - initialize count to 0.
1663 (WTF::RefCounter::RefCounter):
1664 - takes a lambda to be called when the value changes.
1665 (WTF::RefCounter::count):
1666 - reference the counter (and in doing so increment the count).
1667 (WTF::RefCounter::value):
1668 - access the current value of the counter.
1670 2014-12-01 Andreas Kling <akling@apple.com>
1672 Optimize constructing JSC::Identifier from AtomicString.
1673 <https://webkit.org/b/139157>
1675 Reviewed by Michael Saboff.
1677 Make AtomicString::isInAtomicStringTable() public so it can be used
1678 in some Identifier assertions.
1680 * wtf/text/AtomicString.h:
1682 2014-12-01 Oliver Hunt <oliver@apple.com>
1686 * wtf/IndexedIterator.h:
1688 2014-12-01 Oliver Hunt <oliver@apple.com>
1692 * wtf/IndexedIterator.h:
1694 2014-11-17 Oliver Hunt <oliver@apple.com>
1696 Make sure range based iteration of Vector<> still receives bounds checking
1697 https://bugs.webkit.org/show_bug.cgi?id=138821
1699 Reviewed by Mark Lam.
1701 Add a new IndexedIterator struct to WTF that wraps a
1702 Vector type and index to provide pointer like semantics
1703 while still performing runtime bounds checking, even in
1704 release builds. We store a simple index into the vector
1705 which means that this iterator allows vector resizing
1706 during iteration. If the vector is resized such that the
1707 iterator is out of bounds, then any attempt to dereference
1708 the iterator will crash safely. Any other errors, including
1709 overflows, and over extending the iterator will likewise
1712 For the purpose of retaining semantically equivalent
1713 behaviour, the iterator can be moved to m_index == size()
1714 as that is the standard "end" terminator for these types.
1715 Attempting to dereference at that point will still crash
1716 rather than perform an unsafe memory operation.
1718 In order to maintain the validity of all the bounds checking,
1719 we perform full integer range checking prior to any mutation
1720 of the iterator location. If we detect an arithmetic overflow
1721 we will crash rather than attempting to carry on.
1723 By necessity there are many overrides for operator + and - as
1724 we otherwise hit many different type promotion ambiguities when
1725 performing arithmetic with iterators. These ambiguities are also
1726 different for 32- vs. 64-bit, so duplicating the functions
1727 and then forwarding to the core implementations that performed
1728 the bounds checking and mutation seemed like the right call.
1730 * WTF.xcodeproj/project.pbxproj:
1731 * wtf/IndexedIterator.h: Added.
1732 (WTF::IndexedIterator::IndexedIterator):
1733 (WTF::IndexedIterator::operator->):
1734 (WTF::IndexedIterator::operator*):
1735 (WTF::IndexedIterator::get):
1736 (WTF::IndexedIterator::operator++):
1737 (WTF::IndexedIterator::operator--):
1738 (WTF::IndexedIterator::operator UnspecifiedBoolType):
1739 (WTF::IndexedIterator::operator+=):
1740 (WTF::IndexedIterator::operator-=):
1741 (WTF::IndexedIterator::operator+):
1742 (WTF::IndexedIterator::operator-):
1743 (WTF::IndexedIterator::operator=):
1744 (WTF::IndexedIterator::operator==):
1745 (WTF::IndexedIterator::operator!=):
1746 (WTF::IndexedIterator::operator<):
1747 (WTF::IndexedIterator::operator<=):
1748 (WTF::IndexedIterator::operator>):
1749 (WTF::IndexedIterator::operator>=):
1750 (WTF::IndexedIterator::operator const_iterator):
1751 (WTF::IndexedIterator::isSafeToCompare):
1752 (WTF::IndexedIterator::unsafeGet):
1761 (WTF::IndexedIteratorSelector::makeIterator):
1762 (WTF::IndexedIteratorSelector::makeConstIterator):
1763 * wtf/RefCountedArray.h:
1764 (WTF::RefCountedArray::RefCountedArray):
1766 (WTF::Vector::Vector):
1767 (WTF::Vector::begin):
1769 (WTF::OverflowHandler>::Vector):
1771 (WTF::OverflowHandler>::fill):
1772 (WTF::OverflowHandler>::expandCapacity):
1773 (WTF::OverflowHandler>::tryExpandCapacity):
1774 (WTF::OverflowHandler>::resize):
1775 (WTF::OverflowHandler>::shrink):
1776 (WTF::OverflowHandler>::grow):
1777 (WTF::OverflowHandler>::reserveCapacity):
1778 (WTF::OverflowHandler>::tryReserveCapacity):
1779 (WTF::OverflowHandler>::shrinkCapacity):
1780 (WTF::OverflowHandler>::append):
1781 (WTF::OverflowHandler>::tryAppend):
1782 (WTF::OverflowHandler>::appendSlowCase):
1783 (WTF::OverflowHandler>::uncheckedAppend):
1784 (WTF::OverflowHandler>::appendVector):
1785 (WTF::OverflowHandler>::insert):
1786 (WTF::OverflowHandler>::insertVector):
1787 (WTF::OverflowHandler>::remove):
1789 2014-11-30 Ryuan Choi <ryuan.choi@navercorp.com>
1791 [EFL] Drop support for the EFL 1.7
1792 https://bugs.webkit.org/show_bug.cgi?id=139114
1794 Reviewed by Gyuyoung Kim.
1796 * wtf/efl/EflTypedefs.h: Removed old definitions which EFL 1.7 used.
1798 2014-11-21 Anders Carlsson <andersca@apple.com>
1800 Remove the Timer parameters from timer callbacks
1801 https://bugs.webkit.org/show_bug.cgi?id=138974
1803 Reviewed by Antti Koivisto.
1805 * wtf/RunLoopTimer.h:
1806 (WTF::RunLoopTimer::RunLoopTimer):
1807 (WTF::RunLoopTimer::fired):
1809 2014-11-18 Chris Dumez <cdumez@apple.com>
1811 Have Vector::capacity() return an unsigned instead of a size_t
1812 https://bugs.webkit.org/show_bug.cgi?id=138842
1814 Reviewed by Andreas Kling.
1816 Have Vector::capacity() return an unsigned instead of a size_t as
1817 capacity is stored as an unsigned internally.
1820 (WTF::Vector::capacity):
1821 (WTF::OverflowHandler>::expandCapacity):
1822 (WTF::OverflowHandler>::tryExpandCapacity):
1824 2014-11-18 Geoffrey Garen <ggaren@apple.com>
1826 Removed the custom allocator for ListHashSet nodes
1827 https://bugs.webkit.org/show_bug.cgi?id=138841
1829 Reviewed by Andreas Kling.
1831 bmalloc is fast, so we don't need a custom allocator.
1833 The MallocBench test for linked list node allocation (list_allocate) is
1834 4.09X faster in bmalloc than TCMalloc. Also, I wrote a stress test to
1835 add/remove link elements, which modify a ListHashSet on insertion and
1836 removal, and it was 1% faster / in the noise with bmalloc enabled.
1838 * wtf/ListHashSet.h:
1839 (WTF::ListHashSetNode::ListHashSetNode):
1840 (WTF::ListHashSetTranslator::translate):
1841 (WTF::U>::ListHashSet):
1844 (WTF::U>::~ListHashSet):
1846 (WTF::U>::capacity):
1849 (WTF::U>::removeFirst):
1850 (WTF::U>::takeFirst):
1852 (WTF::U>::removeLast):
1853 (WTF::U>::takeLast):
1854 (WTF::U>::contains):
1858 (WTF::U>::unlinkAndDelete):
1859 (WTF::U>::appendNode):
1860 (WTF::U>::prependNode):
1861 (WTF::U>::insertNodeBefore):
1862 (WTF::U>::deleteAllNodes):
1863 (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Deleted.
1864 (WTF::ListHashSetNodeAllocator::allocate): Deleted.
1865 (WTF::ListHashSetNodeAllocator::deallocate): Deleted.
1866 (WTF::ListHashSetNodeAllocator::pool): Deleted.
1867 (WTF::ListHashSetNodeAllocator::pastPool): Deleted.
1868 (WTF::ListHashSetNodeAllocator::inPool): Deleted.
1869 (WTF::ListHashSetNode::operator new): Deleted.
1870 (WTF::ListHashSetNode::destroy): Deleted.
1872 2014-11-18 Chris Dumez <cdumez@apple.com>
1874 Update the Vector API to deal with unsigned types instead of size_t
1875 https://bugs.webkit.org/show_bug.cgi?id=138824
1877 Reviewed by Andreas Kling.
1879 Update part of the Vector API to deal with unsigned types instead of
1880 size_t. The Vector class is already using unsigned type for its
1881 capacity and size data members. However, the Vector API was never
1882 updated accordingly.
1884 The rest of the Vector API will be ported in follow-up patches to
1885 make the change smaller and more easily reviewable.
1889 (WTF::VectorTypeOperations::compare):
1890 (WTF::VectorBufferBase::allocateBuffer):
1891 (WTF::VectorBufferBase::tryAllocateBuffer):
1892 (WTF::VectorBufferBase::shouldReallocateBuffer):
1893 (WTF::VectorBufferBase::reallocateBuffer):
1894 (WTF::VectorBufferBase::capacity):
1895 (WTF::VectorBufferBase::VectorBufferBase):
1896 (WTF::VectorBuffer::VectorBuffer):
1897 (WTF::VectorBuffer::allocateBuffer):
1898 (WTF::VectorBuffer::tryAllocateBuffer):
1899 (WTF::VectorBuffer::shouldReallocateBuffer):
1900 (WTF::VectorBuffer::reallocateBuffer):
1901 (WTF::VectorBuffer::swap):
1902 (WTF::VectorBuffer::swapInlineBuffer):
1903 (WTF::VectorBuffer::swapInlineBuffers):
1904 (WTF::Vector::Vector):
1906 (WTF::Vector::operator[]):
1907 (WTF::OverflowHandler>::find):
1908 (WTF::OverflowHandler>::reverseFind):
1909 (WTF::OverflowHandler>::fill):
1910 (WTF::OverflowHandler>::expandCapacity):
1911 (WTF::OverflowHandler>::tryExpandCapacity):
1912 (WTF::OverflowHandler>::resize):
1913 (WTF::OverflowHandler>::resizeToFit):
1914 (WTF::OverflowHandler>::shrink):
1915 (WTF::OverflowHandler>::grow):
1916 (WTF::OverflowHandler>::reserveCapacity):
1917 (WTF::OverflowHandler>::tryReserveCapacity):
1918 (WTF::OverflowHandler>::reserveInitialCapacity):
1919 (WTF::OverflowHandler>::shrinkCapacity):
1920 (WTF::OverflowHandler>::append):
1921 (WTF::OverflowHandler>::tryAppend):
1922 (WTF::OverflowHandler>::insert):
1923 (WTF::OverflowHandler>::insertVector):
1924 (WTF::OverflowHandler>::remove):
1925 (WTF::OverflowHandler>::reverse):
1926 (WTF::OverflowHandler>::checkConsistency):
1927 * wtf/text/AtomicString.h:
1928 * wtf/text/StringImpl.h:
1929 (WTF::StringImpl::adopt):
1930 (WTF::equalIgnoringNullity):
1931 * wtf/text/StringView.h:
1933 * wtf/text/WTFString.h:
1935 2014-11-18 peavo@outlook.com <peavo@outlook.com>
1937 [WinCairo] Compile errors when GStreamer is enabled.
1938 https://bugs.webkit.org/show_bug.cgi?id=137000
1940 Reviewed by Philippe Normand.
1942 MSVC does not allow the keyword default on move constructors and move assignment operators.
1944 * wtf/gobject/GMainLoopSource.cpp:
1945 (WTF::GMainLoopSource::cancel):
1946 (WTF::GMainLoopSource::socketCallback):
1947 * wtf/gobject/GMainLoopSource.h:
1948 (WTF::GMainLoopSource::Context::operator=):
1950 2014-11-17 Anders Carlsson <andersca@apple.com>
1952 Fix WTF build with newer versions of clang.
1953 <rdar://problem/18978705>
1956 (WTF::removeIterator):
1958 (WTF::double_conversion::BitCast):
1960 2014-11-13 Myles C. Maxfield <mmaxfield@apple.com>
1962 Allow constructing a base PassRef with a derived Ref
1963 https://bugs.webkit.org/show_bug.cgi?id=138701
1965 Reviewed by Andreas Kling
1968 (WTF::PassRef<T>::PassRef):
1970 2014-11-12 Ryuan Choi <ryuan.choi@navercorp.com>
1972 [EFL] Fix the build with EFL 1.12
1973 https://bugs.webkit.org/show_bug.cgi?id=138245
1975 Reviewed by Gyuyoung Kim.
1977 * wtf/efl/UniquePtrEfl.h:
1978 Removed Evas_GL.h from UniquePtrEfl.h, which is commonly included, because
1979 it should not be included with official GL headers.
1981 2014-11-12 Mark Lam <mark.lam@apple.com>
1983 Rename USE(MASM_PROBE) to ENABLE(MASM_PROBE).
1984 <https://webkit.org/b/138661>
1986 Reviewed by Michael Saboff.
1988 Also move the switch for enabling the use of MASM_PROBE from JavaScriptCore's
1989 config.h to WTF's Platform.h. This ensures that the setting is consistently
1990 applied even when building WebCore parts as well.
1994 2014-11-09 Antti Koivisto <antti@apple.com>
1996 Remove BloomFilter size limit
1997 https://bugs.webkit.org/show_bug.cgi?id=138549
1999 Reviewed by Andreas Kling.
2001 * wtf/BloomFilter.h: Remove the static_assert, the code works fine with somewhat larger sizes.
2003 2014-11-09 Chris Dumez <cdumez@apple.com>
2005 Add a more correct way to compare floating point numbers and use it
2006 https://bugs.webkit.org/show_bug.cgi?id=138527
2008 Reviewed by Darin Adler.
2010 To compare floating point numbers in the code base, we would often rely
2011 on the following check:
2012 std::abs(a - b) <= std::numeric_limits<T>::epsilon()
2014 However, this is not correct for arbitrary floating point values, and
2015 will fail for values that are not close to zero.
2017 This patch introduces a WTF::areEssentiallyEqual() templated function
2018 that can only be called with floating point types and relies on the
2019 following formula from [1][2] that defines u as being "essentially
2020 equal" to v if: | u - v | / |u| <= e and | u - v | / |v| <= e
2022 [1] Knuth, D. E. "Accuracy of Floating Point Arithmetic." The Art of
2023 Computer Programming. 3rd ed. Vol. 2. Boston: Addison-Wesley, 1998.
2025 [2] http://www.boost.org/doc/libs/1_34_0/libs/test/doc/components/test_tools/floating_point_comparison.html
2028 (WTF::safeFPDivision):
2029 (WTF::areEssentiallyEqual):
2030 (WTF::withinEpsilon): Deleted.
2032 2014-11-08 Darin Adler <darin@apple.com>
2034 Replace FileThread class with a single function
2035 https://bugs.webkit.org/show_bug.cgi?id=138282
2037 Reviewed by Alexey Proskuryakov.
2039 * wtf/MessageQueue.h: Made queue work on any type and not require wrapping
2040 everything in a unique_ptr.
2042 * wtf/Threading.cpp:
2043 (WTF::threadEntryPoint): Changed to use a std::function instead of a function pointer.
2044 (WTF::createThread): Add a version that takes a std::function. Reimplemented the
2045 old version using lambdas. Removed the obsolete versions that were there just to support
2046 binary compatibility with very old versions of Safari.
2048 * wtf/Threading.h: Removed an incorrect license header that covers code that was long ago
2049 moved to a different file. Changed createThread to take a std::function instead of a function
2050 pointer and data pointer. Moved internal functions after public functions.
2052 2014-11-05 Chris Dumez <cdumez@apple.com>
2054 Assertion hit DOMTimer::updateTimerIntervalIfNecessary()
2055 https://bugs.webkit.org/show_bug.cgi?id=138440
2057 Reviewed by Geoffrey Garen.
2059 Move the withinEpsilon() function to WTF to avoid code duplication.
2062 (WTF::withinEpsilon):
2064 2014-11-05 Chris Dumez <cdumez@apple.com>
2066 Allow constructing a PassRef from a Ref
2067 https://bugs.webkit.org/show_bug.cgi?id=138389
2069 Reviewed by Andreas Kling.
2071 Allow constructing a PassRef from a Ref, similarly to PassRefPtr that
2072 can be constructed from a RefPtr already. This avoids having to call
2073 Ref::get() and simplifies the code a bit.
2076 (WTF::PassRef<T>::PassRef):
2078 2014-11-05 Dan Bernstein <mitz@apple.com>
2080 Remove the unused deletion UI feature
2081 https://bugs.webkit.org/show_bug.cgi?id=138442
2083 Rubber-stamped by Alexey Proskuryakov.
2085 * wtf/FeatureDefines.h: Removed definition of ENABLE_DELETION_UI.
2087 2014-11-03 Dean Jackson <dino@apple.com>
2089 Add ENABLE_FILTERS_LEVEL_2 feature guard.
2090 https://bugs.webkit.org/show_bug.cgi?id=138362
2092 Reviewed by Tim Horton.
2094 Add a new feature define for Level 2 of CSS Filters.
2095 http://dev.w3.org/fxtf/filters-2/
2097 * wtf/FeatureDefines.h:
2099 2014-11-05 Csaba Osztrogonác <ossy@webkit.org>
2101 Enable ARMv7 disassembler for all platforms
2102 https://bugs.webkit.org/show_bug.cgi?id=138415
2104 Reviewed by Darin Adler.
2108 2014-11-04 Chris Dumez <cdumez@apple.com>
2110 Add ptr() method to Ref class
2111 https://bugs.webkit.org/show_bug.cgi?id=138361
2113 Reviewed by Darin Adler.
2115 It is a very common pattern in our code base to get a pointer from a
2116 Ref object. Previously, we have to call Ref.get() and take its address
2117 which is not very nice. This patch adds a ptr() method to Ref class
2118 to simplify the code a bit.
2121 (WTF::PassRef<T>::ptr):
2124 (WTF::GetPtrHelper<Ref<T>>::getPtr):
2126 2014-11-04 Dániel Bátyai <dbatyai.u-szeged@partner.samsung.com>
2128 ATTR_USED incorrectly applying to Clang
2129 https://bugs.webkit.org/show_bug.cgi?id=138313
2131 Reviewed by Csaba Osztrogonác.
2133 ATTR_USED was only intended for GCC. Also limit it to ENABLE(FTL_NATIVE_CALL_INLINING)
2134 since that's the only thing it's needed for.
2138 2014-11-03 Chris Dumez <cdumez@apple.com>
2140 Allow implicit conversion from Ref<T> to T&
2141 https://bugs.webkit.org/show_bug.cgi?id=138331
2143 Reviewed by Andreas Kling.
2145 Allow implicit conversion from Ref<T> to T& to reduce the amount of
2146 Ref<>::get() calls in the code and increase readability. Unlike for
2147 RefPtr, doing this for Ref should not be error prone.
2150 (WTF::Ref::operator T&):
2151 (WTF::Ref::operator const T&):
2153 (WTF::RunLoop::Holder::runLoop):
2155 2014-10-31 Jeffrey Pfau <jpfau@apple.com>
2157 Unreviewed, fix ASan build after r175382
2159 * wtf/SizeLimits.cpp:
2161 2014-10-31 Geoffrey Garen <ggaren@apple.com>
2165 WebKit was failing to build 32bit on some Apple internal systems because
2166 those systems were configured to build bmalloc 64-bit-only. Those systems
2167 have been updated to build bmalloc as a universal binary, so everything
2168 should work fine now.
2170 The relevant setting is controlled by an environment variable on the
2171 build system, and not by the project file in the source tree, so there's
2172 no new code change here.
2174 Enable bmalloc in 32bit builds
2175 https://bugs.webkit.org/show_bug.cgi?id=138232
2177 Reviewed by Andreas Kling.
2179 * wtf/FastMalloc.cpp:
2181 2014-10-31 Lucas Forschler <lforschler@apple.com>
2183 Unreviewed rollout r175389.
2185 2014-10-30 Dana Burkart <dburkart@apple.com>
2187 <rdar://problem/18821260> Prepare for the mysterious future
2189 Reviewed by Lucas Forschler.
2191 * Configurations/Base.xcconfig:
2192 * Configurations/DebugRelease.xcconfig:
2194 2014-10-30 Geoffrey Garen <ggaren@apple.com>
2196 Enable bmalloc in 32bit builds
2197 https://bugs.webkit.org/show_bug.cgi?id=138232
2199 Reviewed by Andreas Kling.
2203 * wtf/FastMalloc.cpp:
2205 2014-10-30 Jeffrey Pfau <jpfau@apple.com>
2207 ASSERT(!m_deletionHasBegun) in RefCounted.h should be ASSERT_WITH_SECURITY_IMPLICATION
2208 https://bugs.webkit.org/show_bug.cgi?id=138141
2210 Reviewed by Alexey Proskuryakov.
2213 (WTF::RefCountedBase::ref):
2214 (WTF::RefCountedBase::relaxAdoptionRequirement):
2215 (WTF::RefCountedBase::derefBase):
2218 2014-10-28 Milan Crha <mcrha@redhat.com>
2220 Use constants from wtf/MathExtras.h
2221 https://bugs.webkit.org/show_bug.cgi?id=137967
2223 Reviewed by Darin Adler.
2227 2014-10-28 Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com>
2229 [EFL] Remove unnecessary defines from OptionsEfl.cmake
2230 https://bugs.webkit.org/show_bug.cgi?id=138132
2232 Reviewed by Csaba Osztrogonác.
2236 2014-10-27 Chris Dumez <cdumez@apple.com>
2238 Use separate HashMaps for common and uncommon headers in HTTPHeaderMap
2239 https://bugs.webkit.org/show_bug.cgi?id=138079
2241 Reviewed by Anders Carlsson.
2243 Add HashTraits for C++11 strong enum types. Using integer HashTraits for
2244 strong enums would be inconvenient as it would require casting between
2245 integer and strong enum types.
2248 (WTF::StrongEnumHashTraits::emptyValue):
2249 (WTF::StrongEnumHashTraits::constructDeletedValue):
2250 (WTF::StrongEnumHashTraits::isDeletedValue):
2252 2014-10-25 Brian J. Burg <burg@cs.washington.edu>
2254 Web Inspector: timelines should not count time elapsed while paused in the debugger
2255 https://bugs.webkit.org/show_bug.cgi?id=136351
2257 Unreviewed, follow-up fix after r175203. The debugger agent should not assume
2258 that the inspector environment's stopwatch has already been started.
2261 (WTF::Stopwatch::isActive): Added. Allow peeking at the stopwatch state.
2263 2014-10-18 Brian J. Burg <burg@cs.washington.edu>
2265 Web Inspector: timelines should not count time elapsed while paused in the debugger
2266 https://bugs.webkit.org/show_bug.cgi?id=136351
2268 Reviewed by Timothy Hatcher.
2270 * WTF.vcxproj/WTF.vcxproj:
2271 * WTF.vcxproj/WTF.vcxproj.filters:
2272 * WTF.xcodeproj/project.pbxproj:
2273 * wtf/CMakeLists.txt:
2274 * wtf/Stopwatch.h: Added. This implements a refcounted monotonic stopwatch.
2275 (WTF::Stopwatch::create):
2276 (WTF::Stopwatch::Stopwatch):
2277 (WTF::Stopwatch::reset):
2278 (WTF::Stopwatch::start):
2279 (WTF::Stopwatch::stop):
2280 (WTF::Stopwatch::elapsedTime):
2282 2014-10-23 Joseph Pecoraro <pecoraro@apple.com>
2284 Web Inspector: Provide a way to have alternate inspector agents
2285 https://bugs.webkit.org/show_bug.cgi?id=137901
2287 Reviewed by Brian Burg.
2289 * wtf/FeatureDefines.h:
2291 2014-10-23 Alberto Garcia <berto@igalia.com>
2293 [GTK] Fix build on Hurd
2294 https://bugs.webkit.org/show_bug.cgi?id=138003
2296 Reviewed by Carlos Garcia Campos.
2301 2014-10-22 Byungseon Shin <sun.shin@lge.com>
2303 String(new Date(Mar 30 2014 01:00:00)) is wrong in CET
2304 https://bugs.webkit.org/show_bug.cgi?id=130967
2306 Reviewed by Mark Lam.
2308 By definition of calculateLocalTimeOffset, input time should be UTC time.
2309 But there are many cases when input time is based on local time.
2310 So, it gives erroneous results while calculating offset of DST boundary time.
2311 By adding a argument to distinguish UTC and local time, we can get the correct offset.
2314 (WTF::calculateLocalTimeOffset):
2315 (WTF::parseDateFromNullTerminatedCharacters):
2316 Compensate time offset depends on UTC time or local time.
2318 Add argument to differenciate UTC or local time.
2320 2014-10-21 Dániel Bátyai <dbatyai.u-szeged@partner.samsung.com>
2322 Fix FTL Native Inlining for EFL
2323 https://bugs.webkit.org/show_bug.cgi?id=137774
2325 Reviewed by Michael Saboff.
2327 Updated guard definition for Native Inlining, and added an attribute define for marking functions
2328 that should not be left out of the symbol table.
2332 2014-10-20 Chris Dumez <cdumez@apple.com>
2334 Use is<>() / downcast<>() for Accessibility objects
2335 https://bugs.webkit.org/show_bug.cgi?id=137286
2337 Reviewed by Darin Adler.
2339 Remove the legacy TYPE_CASTS_BASE() macro now that it is no longer
2344 2014-10-18 Dan Bernstein <mitz@apple.com>
2346 WorkQueue dispatches functions but isn’t a FunctionDispatcher
2347 https://bugs.webkit.org/show_bug.cgi?id=137853
2349 Reviewed by Anders Carlsson.
2351 * wtf/FunctionDispatcher.h: Added header guards.
2353 2014-10-17 Carlos Garcia Campos <cgarcia@igalia.com>
2355 [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
2356 https://bugs.webkit.org/show_bug.cgi?id=137782
2358 Reviewed by Sergio Villar Senin.
2360 In some cases when we have a double with the time in seconds, the
2361 conversion to milliseconds ends up truncating the value to 0, and
2362 the source scheduled immediately.
2364 * wtf/gobject/GMainLoopSource.cpp:
2365 (WTF::createMicrosecondsTimeoutSource): Use a custom timeout
2366 source that handles the interval in microseconds instead of milliseconds.
2367 (WTF::GMainLoopSource::scheduleAfterDelay): Use MicrosecondsTimeoutSource.
2368 (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy): Ditto.
2369 * wtf/gobject/GMainLoopSource.h:
2371 2014-10-17 Dan Bernstein <mitz@apple.com>
2373 Reverted incorrect build fix attempt.
2375 * wtf/Threading.cpp:
2377 2014-10-17 Dan Bernstein <mitz@apple.com>
2379 Tried to fix the Yosemite build.
2381 * wtf/Threading.cpp:
2383 2014-10-16 Dan Bernstein <mitz@apple.com>
2385 OSObjectPtr is missing leakRef()
2386 https://bugs.webkit.org/show_bug.cgi?id=137798
2388 Reviewed by Sam Weinig.
2390 * wtf/OSObjectPtr.h:
2392 2014-10-14 Brent Fulgham <bfulgham@apple.com>
2394 [Win] Unreviewed gardening. Ignore Visual Studio *.sdf files.
2396 * WTF.vcxproj: Modified property svn:ignore.
2398 2014-10-13 Antti Koivisto <antti@apple.com>
2400 Add StringCapture helper for thread-safe lambda capture
2401 https://bugs.webkit.org/show_bug.cgi?id=137664
2403 Reviewed by Anders Carlsson.
2405 There is currently no clean way to capture a String in a thread-safe manner. This will now work:
2407 StringCapture stringCapture(string);
2408 auto lambdaThatRunsInAnotherThread = [stringCapture] { String string = stringCapture.string(); ... }
2410 This type won't be necessary with C++14 initialized lambda capture: [string = string.isolatedCopy()].
2412 * wtf/text/WTFString.h:
2413 (WTF::StringCapture::StringCapture): Create isolated copy in copy-constructor.
2414 (WTF::StringCapture::string):
2416 2014-10-11 KwangHyuk Kim <hyuki.kim@samsung.com>
2418 [EFL] Enable WebP support.
2419 https://bugs.webkit.org/show_bug.cgi?id=136156
2421 Reviewed by Gyuyoung Kim.
2423 Enable WTF_USE_WEBP macro for WK2 Efl.
2427 2014-10-11 Carlos Garcia Campos <cgarcia@igalia.com>
2429 [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource
2430 https://bugs.webkit.org/show_bug.cgi?id=137485
2432 Reviewed by Sergio Villar Senin.
2434 We made GMainLoopSource thread safe, but in most of the cases we
2435 know the sources are used by a single thread, which has an impact
2436 in the performance (mutex, GCancellable, etc.). The new class
2437 GThreadSafeMainLoopSource inherits from GMainLoopSource overriding
2438 the new virtual methods and calling the parent for the common code.
2439 GMutexLocker now supports recursive mutexes, it's a template that
2440 can wrap a GMutex or a GRecMutex. GThreadSafeMainLoopSource uses a
2441 recursive mutex using the new GMutexLocker API.
2443 * wtf/PlatformEfl.cmake: Add new file to compilation.
2444 * wtf/PlatformGTK.cmake: Ditto.
2445 * wtf/gobject/GMainLoopSource.cpp:
2446 (WTF::GMainLoopSource::GMainLoopSource):
2447 (WTF::GMainLoopSource::~GMainLoopSource):
2448 (WTF::GMainLoopSource::cancel):
2449 (WTF::GMainLoopSource::schedule):
2450 (WTF::GMainLoopSource::scheduleAfterDelay):
2451 (WTF::GMainLoopSource::prepareVoidCallback):
2452 (WTF::GMainLoopSource::finishVoidCallback):
2453 (WTF::GMainLoopSource::voidCallback):
2454 (WTF::GMainLoopSource::prepareBoolCallback):
2455 (WTF::GMainLoopSource::finishBoolCallback):
2456 (WTF::GMainLoopSource::boolCallback):
2457 (WTF::GMainLoopSource::socketCallback):
2458 (WTF::GMainLoopSource::cancelWithoutLocking): Deleted.
2459 * wtf/gobject/GMainLoopSource.h:
2460 * wtf/gobject/GMutexLocker.h:
2461 (WTF::MutexWrapper<GMutex>::lock):
2462 (WTF::MutexWrapper<GMutex>::unlock):
2463 (WTF::MutexWrapper<GRecMutex>::lock):
2464 (WTF::MutexWrapper<GRecMutex>::unlock):
2465 (WTF::GMutexLocker::GMutexLocker):
2466 (WTF::GMutexLocker::lock):
2467 (WTF::GMutexLocker::unlock):
2468 * wtf/gobject/GThreadSafeMainLoopSource.cpp: Added.
2469 (WTF::GThreadSafeMainLoopSource::GThreadSafeMainLoopSource):
2470 (WTF::GThreadSafeMainLoopSource::~GThreadSafeMainLoopSource):
2471 (WTF::GThreadSafeMainLoopSource::cancel):
2472 (WTF::GThreadSafeMainLoopSource::schedule):
2473 (WTF::GThreadSafeMainLoopSource::scheduleAfterDelay):
2474 (WTF::GThreadSafeMainLoopSource::prepareVoidCallback):
2475 (WTF::GThreadSafeMainLoopSource::finishVoidCallback):
2476 (WTF::GThreadSafeMainLoopSource::voidCallback):
2477 (WTF::GThreadSafeMainLoopSource::prepareBoolCallback):
2478 (WTF::GThreadSafeMainLoopSource::finishBoolCallback):
2479 (WTF::GThreadSafeMainLoopSource::boolCallback):
2480 * wtf/gobject/GThreadSafeMainLoopSource.h: Added.
2482 2014-10-09 Dean Jackson <dino@apple.com>
2484 Remove ENABLE_CSS3_CONDITIONAL_RULES
2485 https://bugs.webkit.org/show_bug.cgi?id=137571
2487 Reviewed by Simon Fraser.
2489 * wtf/FeatureDefines.h:
2491 2014-10-09 Akos Kiss <akiss@inf.u-szeged.hu>
2493 Enable ARM64 disassembler for all platforms
2494 https://bugs.webkit.org/show_bug.cgi?id=137560
2496 Reviewed by Michael Saboff.
2498 Remove PLATFORM conditions from around WTF_USE_ARM64_DISASSEMBLER since
2499 the ARM64 disassembler has no platform dependencies anymore.
2503 2014-10-08 peavo@outlook.com <peavo@outlook.com>
2505 [WinCairo] Enable JIT on 32-bit.
2506 https://bugs.webkit.org/show_bug.cgi?id=137521
2508 Reviewed by Mark Lam.
2510 Enable JIT on Windows 32-bit, but disable it at runtime if SSE2 is not present.
2514 2014-10-08 Brent Fulgham <bfulgham@apple.com>
2516 [Win] Resolve warnings about missing __has_include macro under MSVC
2517 https://bugs.webkit.org/show_bug.cgi?id=137524
2519 Reviewed by Anders Carlsson.
2521 * wtf/Compiler.h: Provide a dummy implementation of __has_include that
2522 avoids the warning without changing compile behavior.
2524 2014-10-07 Brent Fulgham <bfulgham@apple.com>
2526 [Win] Resolve some MSVC static analyzer warnings
2527 https://bugs.webkit.org/show_bug.cgi?id=137504
2529 Reviewed by Dean Jackson.
2531 * wtf/GregorianDateTime.cpp:
2532 (WTF::GregorianDateTime::setToCurrentLocalTime): Properly handle
2533 possible timezone error case.
2534 * wtf/OSAllocatorWin.cpp:
2535 (WTF::OSAllocator::decommit): Silence a spurious warning about using
2536 MEM_DECOMMIT instead of MEM_RELEASE.
2537 * wtf/ThreadingWin.cpp: Silence a spurious warning about how the
2538 tryLock method is implemented.
2540 2014-10-07 Christophe Dumez <cdumez@apple.com>
2542 [WK2] Use is<>() / downcast<>() for DrawingAreaProxy subclasses
2543 https://bugs.webkit.org/show_bug.cgi?id=137477
2545 Reviewed by Andreas Kling.
2547 Rename wtf/cf/TypeCasts.h to wtf/cf/TypeCastsCF.h to avoid conflict
2548 with wtf/TypeCasts.h. They were using the same #ifndef guard and it
2549 was causing problems when both were included in the same context.
2551 * WTF.xcodeproj/project.pbxproj:
2552 * wtf/cf/TypeCastsCF.h: Renamed from Source/WTF/wtf/cf/TypeCasts.h.
2553 (WTF::dynamic_cf_cast):
2554 (WTF::checked_cf_cast):
2556 2014-10-07 Anders Carlsson <andersca@apple.com>
2558 Try to fix the Mountain Lion build.
2560 * wtf/text/StringView.h:
2561 (WTF::StringView::underlyingStringIsValid):
2562 (WTF::StringView::setUnderlyingString):
2563 (WTF::StringView::invalidate):
2565 2014-10-07 Anders Carlsson <andersca@apple.com>
2567 Use "1", not "true".
2569 * wtf/text/StringView.h:
2571 2014-10-07 Anders Carlsson <andersca@apple.com>
2573 Temporarily disable the StringView lifetime checking.
2575 * wtf/text/StringView.h:
2577 2014-10-07 Anders Carlsson <andersca@apple.com>
2579 Another build fix attempt.
2581 * wtf/text/StringView.cpp:
2582 (WTF::StringView::UnderlyingString::UnderlyingString):
2584 2014-10-07 Anders Carlsson <andersca@apple.com>
2586 Try to fix the Windows build.
2588 * wtf/text/StringView.cpp:
2589 (WTF::StringView::UnderlyingString::UnderlyingString):
2591 2014-10-06 Darin Adler <darin@apple.com>
2593 Make StringView check the lifetime of the StringImpl it's created from
2594 https://bugs.webkit.org/show_bug.cgi?id=137202
2596 Reviewed by Anders Carlsson.
2598 * WTF.vcxproj/WTF.vcxproj: Added StringView.cpp.
2599 * WTF.vcxproj/WTF.vcxproj.filters: Added StringView.cpp.
2600 * WTF.xcodeproj/project.pbxproj: Added StringView.cpp.
2601 * wtf/CMakeLists.txt: Added StringView.cpp.
2603 * wtf/text/StringImpl.cpp:
2604 (WTF::StringImpl::~StringImpl): Call StringView::invalidate.
2606 * wtf/text/StringView.cpp: Added.
2607 (WTF::underlyingStrings): Returns map from StringImpl to the underlying
2608 string object used by StringView to track validity.
2609 (WTF::StringView::invalidate): Mark the underlying string object invalid,
2610 and remove it from the map, so any future StringImpl will get a new one,
2611 even if it has the same pointer.
2612 (WTF::StringView::underlyingStringIsValid): Return true only if the
2613 underlying string is still valid.
2614 (WTF::StringView::setUnderlyingString): Create and manage reference counts
2615 of underlying string objects as needed.
2617 * wtf/text/StringView.h: Moved function bodies out of the class definition,
2618 so we can now read a clean class definition to see the class design and what
2619 functions it offers.
2620 (WTF::StringView::StringView): Added a comment to the default constructor.
2621 Also added copy and move constructors so they can call setUnderlyingString
2622 and assert the underlying string is valid as needed, replacing the
2623 compiler-generated ones.
2624 (WTF::StringView::~StringView): Added a call to setUnderlyingString.
2625 (WTF::StringView::operator=): Added these assignment operators with the same
2626 job as the constructors above.
2627 (WTF::StringView::initialize): Added a comment.
2628 (WTF::StringView::characters8): Added an assertion that the underlying
2630 (WTF::StringView::characters16): Ditto.
2631 (WTF::StringView::substring): Added code to propagate the underlying string
2632 from the original string to the substring.
2633 (WTF::StringView::invalidate): Inline empty version of this function for
2635 (WTF::StringView::underlyingStringIsValid): Ditto.
2636 (WTF::StringView::setUnderlyingString): Ditto.
2638 2014-10-06 Brent Fulgham <bfulgham@apple.com>
2640 [Win] DateMath's calculateUTFOffset does not account for DST.
2641 https://bugs.webkit.org/show_bug.cgi?id=137458
2642 <rdar://problem/18559172>
2644 Reviewed by Geoffrey Garen.
2646 Check the return value of GetTimeZoneInformation and use the
2647 proper bias against UTC (depending on whether we are in daylight
2648 savings time, or standard time).
2650 Also, handle possible error cases in the FileTimeToSystemTime
2651 and SystemTimeToTzSpecificLocalTime, rather than using potentially
2652 uninitialized values.
2655 (WTF::calculateUTCOffset): Use proper daylight-savings-time state.
2656 (WTF::calculateDSTOffset): Avoid uninitialized data due to failing
2659 2014-10-06 Christophe Dumez <cdumez@apple.com>
2661 Add is<>() / downcast<>() support for RenderObject subclasses
2662 https://bugs.webkit.org/show_bug.cgi?id=137424
2664 Reviewed by Benjamin Poulain.
2666 Handle correctly calling TypeCastTraits<ExpectedType, ArgType>::isOfType(ArgType&)
2667 with ExpectedType being a base class of ArgType (or the same as ArgType). The
2668 previous template specialization was only meant to support the case where
2669 ExpectedType is the same as ArgType but even that wasn't working as the compiler
2670 would complain about ambiguous partial specializations. Since this is needed by
2671 RenderTraversal functions, this patch adds an extra isBaseType template parameter
2672 to TypeCastTraits to resolve the ambiguity and relies on std::is_base_of for the
2677 2014-10-06 Brent Fulgham <bfulgham@apple.com>
2679 [Win] Project file gardening.
2681 * WTF.vcxproj/WTF.vcxproj.filters: Move HashMethod.h and
2682 FastBitVector.cpp to proper places in hierarchy.
2684 2014-10-04 Brian J. Burg <burg@cs.washington.edu>
2686 Unreviewed, rolling out r174319.
2688 Causes assertions in fast/profiler tests. Needs nontrivial
2689 investigation, will take offline.
2693 "Web Inspector: timelines should not count time elapsed while
2694 paused in the debugger"
2695 https://bugs.webkit.org/show_bug.cgi?id=136351
2696 http://trac.webkit.org/changeset/174319
2698 2014-10-04 Brian J. Burg <burg@cs.washington.edu>
2700 Web Inspector: timelines should not count time elapsed while paused in the debugger
2701 https://bugs.webkit.org/show_bug.cgi?id=136351
2703 Reviewed by Timothy Hatcher.
2705 * WTF.vcxproj/WTF.vcxproj:
2706 * WTF.vcxproj/WTF.vcxproj.filters:
2707 * WTF.xcodeproj/project.pbxproj:
2708 * wtf/CMakeLists.txt:
2709 * wtf/Stopwatch.h: Added. This implements a refcounted monotonic stopwatch.
2710 (WTF::Stopwatch::reset):
2711 (WTF::Stopwatch::start):
2712 (WTF::Stopwatch::stop):
2714 2014-10-04 Filip Pizlo <fpizlo@apple.com>
2716 FTL should sink PutLocals
2717 https://bugs.webkit.org/show_bug.cgi?id=137168
2719 Reviewed by Oliver Hunt.
2721 Make the set bits of a BitVector iterable.
2724 (WTF::BitVector::SetBitsIterable::SetBitsIterable):
2725 (WTF::BitVector::SetBitsIterable::iterator::iterator):
2726 (WTF::BitVector::SetBitsIterable::iterator::operator*):
2727 (WTF::BitVector::SetBitsIterable::iterator::operator++):
2728 (WTF::BitVector::SetBitsIterable::iterator::operator==):
2729 (WTF::BitVector::SetBitsIterable::iterator::operator!=):
2730 (WTF::BitVector::SetBitsIterable::begin):
2731 (WTF::BitVector::SetBitsIterable::end):
2732 (WTF::BitVector::setBits):
2734 2014-10-03 Commit Queue <commit-queue@webkit.org>
2736 Unreviewed, rolling out r174275.
2737 https://bugs.webkit.org/show_bug.cgi?id=137408
2739 Build failures on the internal bots. (Requested by dethbakin
2744 "FTL should sink PutLocals"
2745 https://bugs.webkit.org/show_bug.cgi?id=137168
2746 http://trac.webkit.org/changeset/174275
2748 2014-10-03 Christophe Dumez <cdumez@apple.com>
2750 Add TypeCasts.h to xcodeproject
2751 https://bugs.webkit.org/show_bug.cgi?id=137403
2753 Reviewed by Benjamin Poulain.
2755 Add TypeCasts.h to xcodeproject.
2757 * WTF.xcodeproj/project.pbxproj:
2759 2014-09-28 Filip Pizlo <fpizlo@apple.com>
2761 FTL should sink PutLocals
2762 https://bugs.webkit.org/show_bug.cgi?id=137168
2764 Reviewed by Oliver Hunt.
2766 Make the set bits of a BitVector iterable.
2769 (WTF::BitVector::SetBitsIterable::SetBitsIterable):
2770 (WTF::BitVector::SetBitsIterable::iterator::iterator):
2771 (WTF::BitVector::SetBitsIterable::iterator::operator*):
2772 (WTF::BitVector::SetBitsIterable::iterator::operator++):
2773 (WTF::BitVector::SetBitsIterable::iterator::operator==):
2774 (WTF::BitVector::SetBitsIterable::iterator::operator!=):
2775 (WTF::BitVector::SetBitsIterable::begin):
2776 (WTF::BitVector::SetBitsIterable::end):
2777 (WTF::BitVector::setBits):
2779 2014-10-03 Myles C. Maxfield <mmaxfield@apple.com>
2781 Support modern for loops over StringViews
2782 https://bugs.webkit.org/show_bug.cgi?id=137165
2784 Reviewed by Darin Adler.
2786 This patch adds two functions, codePoints() and codeUnits(), on StringView.
2787 These two functions return small objects which have begin() and end() functions,
2788 which means it can be used by the modern for loop style. This small class also
2789 has an inner iterator class which can be incremented, dereferenced, and
2792 Using these new objects looks like this:
2793 for (UChar codeunit : stringView.codeUnits()) { } and
2794 for (UChar32 codepoint : stringView.codePoints()) { }.
2796 * wtf/text/StringView.h:
2797 (WTF::StringView::codepoints):
2798 (WTF::StringView::codeunits):
2799 (WTF::StringViewCodePointIterator::StringViewCodePointIterator):
2800 (WTF::StringViewCodePointIterator::Iterator::Iterator):
2801 (WTF::StringViewCodePointIterator::Iterator::operator*):
2802 (WTF::StringViewCodePointIterator::Iterator::operator!=):
2803 (WTF::StringViewCodeUnitIterator::StringViewCodeUnitIterator):
2804 (WTF::StringViewCodeUnitIterator::Iterator::Iterator):
2805 (WTF::StringViewCodeUnitIterator::Iterator::operator*):
2806 (WTF::StringViewCodeUnitIterator::Iterator::operator!=):
2808 2014-09-28 Sam Weinig <sam@webkit.org>
2810 Remove RefPtrHashMap
2811 https://bugs.webkit.org/show_bug.cgi?id=137200
2813 Reviewed by Darin Adler.
2815 HashMap now has all the features of the RefPtr specialization of HashMap
2816 (which lived in RefPtrHashMap.h) and is in fact more efficient when moving
2817 items into it. For instance:
2819 For HashMap<RefPtr<Foo>, Bar> map:
2821 RefPtr<Foo> foo = ...;
2822 map.add(WTF::move(foo), Bar());
2824 will now not cause a ref() / deref(), but will successfully move the item in
2825 without churn. The same is true if foo.release() was used.
2827 * WTF.vcxproj/WTF.vcxproj:
2828 * WTF.vcxproj/WTF.vcxproj.filters:
2829 * WTF.xcodeproj/project.pbxproj:
2830 * wtf/CMakeLists.txt:
2831 Remove references to RefPtrHashMap.h.
2833 * wtf/RefPtrHashMap.h: Removed.
2836 Remove #include of RefPtrHashMap.h and add inlineGet to match the interface
2837 exposed by the RefPtrHashMap specialization.
2839 2014-10-02 Anders Carlsson <andersca@apple.com>
2841 Add back debugging/testing code that I accidentally removed.
2843 * wtf/text/StringConcatenate.h:
2844 (WTF::StringTypeAdapter<String>::writeTo):
2846 2014-10-02 Anders Carlsson <andersca@apple.com>
2848 Simplify StringTypeAdapter templates
2849 https://bugs.webkit.org/show_bug.cgi?id=137356
2851 Reviewed by Andreas Kling.
2853 * wtf/text/StringConcatenate.h:
2854 Use StringView for copying characters. Use inheritance for char* vs const char* etc. Make all StringAdapter member functions const.
2856 * wtf/text/StringView.h:
2857 Move enough functions out of line so we can include WTFString.h after the StringView class definition.
2859 2014-10-01 Christophe Dumez <cdumez@apple.com>
2861 Have is<>(T*) function do a null check on the pointer argument
2862 https://bugs.webkit.org/show_bug.cgi?id=137333
2864 Reviewed by Gavin Barraclough.
2866 Have is<>(T*) function do a null check on the argument instead of a
2867 simple assertion. This makes sense for 2 reasons:
2868 1. It is more consistent with downcast<>(T*), which will succeed even
2869 if the argument is a nullptr.
2870 2. It simplifies the code a bit as it gets rid of a lot of explicit
2876 2014-10-02 Daniel Bates <dabates@apple.com>
2878 Clean up: Move XPC forward declarations in JavaScriptCore to WTF SPI wrapper header
2879 https://bugs.webkit.org/show_bug.cgi?id=137277
2881 Reviewed by Alexey Proskuryakov.
2883 Towards centralizing the declarations of XPC functions used in JavaScriptCore
2884 and WebKit2, add a header that wraps these function declarations called XPCSPI.h
2885 and use it instead of including the corresponding XPC API/SPI headers/forward
2886 declaring XPC functions. This will also aid in the effort to make WebKit2 build
2887 for iOS with the public iOS SDK.
2889 * WTF.xcodeproj/project.pbxproj:
2890 * wtf/spi/darwin/XPCSPI.h: Added.
2892 2014-10-01 Christophe Dumez <cdumez@apple.com>
2894 Unreviewed build fix after r174193.
2896 Adding a return statement as that function is returning a boolean.
2899 (WTF::TypeCastTraits::isOfType):
2901 2014-10-01 Christophe Dumez <cdumez@apple.com>
2903 Fail better when is<>() / downcast<>() is used for an unsupported type
2904 https://bugs.webkit.org/show_bug.cgi?id=137323
2906 Reviewed by Benjamin Poulain.
2908 We should fail better when is<>() / downcast<>() is used for an
2909 unsupported type (i.e. a type that doesn't have the needed
2910 TypeCastTraits template specialization). Previously, we would get an
2911 obscure linking error, which was sub-optimal.
2913 With this patch, you would now hit a static_assert() at build time if
2914 you tried to use is<>() / downcast<>() for a type that did not have the
2915 needed template specialization. There is also a helpful comment above
2916 the assertion letting the developer know how to add the needed template
2920 (WTF::TypeCastTraits::isOfType):
2922 2014-10-01 Commit Queue <commit-queue@webkit.org>
2924 Unreviewed, rolling out r174180, r174183, and r174186.
2925 https://bugs.webkit.org/show_bug.cgi?id=137320
2927 Broke the Mac MountainLion build. Will investigate offline.
2928 (Requested by dydz on #webkit).
2930 Reverted changesets:
2932 "Clean up: Move XPC forward declarations in JavaScriptCore to
2933 WTF SPI wrapper header"
2934 https://bugs.webkit.org/show_bug.cgi?id=137277
2935 http://trac.webkit.org/changeset/174180
2937 "Attempt to fix the build after
2938 <https://trac.webkit.org/changeset/174180>"
2939 https://bugs.webkit.org/show_bug.cgi?id=137277
2940 http://trac.webkit.org/changeset/174183
2942 "Another attempt to fix the Mac build after
2943 <https://trac.webkit.org/changeset/174180>"
2944 https://bugs.webkit.org/show_bug.cgi?id=137277
2945 http://trac.webkit.org/changeset/174186
2947 2014-10-01 Daniel Bates <dabates@apple.com>
2949 Another attempt to fix the Mac build after <https://trac.webkit.org/changeset/174180>
2950 (https://bugs.webkit.org/show_bug.cgi?id=137277)
2952 Include header AvailabilityMacros.h instead of Availability.h, which actually defines the
2953 macro __MAC_OS_X_VERSION_MIN_REQUIRED.
2955 * wtf/spi/darwin/XPCSPI.h:
2957 2014-10-01 Daniel Bates <dabates@apple.com>
2959 Attempt to fix the build after <https://trac.webkit.org/changeset/174180>
2960 (https://bugs.webkit.org/show_bug.cgi?id=137277)
2962 Include header <Availability.h> for the definition of __MAC_OS_X_VERSION_MIN_REQUIRED.
2963 Also, we want to define CONST_ON_OR_AFTER_MAC_OS_X_VERSION_1090 to be const when building
2966 * wtf/spi/darwin/XPCSPI.h:
2968 2014-10-01 Daniel Bates <dabates@apple.com>
2970 Clean up: Move XPC forward declarations in JavaScriptCore to WTF SPI wrapper header
2971 https://bugs.webkit.org/show_bug.cgi?id=137277
2973 Reviewed by Alexey Proskuryakov.
2975 Towards centralizing the declarations of XPC functions used in JavaScriptCore
2976 and WebKit2, add a header that wraps these function declarations called XPCSPI.h
2977 and use it instead of including the corresponding XPC API/SPI headers/forward
2978 declaring XPC functions. This will also aid in the effort to make WebKit2 build
2979 for iOS with the public iOS SDK.
2981 * WTF.xcodeproj/project.pbxproj:
2982 * wtf/spi/darwin/XPCSPI.h: Added.
2984 2014-10-01 Brent Fulgham <bfulgham@apple.com>
2986 [Win] 32-bit JavaScriptCore should limit itself to the C loop
2987 https://bugs.webkit.org/show_bug.cgi?id=137304
2988 <rdar://problem/18375370>
2990 Reviewed by Michael Saboff.
2992 * wtf/Platform.h: Force the C loop when building for 32-bit Windows.
2994 2014-09-30 Christophe Dumez <cdumez@apple.com>
2996 Generalize is<>() / downcast<>() support to all types
2997 https://bugs.webkit.org/show_bug.cgi?id=137243
2999 Reviewed by Benjamin Poulain.
3001 Generalize is<>() / downcast<>() support to all types, not just Nodes.
3004 * wtf/TypeCasts.h: Added.
3008 2014-09-30 Anders Carlsson <andersca@apple.com>
3010 Get the STRING_STATS codepath compiling again, and add calls to ref/deref
3011 https://bugs.webkit.org/show_bug.cgi?id=137259
3013 Reviewed by Andreas Kling.
3015 * wtf/text/StringImpl.cpp:
3016 (WTF::StringStats::removeString):
3017 (WTF::StringStats::printStats):
3018 (WTF::StringImpl::~StringImpl):
3019 * wtf/text/StringImpl.h:
3020 (WTF::StringImpl::StringImpl):
3021 (WTF::StringImpl::isSubString):
3022 (WTF::StringImpl::ref):
3023 (WTF::StringImpl::deref):
3024 (WTF::StringStats::addUpconvertedString): Deleted.
3026 2014-09-30 Daniel Bates <dabates@apple.com>
3028 REGRESSION (r172532): JSBase.h declares NSMapTable functions that are SPI
3029 https://bugs.webkit.org/show_bug.cgi?id=137170
3030 <rdar://problem/18477384>
3032 Reviewed by Geoffrey Garen.
3034 Add SPI wrapper header, NSMapTableSPI.h.
3036 Additionally, define convenience macro EXTERN_C that can be used to specify the C linkage
3037 convention for a declaration. For example, the declaration "EXTERN_C const int x;" will
3044 extern "C" const int x;
3046 when used in a C and C++ file, respectively.
3048 * WTF.xcodeproj/project.pbxproj:
3050 * wtf/spi/cocoa/NSMapTableSPI.h: Added.
3052 2014-09-29 Commit Queue <commit-queue@webkit.org>
3054 Unreviewed, rolling out r174045.
3055 https://bugs.webkit.org/show_bug.cgi?id=137231
3057 Introduced a crash during page loading tests on Mac (Requested
3058 by rniwa on #webkit).
3062 "Replace OSObjectPtr with RetainPtr/adoptOS"
3063 https://bugs.webkit.org/show_bug.cgi?id=137158
3064 http://trac.webkit.org/changeset/174045
3066 2014-09-26 Sam Weinig <sam@webkit.org>
3068 Replace OSObjectPtr with RetainPtr/adoptOS
3069 https://bugs.webkit.org/show_bug.cgi?id=137158
3071 Reviewed by Dan Bernstein.
3073 * WTF.xcodeproj/project.pbxproj:
3074 * wtf/OSObjectPtr.h: Removed.
3077 Added. This adopt function is slightly different than both adoptCF and adoptNS,
3078 in that unlike adoptCF(), it can be passed an Objective-C type (since OS objects
3079 are sometimes Objective-C objects, but not always), and unlike adoptNS() it doesn't
3080 require us to jump through hoops to appease GC (since OS objects are not Objective-C
3081 objects if GC is enabled).
3083 2014-09-24 Filip Pizlo <fpizlo@apple.com>
3085 FTL should sink object allocations
3086 https://bugs.webkit.org/show_bug.cgi?id=136330
3088 Reviewed by Oliver Hunt.
3090 Make it possible to reset a Bag.
3097 2014-09-25 Roger Fong <roger_fong@apple.com>
3099 [Windows] Unreviewed build fix. Ensure that python2.7 is used for Windows builds.
3101 * WTF.vcxproj/WTFGenerated.make:
3103 2014-09-25 Csaba Osztrogonác <ossy@webkit.org>
3105 Remove WinCE port from trunk
3106 https://bugs.webkit.org/show_bug.cgi?id=136951
3108 Reviewed by Alex Christensen.
3111 * wtf/Assertions.cpp:
3114 (WTF::weakCompareAndSwap):
3115 * wtf/CurrentTime.cpp:
3116 (WTF::lowResUTCTime):
3119 (WTF::getLocalTime):
3120 (WTF::calculateDSTOffset):
3121 * wtf/FastMalloc.cpp:
3122 * wtf/FeatureDefines.h:
3123 * wtf/OSAllocator.h:
3124 (WTF::OSAllocator::decommitAndRelease):
3126 * wtf/PlatformWin.cmake:
3128 (WTF::computeRAMSize):
3129 * wtf/RandomNumberSeed.h:
3130 (WTF::initializeRandomNumberGenerator):
3131 * wtf/StackBounds.cpp:
3132 (WTF::StackBounds::initialize):
3133 * wtf/StackBounds.h:
3134 (WTF::StackBounds::isGrowingDownward):
3135 * wtf/StdLibExtras.h:
3136 (wtf_bsearch): Deleted.
3137 * wtf/StringExtras.h:
3138 (strnicmp): Deleted.
3141 * wtf/ThreadSpecific.h:
3142 * wtf/ThreadingWin.cpp:
3143 (WTF::createThreadInternal):
3144 * wtf/WindowsExtras.h:
3145 (WTF::getRegistryValue):
3146 (WTF::getWindowPointer):
3147 (WTF::setWindowPointer):
3149 * wtf/text/WTFString.cpp:
3150 (WTF::String::format):
3152 2014-09-24 Geoffrey Garen <ggaren@apple.com>
3155 https://bugs.webkit.org/show_bug.cgi?id=132629
3157 Reviewed by Gavin Barraclough.
3159 64-bit only for now, just to try it out.
3161 * wtf/FastMalloc.cpp:
3163 2014-09-23 Geoffrey Garen <ggaren@apple.com>
3167 bmalloc should honor the FastMalloc statistics API
3168 https://bugs.webkit.org/show_bug.cgi?id=136592
3170 This didn't really work. Because we allow ranges with and without
3171 physical pages to merge, and we allow double-committing and
3172 double-decommitting, we can't rely on commit actions to track memory
3175 * wtf/FastMalloc.cpp:
3176 (WTF::fastMallocStatistics):
3178 2014-09-23 Joseph Pecoraro <pecoraro@apple.com>
3180 Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
3181 https://bugs.webkit.org/show_bug.cgi?id=136893
3183 Reviewed by Timothy Hatcher.
3185 Currently automatic inspection only happens in processes that have a
3186 debugger attached. That condition may change in the future, but this
3187 function can stand on its own in WTF. It may be useful in the future
3188 to perhaps continue though ASSERTs if you have a debugger attached.
3190 * wtf/Assertions.cpp:
3193 2014-09-22 Sam Weinig <sam@webkit.org>
3195 Eliminate redundant PtrHash specializations
3196 https://bugs.webkit.org/show_bug.cgi?id=136990
3198 Reviewed by Darin Adler.
3200 Now that we have IsSmartPtr, we can eliminate all the specializations
3201 of PtrHash that we had (for RefPtr, OwnPtr, RetainPtr, and std::unique_ptr)
3202 and instead just have one that uses GetPtrHelper.
3204 No changes of behavior intended.
3207 Remove unnecessary const_cast that Darin noticed.
3209 * wtf/HashFunctions.h:
3210 (WTF::PtrHash::hash): Deleted.
3211 (WTF::PtrHash::equal): Deleted.
3212 (WTF::PtrHash<RefPtr<P>>::hash): Deleted.
3213 (WTF::PtrHash<RefPtr<P>>::equal): Deleted.
3214 Specialize PtrHash based on whether the type is a smart pointer, and use GetPtrHelper
3215 to implement the smart pointer specialized variant.
3218 Remove include of GetPtr.h that is now included by HashFunctions.h
3221 (WTF::PtrHash<OwnPtr<P>>::hash): Deleted.
3222 (WTF::PtrHash<OwnPtr<P>>::equal): Deleted.
3223 Remove unnecessary specialization of PtrHash.
3226 (WTF::PtrHash<RetainPtr<P>>::hash): Deleted.
3227 (WTF::PtrHash<RetainPtr<P>>::equal): Deleted.
3228 Specialize IsSmartPointer for RetainPtr and remove the then unnecessary specialization of PtrHash.
3229 (This is already tested in the API test WTF/cf/RetainPtrHashing).
3231 2014-09-20 Sam Weinig <sam@webkit.org>
3233 Make possible HashSet<std::unique_ptr<>>
3234 https://bugs.webkit.org/show_bug.cgi?id=136166
3236 Reviewed by Darin Adler.
3240 (WTF::GetPtrHelper<std::unique_ptr<T>>::getPtr):
3241 Make specializing GetPtrHelper a bit cleaner (you don't have to put
3242 IsSmartPtr<T>::value everywhere any more) and add specializations for
3245 * wtf/HashFunctions.h:
3246 (WTF::PtrHash<std::unique_ptr<P>>):
3247 Add specialization for PtrHash for std::unique_ptr and set it as the DefaultHash
3252 Add overloads of find(), contains(), remove(), take() (and get() for HashMap) for "smart pointers" that
3253 take the raw pointer type as the parameter. These use SFINAE to make themselves only available
3254 when the IsSmartPtr<KeyType>::value is true.
3257 Override constructDeletedValue() and isDeletedValue() in the std::unique_ptr specialization
3258 since the default implementation depends on the type having a constructor that takes a HashTableDeletedValue
3259 and function named isHashTableDeletedValue().
3262 (WTF::OwnPtr::OwnPtr):
3263 (WTF::OwnPtr::isHashTableDeletedValue):
3264 (WTF::OwnPtr::hashTableDeletedValue):
3265 Add HashTableDeletedValue constructor/functions to allow the constructDeletedValue() and isDeletedValue()
3266 hash traits to work.
3268 (WTF::PtrHash<OwnPtr<P>>::hash):
3269 (WTF::PtrHash<OwnPtr<P>>::equal):
3270 Add specialization for PtrHash for OwnPtr and set it as the DefaultHash
3274 Update for the less verbose GetPtrHelper specialization.
3276 2014-09-19 Chris Dumez <cdumez@apple.com>
3278 Allow DOM methods to return references instead of pointers
3279 https://bugs.webkit.org/show_bug.cgi?id=136931
3281 Add support for having WTF::getPtr() transform reference arguments
3282 into raw pointers so that DOM methods can now return references when
3283 appropriate and so that the generated bindings code can handle this
3286 This patch had to alter the way getPtr() was overloaded for smart
3287 pointer types so that we don't call &p on smart pointers but p.get().
3288 This was needed because the new WTF::getPtr(T&) was being called for
3289 RefPtr<T> arguments instead of the getPtr(const RefPtr<T>&) overload.
3290 This was addressed using traits and template specialization to
3291 distinguish WTF smart pointers from other types.
3293 Reviewed by Sam Weinig.
3298 (WTF::getPtr): Deleted.
3300 (WTF::getPtr): Deleted.
3302 (WTF::getPtr): Deleted.
3305 (WTF::getPtr): Deleted.
3306 * wtf/gobject/GRefPtr.h:
3307 (WTF::getPtr): Deleted.
3309 2014-09-19 Daniel Bates <dabates@apple.com>
3311 Always assume internal SDK when building configuration Production
3312 https://bugs.webkit.org/show_bug.cgi?id=136925
3313 <rdar://problem/18362399>
3315 Reviewed by Dan Bernstein.
3317 * Configurations/Base.xcconfig:
3319 2014-09-19 Diego Pino Garcia <dpino@igalia.com>
3321 Simple ES6 feature:String prototype additions
3322 https://bugs.webkit.org/show_bug.cgi?id=131704
3324 Reviewed by Darin Adler.
3326 * wtf/text/StringImpl.cpp:
3327 (WTF::StringImpl::find):
3328 (WTF::equalInner): Added.
3329 (WTF::StringImpl::startsWith): Add implementation that supports
3330 'startOffset' parameter.
3331 (WTF::StringImpl::endsWith): Add implementation that supports
3332 'endOffset' parameter.
3333 * wtf/text/StringImpl.h:
3334 * wtf/text/WTFString.h:
3335 (WTF::String::contains): Modify current implementation to allow
3336 setting a startOffset, 0 by default.
3337 (WTF::String::startsWith):
3338 (WTF::String::endsWith):
3340 2014-09-18 Carlos Garcia Campos <cgarcia@igalia.com>
3342 [GTK] Dot not allow to create delete-on-destroy GMainLoopSources
3343 https://bugs.webkit.org/show_bug.cgi?id=136923
3345 Reviewed by Gustavo Noronha Silva.
3347 We have several asserts to ensure that delete-on-destroy sources
3348 are not misused, like not scheduling socket sources on a
3349 delete-on-destroy GMainLoopSource or not allowing to cancel them
3350 before they have been dispatched. It's better to ensure all those
3351 things at compile time, using static methods to schedule sources
3352 creating a delete-on-destroy GMainLoopSource that is not returned
3355 * wtf/gobject/GMainLoopSource.cpp:
3356 (WTF::GMainLoopSource::create): Private static method to create a
3357 delete-on-destroy GMainLoopSource.
3358 (WTF::GMainLoopSource::cancelWithoutLocking): Return early in case
3359 of delete-on-destroy source, since they can't be cancelled.
3360 (WTF::GMainLoopSource::schedule): Remove assertion to ensure
3361 socket sources are not scheduled on a delete-on-destroy GMainLoopSource.
3362 (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy):
3363 (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy):
3364 (WTF::GMainLoopSource::createAndDeleteOnDestroy): Deleted.
3365 * wtf/gobject/GMainLoopSource.h:
3366 * wtf/gtk/MainThreadGtk.cpp:
3367 (WTF::scheduleDispatchFunctionsOnMainThread): Use GMainLoopSource::scheduleAndDeleteOnDestroy()
3368 * wtf/gtk/RunLoopGtk.cpp:
3369 (WTF::RunLoop::wakeUp): Ditto.
3371 2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
3373 Unreviewed rollout r173731. Broke multiple builds.
3375 * wtf/Assertions.cpp:
3378 2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
3380 Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
3381 https://bugs.webkit.org/show_bug.cgi?id=136893
3383 Reviewed by Timothy Hatcher.
3385 Currently automatic inspection only happens in processes that have a
3386 debugger attached. That condition may change in the future, but this
3387 function can stand on its own in WTF. It may be useful in the future
3388 to perhaps continue though ASSERTs if you have a debugger attached.
3390 * wtf/Assertions.cpp:
3393 2014-09-18 Zan Dobersek <zdobersek@igalia.com>
3395 GMainLoopSource is exposed to race conditions
3396 https://bugs.webkit.org/show_bug.cgi?id=135800
3398 Reviewed by Carlos Garcia Campos.
3400 GMainLoopSource objects can be dispatching tasks on one thread
3401 while having a new task scheduled on a different thread. This
3402 can for instance occur in WebKitVideoSink, where the timeout
3403 callback can be called on main thread while at the same time
3404 it is being rescheduled on a different thread (created through
3407 The initial solution is to use GMutex to prevent parallel data
3408 access from different threads. In the future I plan to look at
3409 the possibility of creating thread-specific GMainLoopSource
3410 objects that wouldn't require the use of GMutex.
3412 GSource, GCancellable and std::function<> objects are now packed
3413 into an internal Context structure. Using the C++11 move semantics
3414 it's simple to, at the time of dispatch, move the current context
3415 out of the GMainLoopSource object in case the dispatch causes a
3416 rescheduling on that same object.
3418 Also added in the Context struct is a new GCancellable. The pointer
3419 of that object is shared with the GMainLoopSource before the Context
3420 is moved out for the callback dispatch. This makes it safe to cancel
3421 or even delete the GMainLoopSource during the dispatch and prevents
3422 use-after-delete on GMainLoopSource once the dispatch is done in
3423 the GMainLoopSource::*Callback() methods.
3425 All the schedule*() methods and the cancelWithoutLocking() method
3426 callers now lock the GMutex to ensure no one else is accessing the
3427 data at that moment. Similar goes for the dispatch methods, but those
3428 do the dispatch and possible destruction duties with the mutex unlocked.
3429 The dispatch can cause rescheduling on the same GMainLoopSource object,
3430 which must not be done with a locked mutex.
3432 * wtf/gobject/GMainLoopSource.cpp:
3433 (WTF::GMainLoopSource::GMainLoopSource):
3434 (WTF::GMainLoopSource::~GMainLoopSource):
3435 (WTF::GMainLoopSource::cancel):
3436 (WTF::GMainLoopSource::cancelWithoutLocking):
3437 (WTF::GMainLoopSource::scheduleIdleSource):
3438 (WTF::GMainLoopSource::schedule):
3439 (WTF::GMainLoopSource::scheduleTimeoutSource):
3440 (WTF::GMainLoopSource::scheduleAfterDelay):
3441 (WTF::GMainLoopSource::voidCallback):
3442 (WTF::GMainLoopSource::boolCallback):
3443 (WTF::GMainLoopSource::socketCallback):
3444 (WTF::GMainLoopSource::socketSourceCallback):
3445 (WTF::GMainLoopSource::Context::destroySource):
3446 (WTF::GMainLoopSource::reset): Deleted.
3447 (WTF::GMainLoopSource::destroy): Deleted.
3448 * wtf/gobject/GMainLoopSource.h:
3450 2014-09-17 Daniel Bates <dabates@apple.com>
3452 Unreviewed, rolling out r173695.
3454 Broke building third-party Legacy WebKit apps; will
3459 "[iOS] Make WebCore build with public iOS SDK"
3460 https://bugs.webkit.org/show_bug.cgi?id=136487
3461 http://trac.webkit.org/changeset/173695
3463 2014-09-17 Benjamin Poulain <bpoulain@apple.com>
3465 CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc.
3466 https://bugs.webkit.org/show_bug.cgi?id=136807
3468 Reviewed by Antti Koivisto.
3470 * wtf/text/AtomicString.h:
3471 (WTF::AtomicString::find):
3473 2014-09-17 Daniel Bates <dabates@apple.com>
3475 [iOS] Make WebCore build with public iOS SDK
3476 https://bugs.webkit.org/show_bug.cgi?id=136487
3478 Reviewed by David Kilzer.
3480 Define convenience macro EXTERN_C that can be used to specify the C linkage convention
3481 for a declaration. For example, the declaration "EXTERN_C const int x;" will expand to:
3487 extern "C" const int x;
3489 when used in a C and C++ file, respectively.
3493 2014-09-16 Filip Pizlo <fpizlo@apple.com>
3495 Unreviewed, disable native inlining because it causes build failures.
3499 2014-09-15 Jer Noble <jer.noble@apple.com>
3501 [Mac] Support audioSourceProvider() in MediaPlayerPrivateAVFoundationObjC
3502 https://bugs.webkit.org/show_bug.cgi?id=135042
3504 Reviewed by Eric Carlson.
3506 * wtf/Platform.h: Add WTF_USE_MEDIATOOLBOX.
3508 2014-09-15 peavo@outlook.com <peavo@outlook.com>
3510 [WinCairo] Make it easier to enable/disable GStreamer.
3511 https://bugs.webkit.org/show_bug.cgi?id=135766
3513 Reviewed by Brent Fulgham.
3515 Make it possible to enable/disable GStreamer by editing the new user macro ENABLE_GSTREAMER_WINCAIRO.
3517 * WTF.vcxproj/WTFDebugWinCairo.props: Import GStreamer property file.
3518 * WTF.vcxproj/WTFReleaseWinCairo.props: Ditto.
3519 * wtf/Platform.h: Enable GStreamer if ENABLE(GSTREAMER_WINCAIRO) is true, otherwise use Media Foundation.
3521 2014-09-10 Jon Honeycutt <jhoneycutt@apple.com>
3523 Re-add the request autocomplete feature
3525 <https://bugs.webkit.org/show_bug.cgi?id=136730>
3527 This feature was rolled out in r148731 because it was only used by
3528 Chromium. As we consider supporting this feature, roll it back in, but
3531 This rolls out r148731 (which removed the feature) with small changes
3532 needed to make the code build in ToT, to make the tests run, and to
3535 Reviewed by Andy Estes.
3537 * wtf/FeatureDefines.h:
3539 2014-09-12 Tim Horton <timothy_horton@apple.com>
3541 Swiping back from a Twitter image to Twitter flashes to the wrong position
3542 https://bugs.webkit.org/show_bug.cgi?id=136798
3543 <rdar://problem/18324338>
3545 Reviewed by Darin Adler and Sam Weinig.
3548 (WTF::RunLoop::TimerBase::startRepeating):
3549 Add a std::chrono veresion of RunLoop::TimerBase::startRepeating.
3551 2014-09-12 Geoffrey Garen <ggaren@apple.com>
3555 It broke the Membuster performance bot, and it's still slightly profligate
3559 https://bugs.webkit.org/show_bug.cgi?id=132629
3561 * wtf/FastMalloc.cpp:
3563 2014-09-11 Geoffrey Garen <ggaren@apple.com>
3566 https://bugs.webkit.org/show_bug.cgi?id=132629
3568 Reviewed by Michael Saboff.
3570 64-bit only for now, just to try it out.
3572 * wtf/FastMalloc.cpp:
3574 2014-09-09 Benjamin Poulain <bpoulain@apple.com>
3576 Disable the "unreachable-code" warning
3577 https://bugs.webkit.org/show_bug.cgi?id=136677
3579 Reviewed by Darin Adler.
3581 The warning causes various build errors depending on which Clang you are using.
3583 For example, with recent clangs, it breaks all the ARCHS dependent code like this:
3584 if (sizeof(uintptr_t) == 4)
3585 // Something for 32 bits.
3587 // Somethign for 64 bits.
3589 * Configurations/Base.xcconfig:
3591 2014-09-07 Filip Pizlo <fpizlo@apple.com>
3593 DFG should have a reusable SSA builder
3594 https://bugs.webkit.org/show_bug.cgi?id=136331
3596 Reviewed by Oliver Hunt.
3598 Update the alloc() method to use variadic templates. This makes it more natural to use.
3600 * wtf/SegmentedVector.h:
3601 (WTF::SegmentedVector::alloc):
3603 2014-09-08 Eva Balazsfalvi <evab.u-szeged@partner.samsung.com>
3606 https://bugs.webkit.org/show_bug.cgi?id=136571
3608 Reviewed by Darin Adler.
3610 * wtf/FeatureDefines.h:
3612 2014-09-08 Dan Bernstein <mitz@apple.com>
3614 HAVE(VOUCHERS) is not available outside of WebKit2
3615 https://bugs.webkit.org/show_bug.cgi?id=136637
3617 Reviewed by Tim Horton.
3619 * wtf/Platform.h: Moved the definition of HAVE_VOUCHERS from WebKit2’s config.h here.
3621 2014-09-08 Tim Horton <timothy_horton@apple.com>
3623 Try to fix the build after r173383, part 2.
3625 * wtf/OSObjectPtr.h:
3627 2014-09-08 Tim Horton <timothy_horton@apple.com>
3629 Try to fix the build after r173383.
3631 * wtf/OSObjectPtr.h:
3633 2014-09-07 Sam Weinig <sam@webkit.org>
3635 Make OSObjectPtr a bit more like RefPtr
3636 https://bugs.webkit.org/show_bug.cgi?id=136613