Changeset 191063 in webkit
- Timestamp:
- Oct 14, 2015 1:03:14 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r191048 r191063 1 2015-10-14 Alex Christensen <achristensen@webkit.org> 2 3 Add SPI for reloading without content blockers 4 https://bugs.webkit.org/show_bug.cgi?id=150058 5 rdar://problem/22742222 6 7 Reviewed by Sam Weinig. 8 9 * http/tests/contentextensions/disable-blocker-expected.txt: Removed. 10 * http/tests/contentextensions/disable-blocker.html: Removed. 11 * http/tests/contentextensions/disable-blocker.html.json: Removed. 12 _userContentExtensionsEnabled is going to be removed, and its functionality is what this test tested. 13 1 14 2015-10-14 Said Abou-Hallawa <sabouhallawa@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r191060 r191063 1 2015-10-14 Alex Christensen <achristensen@webkit.org> 2 3 Add SPI for reloading without content blockers 4 https://bugs.webkit.org/show_bug.cgi?id=150058 5 rdar://problem/22742222 6 7 Reviewed by Sam Weinig. 8 9 * loader/FrameLoader.cpp: 10 (WebCore::FrameLoader::reloadWithOverrideEncoding): 11 (WebCore::FrameLoader::reload): 12 * loader/FrameLoader.h: 13 * page/Page.h: 14 (WebCore::Page::userContentController): 15 (WebCore::Page::userContentExtensionsEnabled): Deleted. 16 (WebCore::Page::setUserContentExtensionsEnabled): Deleted. 17 * replay/UserInputBridge.cpp: 18 (WebCore::UserInputBridge::loadRequest): 19 (WebCore::UserInputBridge::reloadFrame): 20 (WebCore::UserInputBridge::stopLoadingFrame): 21 * replay/UserInputBridge.h: 22 Pass a bool from the reloadWithoutContentBlockers call to the DocumentLoader, 23 which stores the state of whether the content blockers are enabled or not. 24 Remove the state from the Page and copying the state from the Page to the DocumentLoader 25 because that caused issues with the content blockers being re-enabled at the wrong time. 26 1 27 2015-10-14 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 28 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r190611 r191063 1565 1565 } 1566 1566 1567 void FrameLoader::reload(bool endToEndReload )1567 void FrameLoader::reload(bool endToEndReload, bool contentBlockersEnabled) 1568 1568 { 1569 1569 if (!m_documentLoader) … … 1586 1586 applyShouldOpenExternalURLsPolicyToNewDocumentLoader(loader, m_documentLoader->shouldOpenExternalURLsPolicyToPropagate()); 1587 1587 1588 loader->setUserContentExtensionsEnabled(contentBlockersEnabled); 1589 1588 1590 ResourceRequest& request = loader->request(); 1589 1591 -
trunk/Source/WebCore/loader/FrameLoader.h
r190611 r191063 124 124 void submitForm(PassRefPtr<FormSubmission>); 125 125 126 WEBCORE_EXPORT void reload(bool endToEndReload = false );126 WEBCORE_EXPORT void reload(bool endToEndReload = false, bool contentBlockersEnabled = true); 127 127 WEBCORE_EXPORT void reloadWithOverrideEncoding(const String& overrideEncoding); 128 128 -
trunk/Source/WebCore/page/Page.h
r190291 r191063 429 429 WEBCORE_EXPORT void setUserContentController(UserContentController*); 430 430 431 bool userContentExtensionsEnabled() const { return m_userContentExtensionsEnabled; }432 void setUserContentExtensionsEnabled(bool enabled) { m_userContentExtensionsEnabled = enabled; }433 434 431 VisitedLinkStore& visitedLinkStore(); 435 432 WEBCORE_EXPORT void setVisitedLinkStore(Ref<VisitedLinkStore>&&); … … 637 634 MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying }; 638 635 639 bool m_userContentExtensionsEnabled { true };640 636 bool m_allowsMediaDocumentInlinePlayback { false }; 641 637 }; -
trunk/Source/WebCore/replay/UserInputBridge.cpp
r182963 r191063 243 243 } 244 244 245 void UserInputBridge::reloadFrame(Frame* frame, bool endToEndReload, InputSource)246 { 247 frame->loader().reload(endToEndReload );245 void UserInputBridge::reloadFrame(Frame* frame, bool endToEndReload, bool contentBlockersEnabled, InputSource) 246 { 247 frame->loader().reload(endToEndReload, contentBlockersEnabled); 248 248 } 249 249 -
trunk/Source/WebCore/replay/UserInputBridge.h
r182963 r191063 90 90 // Navigation APIs. 91 91 WEBCORE_EXPORT void loadRequest(const FrameLoadRequest&, InputSource source = InputSource::User); 92 WEBCORE_EXPORT void reloadFrame(Frame*, bool endToEndReload, InputSource source = InputSource::User);92 WEBCORE_EXPORT void reloadFrame(Frame*, bool endToEndReload, bool contentBlockersEnabled, InputSource = InputSource::User); 93 93 WEBCORE_EXPORT void stopLoadingFrame(Frame*, InputSource source = InputSource::User); 94 94 WEBCORE_EXPORT bool tryClosePage(InputSource source = InputSource::User); -
trunk/Source/WebKit2/ChangeLog
r191049 r191063 1 2015-10-14 Alex Christensen <achristensen@webkit.org> 2 3 Add SPI for reloading without content blockers 4 https://bugs.webkit.org/show_bug.cgi?id=150058 5 rdar://problem/22742222 6 7 Reviewed by Sam Weinig. 8 9 * Shared/WebPageCreationParameters.cpp: 10 (WebKit::WebPageCreationParameters::encode): 11 (WebKit::WebPageCreationParameters::decode): 12 * Shared/WebPageCreationParameters.h: 13 * UIProcess/API/C/WKPage.cpp: 14 (WKPageReload): 15 (WKPageReloadWithoutContentBlockers): 16 (WKPageReloadFromOrigin): 17 (WKPageTryClose): 18 (WKPageSetUserContentExtensionsEnabled): 19 (WKPageSupportsTextEncoding): 20 * UIProcess/API/C/WKPage.h: 21 * UIProcess/API/Cocoa/WKBrowsingContextController.mm: 22 (-[WKBrowsingContextController reload]): 23 (-[WKBrowsingContextController reloadFromOrigin]): 24 (-[WKBrowsingContextController applicationNameForUserAgent]): 25 * UIProcess/API/Cocoa/WKWebView.mm: 26 (-[WKWebView reload]): 27 (-[WKWebView reloadFromOrigin]): 28 (-[WKWebView _setUserContentExtensionsEnabled:]): 29 (-[WKWebView _userContentExtensionsEnabled]): 30 (-[WKWebView _webProcessIdentifier]): 31 (-[WKWebView _killWebContentProcess]): 32 (-[WKWebView _reloadWithoutContentBlockers]): 33 (-[WKWebView _killWebContentProcessAndResetState]): 34 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 35 * UIProcess/API/gtk/WebKitWebView.cpp: 36 (webkit_web_view_reload): 37 (webkit_web_view_reload_bypass_cache): 38 * UIProcess/WebFrameProxy.cpp: 39 (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): 40 * UIProcess/WebPageProxy.cpp: 41 (WebKit::WebPageProxy::stopLoading): 42 (WebKit::WebPageProxy::reload): 43 (WebKit::WebPageProxy::creationParameters): 44 (WebKit::WebPageProxy::setShouldScaleViewToFitDocument): 45 (WebKit::WebPageProxy::setUserContentExtensionsEnabled): Deleted. 46 * UIProcess/WebPageProxy.h: 47 (WebKit::WebPageProxy::userContentExtensionsEnabled): Deleted. 48 * WebProcess/WebPage/WebPage.cpp: 49 (WebKit::m_shouldDispatchFakeMouseMoveEvents): 50 (WebKit::WebPage::setDefersLoading): 51 (WebKit::WebPage::reload): 52 (WebKit::WebPage::goForward): 53 (WebKit::WebPage::createDocumentLoader): 54 (WebKit::WebPage::setShouldScaleViewToFitDocument): 55 (WebKit::WebPage::imageOrMediaDocumentSizeChanged): 56 (WebKit::WebPage::setUserContentExtensionsEnabled): Deleted. 57 * WebProcess/WebPage/WebPage.h: 58 * WebProcess/WebPage/WebPage.messages.in: 59 1 60 2015-10-14 Simon Fraser <simon.fraser@apple.com> 2 61 -
trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp
r185840 r191063 85 85 encoder << appleMailPaginationQuirkEnabled; 86 86 encoder << shouldScaleViewToFitDocument; 87 encoder << userContentExtensionsEnabled;88 87 } 89 88 … … 190 189 return false; 191 190 192 if (!decoder.decode(parameters.userContentExtensionsEnabled))193 return false;194 195 191 return true; 196 192 } -
trunk/Source/WebKit2/Shared/WebPageCreationParameters.h
r185840 r191063 131 131 bool appleMailPaginationQuirkEnabled; 132 132 bool shouldScaleViewToFitDocument; 133 bool userContentExtensionsEnabled;134 133 }; 135 134 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r190823 r191063 229 229 void WKPageReload(WKPageRef pageRef) 230 230 { 231 toImpl(pageRef)->reload(false); 231 const bool reloadFromOrigin = false; 232 const bool contentBlockersEnabled = true; 233 toImpl(pageRef)->reload(reloadFromOrigin, contentBlockersEnabled); 234 } 235 236 void WKPageReloadWithoutContentBlockers(WKPageRef pageRef) 237 { 238 const bool reloadFromOrigin = false; 239 const bool contentBlockersEnabled = false; 240 toImpl(pageRef)->reload(reloadFromOrigin, contentBlockersEnabled); 232 241 } 233 242 234 243 void WKPageReloadFromOrigin(WKPageRef pageRef) 235 244 { 236 toImpl(pageRef)->reload(true); 245 const bool reloadFromOrigin = true; 246 const bool contentBlockersEnabled = true; 247 toImpl(pageRef)->reload(reloadFromOrigin, contentBlockersEnabled); 237 248 } 238 249 … … 364 375 void WKPageSetUserContentExtensionsEnabled(WKPageRef pageRef, bool enabled) 365 376 { 366 toImpl(pageRef)->setUserContentExtensionsEnabled(enabled);377 // FIXME: Remove this function once it is no longer used. 367 378 } 368 379 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.h
r188228 r191063 84 84 WK_EXPORT void WKPageStopLoading(WKPageRef page); 85 85 WK_EXPORT void WKPageReload(WKPageRef page); 86 WK_EXPORT void WKPageReloadWithoutContentBlockers(WKPageRef page); 86 87 WK_EXPORT void WKPageReloadFromOrigin(WKPageRef page); 87 88 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm
r191013 r191063 188 188 - (void)reload 189 189 { 190 _page->reload(false); 190 const bool reloadFromOrigin = false; 191 const bool contentBlockersEnabled = true; 192 _page->reload(reloadFromOrigin, contentBlockersEnabled); 191 193 } 192 194 193 195 - (void)reloadFromOrigin 194 196 { 195 _page->reload(true); 197 const bool reloadFromOrigin = true; 198 const bool contentBlockersEnabled = true; 199 _page->reload(reloadFromOrigin, contentBlockersEnabled); 196 200 } 197 201 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r190841 r191063 564 564 - (WKNavigation *)reload 565 565 { 566 auto navigation = _page->reload(false); 566 const bool reloadFromOrigin = false; 567 const bool contentBlockersEnabled = true; 568 auto navigation = _page->reload(reloadFromOrigin, contentBlockersEnabled); 567 569 if (!navigation) 568 570 return nil; … … 573 575 - (WKNavigation *)reloadFromOrigin 574 576 { 575 auto navigation = _page->reload(true); 577 const bool reloadFromOrigin = true; 578 const bool contentBlockersEnabled = true; 579 auto navigation = _page->reload(reloadFromOrigin, contentBlockersEnabled); 576 580 if (!navigation) 577 581 return nil; … … 2027 2031 - (void)_setUserContentExtensionsEnabled:(BOOL)userContentExtensionsEnabled 2028 2032 { 2029 _page->setUserContentExtensionsEnabled(userContentExtensionsEnabled);2033 // This is kept for binary compatibility with iOS 9. 2030 2034 } 2031 2035 2032 2036 - (BOOL)_userContentExtensionsEnabled 2033 2037 { 2034 return _page->userContentExtensionsEnabled(); 2038 // This is kept for binary compatibility with iOS 9. 2039 return true; 2035 2040 } 2036 2041 … … 2046 2051 2047 2052 _page->process().terminate(); 2053 } 2054 2055 - (WKNavigation *)_reloadWithoutContentBlockers 2056 { 2057 const bool reloadFromOrigin = false; 2058 const bool contentBlockersEnabled = false; 2059 auto navigation = _page->reload(reloadFromOrigin, contentBlockersEnabled); 2060 if (!navigation) 2061 return nil; 2062 2063 return [wrapper(*navigation.release().leakRef()) autorelease]; 2048 2064 } 2049 2065 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r190823 r191063 188 188 #endif 189 189 190 - (WKNavigation *)_reloadWithoutContentBlockers WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA); 191 190 192 - (void)_killWebContentProcessAndResetState; 191 193 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
r190823 r191063 2475 2475 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); 2476 2476 2477 getPage(webView)->reload(false); 2477 const bool reloadFromOrigin = false; 2478 const bool contentBlockersEnabled = true; 2479 getPage(webView)->reload(reloadFromOrigin, contentBlockersEnabled); 2478 2480 } 2479 2481 … … 2489 2491 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); 2490 2492 2491 getPage(webView)->reload(true); 2493 const bool reloadFromOrigin = true; 2494 const bool contentBlockersEnabled = true; 2495 getPage(webView)->reload(reloadFromOrigin, contentBlockersEnabled); 2492 2496 } 2493 2497 -
trunk/Source/WebKit2/UIProcess/WebFrameProxy.cpp
r188011 r191063 248 248 ASSERT(page); 249 249 m_contentFilterUnblockHandler.requestUnblockAsync([page](bool unblocked) { 250 if (unblocked) 251 page->reload(false); 250 if (unblocked) { 251 const bool reloadFromOrigin = false; 252 const bool contentBlockersEnabled = true; 253 page->reload(reloadFromOrigin, contentBlockersEnabled); 254 } 252 255 }); 253 256 return true; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r190823 r191063 1049 1049 } 1050 1050 1051 RefPtr<API::Navigation> WebPageProxy::reload(bool reloadFromOrigin )1051 RefPtr<API::Navigation> WebPageProxy::reload(bool reloadFromOrigin, bool contentBlockersEnabled) 1052 1052 { 1053 1053 SandboxExtension::Handle sandboxExtensionHandle; … … 1069 1069 auto navigation = m_navigationState->createReloadNavigation(); 1070 1070 1071 m_process->send(Messages::WebPage::Reload(navigation->navigationID(), reloadFromOrigin, sandboxExtensionHandle), m_pageID);1071 m_process->send(Messages::WebPage::Reload(navigation->navigationID(), reloadFromOrigin, contentBlockersEnabled, sandboxExtensionHandle), m_pageID); 1072 1072 m_process->responsivenessTimer()->start(); 1073 1073 … … 5168 5168 #endif 5169 5169 parameters.shouldScaleViewToFitDocument = m_shouldScaleViewToFitDocument; 5170 parameters.userContentExtensionsEnabled = m_userContentExtensionsEnabled;5171 5170 5172 5171 return parameters; … … 6104 6103 } 6105 6104 6106 void WebPageProxy::setUserContentExtensionsEnabled(bool userContentExtensionsEnabled)6107 {6108 if (m_userContentExtensionsEnabled == userContentExtensionsEnabled)6109 return;6110 6111 m_userContentExtensionsEnabled = userContentExtensionsEnabled;6112 6113 if (!isValid())6114 return;6115 6116 m_process->send(Messages::WebPage::SetUserContentExtensionsEnabled(userContentExtensionsEnabled), m_pageID);6117 }6118 6119 6105 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r190823 r191063 363 363 364 364 void stopLoading(); 365 RefPtr<API::Navigation> reload(bool reloadFromOrigin );365 RefPtr<API::Navigation> reload(bool reloadFromOrigin, bool contentBlockersEnabled); 366 366 367 367 RefPtr<API::Navigation> goForward(); … … 651 651 void setShouldScaleViewToFitDocument(bool); 652 652 653 bool userContentExtensionsEnabled() { return m_userContentExtensionsEnabled; }654 void setUserContentExtensionsEnabled(bool);655 656 653 float deviceScaleFactor() const; 657 654 void setIntrinsicDeviceScaleFactor(float); … … 1771 1768 #endif 1772 1769 1773 bool m_userContentExtensionsEnabled { true };1774 1775 1770 #if PLATFORM(IOS) 1776 1771 bool m_hasDeferredStartAssistingNode { false }; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r190998 r191063 521 521 scaleView(parameters.viewScaleFactor); 522 522 523 m_page->setUserContentExtensionsEnabled(parameters.userContentExtensionsEnabled);524 525 523 #if PLATFORM(IOS) 526 524 m_page->settings().setContentDispositionAttachmentSandboxEnabled(true); … … 1165 1163 } 1166 1164 1167 void WebPage::reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle& sandboxExtensionHandle)1165 void WebPage::reload(uint64_t navigationID, bool reloadFromOrigin, bool contentBlockersEnabled, const SandboxExtension::Handle& sandboxExtensionHandle) 1168 1166 { 1169 1167 SendStopResponsivenessTimer stopper(this); … … 1173 1171 1174 1172 m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle); 1175 corePage()->userInputBridge().reloadFrame(m_mainFrame->coreFrame(), reloadFromOrigin );1173 corePage()->userInputBridge().reloadFrame(m_mainFrame->coreFrame(), reloadFromOrigin, contentBlockersEnabled); 1176 1174 } 1177 1175 … … 4904 4902 m_pendingNavigationID = 0; 4905 4903 } 4906 if (frame.page())4907 documentLoader->setUserContentExtensionsEnabled(frame.page()->userContentExtensionsEnabled());4908 4904 } 4909 4905 … … 5006 5002 } 5007 5003 5008 void WebPage::setUserContentExtensionsEnabled(bool userContentExtensionsEnabled)5009 {5010 if (!m_page)5011 return;5012 5013 m_page->setUserContentExtensionsEnabled(userContentExtensionsEnabled);5014 }5015 5016 5004 void WebPage::imageOrMediaDocumentSizeChanged(const IntSize& newSize) 5017 5005 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r190604 r191063 983 983 void loadWebArchiveData(const IPC::DataReference&, const UserData&); 984 984 void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint); 985 void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);985 void reload(uint64_t navigationID, bool reloadFromOrigin, bool contentBlockersEnabled, const SandboxExtension::Handle&); 986 986 void goForward(uint64_t navigationID, uint64_t); 987 987 void goBack(uint64_t navigationID, uint64_t); … … 1161 1161 1162 1162 void setShouldScaleViewToFitDocument(bool); 1163 void setUserContentExtensionsEnabled(bool);1164 1163 1165 1164 void pageStoppedScrolling(); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r190604 r191063 133 133 NavigateToPDFLinkWithSimulatedClick(String url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint) 134 134 135 Reload(uint64_t navigationID, bool reloadFromOrigin, WebKit::SandboxExtension::Handle sandboxExtensionHandle)135 Reload(uint64_t navigationID, bool reloadFromOrigin, bool contentBlockersEnabled, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 136 136 StopLoading() 137 137 … … 429 429 ClearWheelEventTestTrigger() 430 430 SetShouldScaleViewToFitDocument(bool shouldScaleViewToFitDocument) 431 SetUserContentExtensionsEnabled(bool userContentExtensionsEnabled)432 431 433 432 #if ENABLE(VIDEO) && USE(GSTREAMER) -
trunk/Tools/ChangeLog
r191058 r191063 1 2015-10-14 Alex Christensen <achristensen@webkit.org> 2 3 Add SPI for reloading without content blockers 4 https://bugs.webkit.org/show_bug.cgi?id=150058 5 rdar://problem/22742222 6 7 Reviewed by Sam Weinig. 8 9 * WebKitTestRunner/cocoa/TestControllerCocoa.mm: 10 (WTR::TestController::cocoaResetStateToConsistentValues): 11 * WebKitTestRunner/mac/TestControllerMac.mm: 12 (WTR::TestController::platformConfigureViewForTest): 13 1 14 2015-10-14 Mark Lam <mark.lam@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
r190510 r191063 121 121 [[_WKUserContentExtensionStore defaultStore] _removeAllContentExtensions]; 122 122 123 if (PlatformWebView* webView = mainWebView()) {123 if (PlatformWebView* webView = mainWebView()) 124 124 [webView->platformView().configuration.userContentController _removeAllUserContentFilters]; 125 webView->platformView()._userContentExtensionsEnabled = true;126 }127 125 #endif 128 126 } -
trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm
r190848 r191063 124 124 }]; 125 125 platformRunUntil(doneCompiling, 0); 126 127 // This is for http/tests/contentextensions/disable-blocker.html128 if (!test.urlContains("disable-blocker"))129 return;130 mainWebView()->platformView()._userContentExtensionsEnabled = false;131 126 #endif 132 127 }
Note: See TracChangeset
for help on using the changeset viewer.