WebKit Bugzilla
Attachment 356760 Details for
Bug 192481
: Injected bundle for WebKitTestRunner leaks WKTypeRef objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1
bug-192481-20181206161532.patch (text/plain), 23.07 KB, created by
David Kilzer (:ddkilzer)
on 2018-12-06 16:15:33 PST
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-12-06 16:15:33 PST
Size:
23.07 KB
patch
obsolete
>Subversion Revision: 238873 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index c745a0a606b8ebd6ddd775a42c3841c40bd1605b..c3391c5c47a3b2dc1d44a0947f429cfebb759da7 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,46 @@ >+2018-12-06 David Kilzer <ddkilzer@apple.com> >+ >+ Injected bundle for WebKitTestRunner leaks WKTypeRef objects >+ <https://webkit.org/b/192481> >+ <rdar://problem/46539059> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch: >+ - Fixes leaks in various injected bundle methods that return +1 >+ retained WKTypeRef objects via pointer. >+ - Asserts the returned object is the expected WKTypeRef. >+ - Replaces 0 with nullptr in many places. >+ >+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: >+ (WTR::InjectedBundle::didCreatePage): >+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp: >+ (WTR::TestRunner::shouldDumpPixels const): >+ (WTR::TestRunner::whatToDump const): >+ (WTR::TestRunner::shouldWaitUntilDone const): >+ (WTR::TestRunner::shouldDumpFrameLoadCallbacks): >+ (WTR::TestRunner::didReceiveServerRedirectForProvisionalNavigation const): >+ (WTR::TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation): >+ (WTR::TestRunner::secureEventInputIsEnabled const): >+ (WTR::TestRunner::isStatisticsPrevalentResource): >+ (WTR::TestRunner::isStatisticsVeryPrevalentResource): >+ (WTR::TestRunner::isStatisticsRegisteredAsSubresourceUnder): >+ (WTR::TestRunner::isStatisticsRegisteredAsSubFrameUnder): >+ (WTR::TestRunner::isStatisticsRegisteredAsRedirectingTo): >+ (WTR::TestRunner::isStatisticsHasHadUserInteraction): >+ (WTR::TestRunner::isStatisticsGrandfathered): >+ (WTR::TestRunner::statisticsProcessStatisticsAndDataRecords): >+ (WTR::TestRunner::statisticsUpdateCookieBlocking): >+ (WTR::TestRunner::statisticsSubmitTelemetry): >+ (WTR::TestRunner::statisticsClearInMemoryAndPersistentStore): >+ (WTR::TestRunner::statisticsClearThroughWebsiteDataRemoval): >+ (WTR::TestRunner::statisticsResetToConsistentState): >+ (WTR::TestRunner::getAllStorageAccessEntries): >+ (WTR::TestRunner::hasDOMCache): >+ (WTR::TestRunner::domCacheSize): >+ (WTR::TestRunner::injectUserScript): >+ (WTR::TestRunner::keyExistsInKeychain): >+ > 2018-12-04 Chris Dumez <cdumez@apple.com> > > ProcessSwap.UseSessionCookiesAfterProcessSwapInPrivateBrowsing API test is failing >diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >index f7e4e9b2fc58558f4cd60254ea74185d13ce81df..e95400437dec2a1619792d1ea0cca0fdee45f20a 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >@@ -122,13 +122,13 @@ void InjectedBundle::didCreatePage(WKBundlePageRef page) > WKTypeRef result = 0; > WKBundlePostSynchronousMessage(m_bundle, messsageName.get(), 0, &result); > ASSERT(WKGetTypeID(result) == WKDictionaryGetTypeID()); >- WKDictionaryRef initializationDictionary = static_cast<WKDictionaryRef>(result); >+ WKRetainPtr<WKDictionaryRef> initializationDictionary(AdoptWK, static_cast<WKDictionaryRef>(result)); > > WKRetainPtr<WKStringRef> resumeTestingKey(AdoptWK, WKStringCreateWithUTF8CString("ResumeTesting")); >- WKTypeRef resumeTestingValue = WKDictionaryGetItemForKey(initializationDictionary, resumeTestingKey.get()); >+ WKTypeRef resumeTestingValue = WKDictionaryGetItemForKey(initializationDictionary.get(), resumeTestingKey.get()); > ASSERT(WKGetTypeID(resumeTestingValue) == WKBooleanGetTypeID()); > if (WKBooleanGetValue(static_cast<WKBooleanRef>(resumeTestingValue))) >- beginTesting(initializationDictionary, BegingTestingMode::Resume); >+ beginTesting(initializationDictionary.get(), BegingTestingMode::Resume); > } > > void InjectedBundle::willDestroyPage(WKBundlePageRef page) >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >index bd68ad158939a1fe02230aed79b3a759edabd336..09afd8de0998fefd45db3cffc1d9d57d06eef3e4 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >@@ -128,10 +128,11 @@ void TestRunner::displayAndTrackRepaints() > bool TestRunner::shouldDumpPixels() const > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("GetDumpPixels")); >- WKTypeRef result = 0; >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, &result); >- ASSERT(WKGetTypeID(result) == WKBooleanGetTypeID()); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(result)); >+ WKTypeRef returnData = nullptr; >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, &returnData); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > void TestRunner::setDumpPixels(bool dumpPixels) >@@ -151,11 +152,11 @@ void TestRunner::dumpAsText(bool dumpPixels) > WhatToDump TestRunner::whatToDump() const > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("GetWhatToDump")); >- WKTypeRef result = 0; >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, &result); >- ASSERT(WKGetTypeID(result) == WKUInt64GetTypeID()); >- auto uint64value = WKUInt64GetValue(static_cast<WKUInt64Ref>(result)); >- return static_cast<WhatToDump>(uint64value); >+ WKTypeRef returnData = nullptr; >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, &returnData); >+ ASSERT(WKGetTypeID(returnData) == WKUInt64GetTypeID()); >+ WKRetainPtr<WKUInt64Ref> result(AdoptWK, static_cast<WKUInt64Ref>(returnData)); >+ return static_cast<WhatToDump>(WKUInt64GetValue(result.get())); > } > > void TestRunner::setWhatToDump(WhatToDump whatToDump) >@@ -206,10 +207,11 @@ void TestRunner::setWaitUntilDone(bool value) > bool TestRunner::shouldWaitUntilDone() const > { > WKRetainPtr<WKStringRef> messsageName(AdoptWK, WKStringCreateWithUTF8CString("GetWaitUntilDone")); >- WKTypeRef result = 0; >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), 0, &result); >- ASSERT(WKGetTypeID(result) == WKBooleanGetTypeID()); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(result)); >+ WKTypeRef returnData = nullptr; >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), nullptr, &returnData); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > void TestRunner::waitToDumpWatchdogTimerFired() >@@ -263,10 +265,11 @@ void TestRunner::setShouldDumpFrameLoadCallbacks(bool value) > bool TestRunner::shouldDumpFrameLoadCallbacks() > { > WKRetainPtr<WKStringRef> messsageName(AdoptWK, WKStringCreateWithUTF8CString("GetDumpFrameLoadCallbacks")); >- WKTypeRef result = 0; >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), 0, &result); >- ASSERT(WKGetTypeID(result) == WKBooleanGetTypeID()); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(result)); >+ WKTypeRef returnData = nullptr; >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messsageName.get(), nullptr, &returnData); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > unsigned TestRunner::imageCountInGeneralPasteboard() const >@@ -749,16 +752,17 @@ void TestRunner::setDefersLoading(bool shouldDeferLoading) > bool TestRunner::didReceiveServerRedirectForProvisionalNavigation() const > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DidReceiveServerRedirectForProvisionalNavigation")); >- WKTypeRef returnData = 0; >- >- WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), 0, &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ WKTypeRef returnData = nullptr; >+ WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > void TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation() > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ClearDidReceiveServerRedirectForProvisionalNavigation")); >- WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), 0, nullptr); >+ WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr); > } > > void TestRunner::setPageVisibility(JSStringRef state) >@@ -1203,10 +1207,11 @@ void TestRunner::setAuthenticationPassword(JSStringRef password) > bool TestRunner::secureEventInputIsEnabled() const > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SecureEventInputIsEnabled")); >- WKTypeRef returnData = 0; >- >- WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), 0, &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ WKTypeRef returnData = nullptr; >+ WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, &returnData); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > void TestRunner::setBlockAllPlugins(bool shouldBlock) >@@ -1508,18 +1513,22 @@ bool TestRunner::isStatisticsPrevalentResource(JSStringRef hostName) > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsPrevalentResource")); > WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName)); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > bool TestRunner::isStatisticsVeryPrevalentResource(JSStringRef hostName) > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsVeryPrevalentResource")); > WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName)); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > bool TestRunner::isStatisticsRegisteredAsSubresourceUnder(JSStringRef subresourceHost, JSStringRef topFrameHost) >@@ -1543,9 +1552,11 @@ bool TestRunner::isStatisticsRegisteredAsSubresourceUnder(JSStringRef subresourc > > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsSubresourceUnder")); > WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size())); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > bool TestRunner::isStatisticsRegisteredAsSubFrameUnder(JSStringRef subFrameHost, JSStringRef topFrameHost) >@@ -1569,9 +1580,11 @@ bool TestRunner::isStatisticsRegisteredAsSubFrameUnder(JSStringRef subFrameHost, > > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsSubFrameUnder")); > WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size())); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > bool TestRunner::isStatisticsRegisteredAsRedirectingTo(JSStringRef hostRedirectedFrom, JSStringRef hostRedirectedTo) >@@ -1595,9 +1608,11 @@ bool TestRunner::isStatisticsRegisteredAsRedirectingTo(JSStringRef hostRedirecte > > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsRedirectingTo")); > WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size())); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > void TestRunner::setStatisticsHasHadUserInteraction(JSStringRef hostName, bool value, JSValueRef completionHandler) >@@ -1638,9 +1653,11 @@ bool TestRunner::isStatisticsHasHadUserInteraction(JSStringRef hostName) > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsHasHadUserInteraction")); > WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName)); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > void TestRunner::setStatisticsGrandfathered(JSStringRef hostName, bool value) >@@ -1674,9 +1691,11 @@ bool TestRunner::isStatisticsGrandfathered(JSStringRef hostName) > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsGrandfathered")); > WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(hostName)); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > void TestRunner::setStatisticsSubframeUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName) >@@ -1884,7 +1903,7 @@ void TestRunner::statisticsNotifyObserver() > void TestRunner::statisticsProcessStatisticsAndDataRecords() > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsProcessStatisticsAndDataRecords")); >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); > } > > void TestRunner::statisticsUpdateCookieBlocking(JSValueRef completionHandler) >@@ -1892,7 +1911,7 @@ void TestRunner::statisticsUpdateCookieBlocking(JSValueRef completionHandler) > cacheTestRunnerCallback(StatisticsDidSetBlockCookiesForHostCallbackID, completionHandler); > > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsUpdateCookieBlocking")); >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); > } > > void TestRunner::statisticsCallDidSetBlockCookiesForHostCallback() >@@ -1903,7 +1922,7 @@ void TestRunner::statisticsCallDidSetBlockCookiesForHostCallback() > void TestRunner::statisticsSubmitTelemetry() > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsSubmitTelemetry")); >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); > } > > void TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool value) >@@ -1960,7 +1979,7 @@ void TestRunner::statisticsClearInMemoryAndPersistentStore(JSValueRef callback) > cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback); > > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStore")); >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); > } > > void TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours(unsigned hours, JSValueRef callback) >@@ -1977,7 +1996,7 @@ void TestRunner::statisticsClearThroughWebsiteDataRemoval(JSValueRef callback) > cacheTestRunnerCallback(StatisticsDidClearThroughWebsiteDataRemovalCallbackID, callback); > > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsClearThroughWebsiteDataRemoval")); >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); > } > > void TestRunner::setStatisticsCacheMaxAgeCap(double seconds) >@@ -1997,7 +2016,7 @@ void TestRunner::statisticsResetToConsistentState(JSValueRef completionHandler) > cacheTestRunnerCallback(StatisticsDidResetToConsistentStateCallbackID, completionHandler); > > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsResetToConsistentState")); >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); > } > > void TestRunner::statisticsCallDidResetToConsistentStateCallback() >@@ -2049,7 +2068,7 @@ void TestRunner::getAllStorageAccessEntries(JSValueRef callback) > cacheTestRunnerCallback(AllStorageAccessEntriesCallbackID, callback); > > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("GetAllStorageAccessEntries")); >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); > } > > void TestRunner::callDidReceiveAllStorageAccessEntriesCallback(Vector<String>& domains) >@@ -2337,16 +2356,18 @@ bool TestRunner::hasDOMCache(JSStringRef origin) > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("HasDOMCache")); > WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(origin)); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > uint64_t TestRunner::domCacheSize(JSStringRef origin) > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DOMCacheSize")); > WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(origin)); >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); > return WKUInt64GetValue(static_cast<WKUInt64Ref>(returnData)); > } >@@ -2373,8 +2394,7 @@ void TestRunner::injectUserScript(JSStringRef script) > { > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("InjectUserScript")); > WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithJSString(script)); >- WKTypeRef returnData = 0; >- WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData); >+ WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), nullptr); > } > > void TestRunner::sendDisplayConfigurationChangedMessageForTesting() >@@ -2629,9 +2649,11 @@ bool TestRunner::keyExistsInKeychain(JSStringRef attrLabel, JSStringRef applicat > WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("KeyExistsInKeychain")); > WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size())); > >- WKTypeRef returnData = 0; >+ WKTypeRef returnData = nullptr; > WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), &returnData); >- return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); >+ ASSERT(WKGetTypeID(returnData) == WKBooleanGetTypeID()); >+ WKRetainPtr<WKBooleanRef> result(AdoptWK, static_cast<WKBooleanRef>(returnData)); >+ return WKBooleanGetValue(result.get()); > } > > } // namespace WTR
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
simon.fraser
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192481
: 356760 |
356773