Changeset 220457 in webkit
- Timestamp:
- Aug 9, 2017 8:59:01 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r220449 r220457 1 2017-08-09 Sam Weinig <sam@webkit.org> 2 3 WTF::Function does not allow for reference / non-default constructible return types 4 https://bugs.webkit.org/show_bug.cgi?id=175244 5 6 Reviewed by Chris Dumez. 7 8 * runtime/ArrayBuffer.cpp: 9 (JSC::ArrayBufferContents::transferTo): 10 Call reset(), rather than clear() to avoid the call to destroy() in clear(). The 11 destroy call needed to be a no-op anyway, since the data is being moved. 12 1 13 2017-08-09 Oleksandr Skachkov <gskachkov@gmail.com> 2 14 -
trunk/Source/JavaScriptCore/runtime/ArrayBuffer.cpp
r220352 r220457 133 133 other.m_destructor = WTFMove(m_destructor); 134 134 other.m_shared = m_shared; 135 clear();135 reset(); 136 136 } 137 137 -
trunk/Source/WTF/ChangeLog
r220416 r220457 1 2017-08-09 Sam Weinig <sam@webkit.org> 2 3 WTF::Function does not allow for reference / non-default constructible return types 4 https://bugs.webkit.org/show_bug.cgi?id=175244 5 6 Reviewed by Chris Dumez. 7 8 When Function, then NoncopyableFunction, was templatized to allow non-void return values 9 in r201493, it maintained the behavior of being callable even if the Function was null. 10 To accomplish this, when null, the default construction of the return parameter was used. 11 This means Function can't be used with return types that are not default constructible, 12 such as reference types and Ref. 13 14 This behavior of returning something when null is surprising, as this is not how normal 15 functions behave, and not very useful. Instead, we now assert that the function is not 16 null when being called. 17 18 * wtf/Function.h: 19 (WTF::Function operator(...)): 20 Instead of allowing a null callable wrapper by returning the default construction of 21 the return type, assert that the wrapper is there when calling a Function. 22 1 23 2017-08-08 Filip Pizlo <fpizlo@apple.com> 2 24 -
trunk/Source/WTF/wtf/Function.h
r218816 r220457 53 53 Out operator()(In... in) const 54 54 { 55 if (m_callableWrapper) 56 return m_callableWrapper->call(std::forward<In>(in)...); 57 return Out(); 55 ASSERT(m_callableWrapper); 56 return m_callableWrapper->call(std::forward<In>(in)...); 58 57 } 59 58 -
trunk/Source/WebCore/ChangeLog
r220456 r220457 1 2017-08-09 Sam Weinig <sam@webkit.org> 2 3 WTF::Function does not allow for reference / non-default constructible return types 4 https://bugs.webkit.org/show_bug.cgi?id=175244 5 6 Reviewed by Chris Dumez. 7 8 * bindings/js/JSCustomElementInterface.h: 9 (WebCore::JSCustomElementInterface::invokeCallback): 10 Update the default value for the addArguments parameter to be an empty lambda, rather than 11 default initialization, which leads to a null WTF::Function. This allows us to remove support 12 for calling null WTF::Function. No change in behavior. 13 1 14 2017-08-09 Andy Estes <aestes@apple.com> 2 15 -
trunk/Source/WebCore/bindings/js/JSCustomElementInterface.h
r216769 r220457 95 95 RefPtr<Element> tryToConstructCustomElement(Document&, const AtomicString&); 96 96 97 void invokeCallback(Element&, JSC::JSObject* callback, const WTF::Function<void(JSC::ExecState*, JSDOMGlobalObject*, JSC::MarkedArgumentBuffer&)>& addArguments = { });97 void invokeCallback(Element&, JSC::JSObject* callback, const WTF::Function<void(JSC::ExecState*, JSDOMGlobalObject*, JSC::MarkedArgumentBuffer&)>& addArguments = [](JSC::ExecState*, JSDOMGlobalObject*, JSC::MarkedArgumentBuffer&) { }); 98 98 99 99 QualifiedName m_name; -
trunk/Source/WebKit/ChangeLog
r220443 r220457 1 2017-08-09 Sam Weinig <sam@webkit.org> 2 3 WTF::Function does not allow for reference / non-default constructible return types 4 https://bugs.webkit.org/show_bug.cgi?id=175244 5 6 Reviewed by Chris Dumez. 7 8 * UIProcess/WebResourceLoadStatisticsStore.h: 9 Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 10 empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows 11 us to remove support for calling null WTF::Function. No change in behavior. 12 1 13 2017-08-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 14 -
trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h
r219904 r220457 61 61 public: 62 62 using UpdateCookiePartitioningForDomainsHandler = WTF::Function<void(const Vector<String>& domainsToRemove, const Vector<String>& domainsToAdd, ShouldClearFirst)>; 63 static Ref<WebResourceLoadStatisticsStore> create(const String& resourceLoadStatisticsDirectory, Function<void (const String&)>&& testingCallback, UpdateCookiePartitioningForDomainsHandler&& updateCookiePartitioningForDomainsHandler = { })63 static Ref<WebResourceLoadStatisticsStore> create(const String& resourceLoadStatisticsDirectory, Function<void (const String&)>&& testingCallback, UpdateCookiePartitioningForDomainsHandler&& updateCookiePartitioningForDomainsHandler = [](const Vector<String>&, const Vector<String>&, ShouldClearFirst) { }) 64 64 { 65 65 return adoptRef(*new WebResourceLoadStatisticsStore(resourceLoadStatisticsDirectory, WTFMove(testingCallback), WTFMove(updateCookiePartitioningForDomainsHandler)));
Note: See TracChangeset
for help on using the changeset viewer.