Changeset 171252 in webkit
- Timestamp:
- Jul 18, 2014 5:19:26 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r171250 r171252 1 2014-07-18 Andy Estes <aestes@apple.com> 2 3 [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad 4 https://bugs.webkit.org/show_bug.cgi?id=135072 5 <rdar://problem/17528188> 6 7 Reviewed by David Kilzer. 8 9 No new tests. Content filtering is not testable from WebKit. 10 11 * WebCore.exp.in: Exported necessary ContentFilter symbols. 12 * loader/DocumentLoader.cpp: 13 (WebCore::DocumentLoader::finishedLoading): Called FrameLoaderClient::contentFilterDidBlockLoad(). 14 (WebCore::DocumentLoader::responseReceived): Created a new ContentFilter. 15 (WebCore::DocumentLoader::dataReceived): Called FrameLoaderClient::contentFilterDidBlockLoad(). 16 (WebCore::DocumentLoader::setContentFilterForBlockedLoad): Deleted. 17 (WebCore::DocumentLoader::handleContentFilterRequest): Deleted. 18 * loader/DocumentLoader.h: 19 * loader/FrameLoaderClient.h: 20 (WebCore::FrameLoaderClient::contentFilterDidBlockLoad): 21 * loader/PolicyChecker.cpp: 22 (WebCore::PolicyChecker::checkNavigationPolicy): Removed the check for unblock navigations, as this is now 23 handled at the WebKit layer. 24 * platform/ContentFilter.h: ContentFilter no longer needs to be RefCounted, so made various changes in order to 25 make it compatible with unique_ptr. 26 * platform/ios/ContentFilterIOS.mm: 27 (WebCore::scheme): Changed from a public member function to a static inline free function. 28 (WebCore::ContentFilter::handleUnblockRequestAndDispatchIfSuccessful): Renamed from requestUnblockAndDispatchIfSuccessful. 29 * platform/mac/ContentFilterMac.mm: 30 (WebCore::ContentFilter::ContentFilter): Added a default constructor for use during message decoding. 31 (WebCore::ContentFilter::addData): Removed calls to ref() and deref(). These were never actually needed since 32 we were dispatching the block synchronously. 33 (WebCore::ContentFilter::finishedAddingData): Ditto. 34 (WebCore::ContentFilter::encode): Encoded m_platformContentFilter to the NSKeyedArchiver if it conforms to NSSecureCoding. 35 (WebCore::ContentFilter::decode): Decoded m_platformContentFilter from the NSKeyedUnarchiver if it conforms to NSSecureCoding. 36 (WebCore::ContentFilter::create): Deleted. 37 1 38 2014-07-18 Simon Fraser <simon.fraser@apple.com> 2 39 -
trunk/Source/WebCore/WebCore.exp.in
r171203 r171252 3463 3463 __ZN7WebCore4Page11setViewModeENS0_8ViewModeE 3464 3464 #endif 3465 3466 #if USE(CONTENT_FILTERING) 3467 #if PLATFORM(IOS) 3468 __ZN7WebCore13ContentFilter43handleUnblockRequestAndDispatchIfSuccessfulERKNS_15ResourceRequestENSt3__18functionIFvvEEE 3469 #endif 3470 __ZN7WebCore13ContentFilter6decodeEP17NSKeyedUnarchiverRS0_ 3471 __ZN7WebCore13ContentFilterC1Ev 3472 __ZN7WebCore13ContentFilterD1Ev 3473 __ZNK7WebCore13ContentFilter6encodeEP15NSKeyedArchiver 3474 #endif -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r170984 r171252 414 414 415 415 if (m_contentFilter->didBlockData()) 416 setContentFilterForBlockedLoad(m_contentFilter);416 frameLoader()->client().contentFilterDidBlockLoad(WTF::move(m_contentFilter)); 417 417 } 418 418 #endif … … 665 665 #if USE(CONTENT_FILTERING) 666 666 if (response.url().protocolIsInHTTPFamily() && ContentFilter::isEnabled()) 667 m_contentFilter = ContentFilter::create(response);667 m_contentFilter = std::make_unique<ContentFilter>(response); 668 668 #endif 669 669 … … 875 875 876 876 if (loadWasBlockedBeforeFinishing) 877 setContentFilterForBlockedLoad(m_contentFilter);877 frameLoader()->client().contentFilterDidBlockLoad(WTF::move(m_contentFilter)); 878 878 } 879 879 #endif … … 1566 1566 } 1567 1567 1568 #if USE(CONTENT_FILTERING)1569 void DocumentLoader::setContentFilterForBlockedLoad(PassRefPtr<ContentFilter> contentFilter)1570 {1571 ASSERT(!m_contentFilterForBlockedLoad);1572 ASSERT(contentFilter);1573 ASSERT(contentFilter->didBlockData());1574 m_contentFilterForBlockedLoad = contentFilter;1575 }1576 1577 bool DocumentLoader::handleContentFilterRequest(const ResourceRequest& request)1578 {1579 // FIXME: Remove PLATFORM(IOS)-guard once we upstream ContentFilterIOS.mm and1580 // implement ContentFilter::requestUnblockAndDispatchIfSuccessful() for Mac.1581 #if PLATFORM(IOS)1582 if (!m_contentFilterForBlockedLoad)1583 return false;1584 1585 if (!request.url().protocolIs(ContentFilter::scheme()))1586 return false;1587 1588 if (equalIgnoringCase(request.url().host(), "unblock")) {1589 // Tell the FrameLoader to reload if the unblock is successful.1590 m_contentFilterForBlockedLoad->requestUnblockAndDispatchIfSuccessful(bind(&FrameLoader::reload, &(m_frame->loader()), false));1591 return true;1592 }1593 1594 return false;1595 #else1596 UNUSED_PARAM(request);1597 return false;1598 #endif1599 }1600 #endif1601 1602 1568 } // namespace WebCore -
trunk/Source/WebCore/loader/DocumentLoader.h
r170113 r171252 257 257 void checkLoadComplete(); 258 258 259 #if USE(CONTENT_FILTERING)260 void setContentFilterForBlockedLoad(PassRefPtr<ContentFilter>);261 bool handleContentFilterRequest(const ResourceRequest&);262 #endif263 264 259 // The URL of the document resulting from this DocumentLoader. 265 260 URL documentURL() const; … … 416 411 417 412 #if USE(CONTENT_FILTERING) 418 RefPtr<ContentFilter> m_contentFilter; 419 RefPtr<ContentFilter> m_contentFilterForBlockedLoad; 413 std::unique_ptr<ContentFilter> m_contentFilter; 420 414 #endif 421 415 }; -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r171239 r171252 99 99 #endif 100 100 101 #if USE(CONTENT_FILTERING) 102 class ContentFilter; 103 #endif 104 101 105 typedef std::function<void (PolicyAction)> FramePolicyFunction; 102 106 … … 332 336 virtual void didCreateQuickLookHandle(QuickLookHandle&) { } 333 337 #endif 338 339 #if USE(CONTENT_FILTERING) 340 virtual void contentFilterDidBlockLoad(std::unique_ptr<ContentFilter>) { } 341 #endif 334 342 }; 335 343 -
trunk/Source/WebCore/loader/PolicyChecker.cpp
r170774 r171252 47 47 #endif 48 48 49 #if USE(CONTENT_FILTERING)50 #include "ContentFilter.h"51 #endif52 53 49 namespace WebCore { 54 50 … … 110 106 #endif 111 107 112 #if USE(CONTENT_FILTERING)113 if (DocumentLoader* documentLoader = m_frame.loader().documentLoader()) {114 if (documentLoader->handleContentFilterRequest(request)) {115 continueAfterNavigationPolicy(PolicyIgnore);116 return;117 }118 }119 #endif120 121 108 m_delegateIsDecidingNavigationPolicy = true; 122 109 m_frame.loader().client().dispatchDecidePolicyForNavigationAction(action, request, formState, [this](PolicyAction action) { -
trunk/Source/WebCore/platform/ContentFilter.h
r163657 r171252 31 31 #include <wtf/PassRefPtr.h> 32 32 #include <wtf/RetainPtr.h> 33 #include <wtf/ThreadSafeRefCounted.h>34 33 35 34 #if PLATFORM(IOS) 36 #include < wtf/Functional.h>35 #include <functional> 37 36 #endif 38 37 39 38 #if PLATFORM(COCOA) 40 OBJC_CLASS NSMutableData; 39 OBJC_CLASS NSData; 40 OBJC_CLASS NSKeyedArchiver; 41 OBJC_CLASS NSKeyedUnarchiver; 41 42 OBJC_CLASS WebFilterEvaluator; 42 43 #endif … … 45 46 46 47 #if HAVE(NE_FILTER_SOURCE) 47 #import <atomic>48 48 #import <dispatch/dispatch.h> 49 49 OBJC_CLASS NEFilterSource; 50 OBJC_CLASS NSMutableData; 50 51 #endif 51 52 52 53 namespace WebCore { 53 54 55 class ResourceRequest; 54 56 class ResourceResponse; 55 57 56 class ContentFilter : public ThreadSafeRefCounted<ContentFilter>{58 class ContentFilter { 57 59 public: 58 static PassRefPtr<ContentFilter> create(const ResourceResponse&);59 60 static bool isEnabled(); 60 61 61 virtual ~ContentFilter(); 62 explicit ContentFilter(const ResourceResponse&); 63 ~ContentFilter(); 62 64 63 65 void addData(const char* data, int length); … … 66 68 bool didBlockData() const; 67 69 const char* getReplacementData(int& length) const; 68 70 71 #if PLATFORM(COCOA) 72 ContentFilter(); 73 void encode(NSKeyedArchiver *) const; 74 static bool decode(NSKeyedUnarchiver *, ContentFilter&); 75 #endif 76 69 77 #if PLATFORM(IOS) 70 static const char* scheme(); 71 void requestUnblockAndDispatchIfSuccessful(Function<void()>); 78 bool handleUnblockRequestAndDispatchIfSuccessful(const ResourceRequest&, std::function<void()>); 72 79 #endif 73 80 74 81 private: 75 explicit ContentFilter(const ResourceResponse&);76 77 82 #if PLATFORM(COCOA) 78 83 RetainPtr<WebFilterEvaluator> m_platformContentFilter; … … 81 86 82 87 #if HAVE(NE_FILTER_SOURCE) 83 std::atomic<long>m_neFilterSourceStatus;88 long m_neFilterSourceStatus; 84 89 RetainPtr<NEFilterSource> m_neFilterSource; 85 90 dispatch_queue_t m_neFilterSourceQueue; -
trunk/Source/WebCore/platform/ios/ContentFilterIOS.mm
r161589 r171252 29 29 #if PLATFORM(IOS) && USE(CONTENT_FILTERING) 30 30 31 #import "ResourceRequest.h" 31 32 #import "WebCoreThreadRun.h" 32 33 … … 41 42 namespace WebCore { 42 43 43 const char* ContentFilter::scheme()44 static inline const char* scheme() 44 45 { 45 46 static const char contentFilterScheme[] = "x-apple-content-filter"; 46 47 return contentFilterScheme; 47 48 } 48 49 void ContentFilter::requestUnblockAndDispatchIfSuccessful(Function<void()> function)49 50 bool ContentFilter::handleUnblockRequestAndDispatchIfSuccessful(const ResourceRequest& request, std::function<void()> function) 50 51 { 52 if (!request.url().protocolIs(scheme())) 53 return false; 54 55 if (!equalIgnoringCase(request.url().host(), "unblock")) 56 return false; 57 51 58 [m_platformContentFilter unblockWithCompletion:^(BOOL unblocked, NSError *) { 52 if (unblocked) { 53 WebThreadRun(^{ 54 function(); 55 }); 56 } 59 if (unblocked) 60 function(); 57 61 }]; 62 return true; 58 63 } 59 64 -
trunk/Source/WebCore/platform/mac/ContentFilterMac.mm
r167023 r171252 86 86 namespace WebCore { 87 87 88 PassRefPtr<ContentFilter> ContentFilter::create(const ResourceResponse& response) 89 { 90 return adoptRef(new ContentFilter(response)); 88 ContentFilter::ContentFilter() 89 #if HAVE(NE_FILTER_SOURCE) 90 : m_neFilterSourceStatus(NEFilterSourceStatusNeedsMoreData) 91 , m_neFilterSourceQueue(0) 92 #endif 93 { 91 94 } 92 95 … … 151 154 [m_originalData appendBytes:data length:length]; 152 155 153 ref();154 156 dispatch_semaphore_t neFilterSourceSemaphore = dispatch_semaphore_create(0); 155 157 [m_neFilterSource addData:[NSData dataWithBytes:(void*)data length:length] withCompletionQueue:m_neFilterSourceQueue completionHandler:^(NEFilterSourceStatus status, NSData *) { 156 158 m_neFilterSourceStatus = status; 157 deref();158 159 dispatch_semaphore_signal(neFilterSourceSemaphore); 159 160 }]; … … 180 181 return; 181 182 182 ref();183 183 dispatch_semaphore_t neFilterSourceSemaphore = dispatch_semaphore_create(0); 184 184 [m_neFilterSource dataCompleteWithCompletionQueue:m_neFilterSourceQueue completionHandler:^(NEFilterSourceStatus status, NSData *) { 185 185 m_neFilterSourceStatus = status; 186 deref();187 186 dispatch_semaphore_signal(neFilterSourceSemaphore); 188 187 }]; … … 235 234 } 236 235 236 static NSString * const platformContentFilterKey = @"platformContentFilter"; 237 238 void ContentFilter::encode(NSKeyedArchiver *archiver) const 239 { 240 if ([getWebFilterEvaluatorClass() conformsToProtocol:@protocol(NSSecureCoding)]) 241 [archiver encodeObject:m_platformContentFilter.get() forKey:platformContentFilterKey]; 242 } 243 244 bool ContentFilter::decode(NSKeyedUnarchiver *unarchiver, ContentFilter& contentFilter) 245 { 246 @try { 247 if ([getWebFilterEvaluatorClass() conformsToProtocol:@protocol(NSSecureCoding)]) 248 contentFilter.m_platformContentFilter = (WebFilterEvaluator *)[unarchiver decodeObjectOfClass:getWebFilterEvaluatorClass() forKey:platformContentFilterKey]; 249 return true; 250 } @catch (NSException *exception) { 251 LOG_ERROR("The platform content filter being decoded is not a WebFilterEvaluator."); 252 } 253 254 return false; 255 } 256 237 257 } // namespace WebCore 238 258 -
trunk/Source/WebKit/mac/ChangeLog
r171212 r171252 1 2014-07-18 Andy Estes <aestes@apple.com> 2 3 [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad 4 https://bugs.webkit.org/show_bug.cgi?id=135072 5 <rdar://problem/17528188> 6 7 Reviewed by David Kilzer. 8 9 * WebCoreSupport/WebFrameLoaderClient.h: Override contentFilterDidBlockLoad(). 10 * WebCoreSupport/WebFrameLoaderClient.mm: 11 (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): Reset contentFilterForBlockedLoad to nullptr. 12 (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Check if this is navigation represents an 13 unblock request and ignore if so. 14 * WebView/WebFrame.mm: 15 (-[WebFrame _contentFilterDidHandleNavigationAction:]): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful(). 16 If the unblock is successful, reload the main frame. 17 * WebView/WebFrameInternal.h: 18 1 19 2014-07-17 David Kilzer <ddkilzer@apple.com> 2 20 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
r168079 r171252 236 236 #endif 237 237 238 virtual void contentFilterDidBlockLoad(std::unique_ptr<WebCore::ContentFilter>) override; 239 238 240 RetainPtr<WebFrame> m_webFrame; 239 241 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r170984 r171252 668 668 ASSERT(!m_webFrame->_private->provisionalURL); 669 669 m_webFrame->_private->provisionalURL = core(m_webFrame.get())->loader().provisionalDocumentLoader()->url().string(); 670 m_webFrame->_private->contentFilterForBlockedLoad = nullptr; 670 671 671 672 WebView *webView = getWebView(m_webFrame.get()); … … 882 883 void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState, FramePolicyFunction function) 883 884 { 885 if ([m_webFrame _contentFilterDidHandleNavigationAction:request]) { 886 function(PolicyIgnore); 887 return; 888 } 889 884 890 WebView *webView = getWebView(m_webFrame.get()); 885 891 [[webView _policyDelegateForwarder] webView:webView … … 2239 2245 #endif 2240 2246 2247 void WebFrameLoaderClient::contentFilterDidBlockLoad(std::unique_ptr<WebCore::ContentFilter> contentFilter) 2248 { 2249 m_webFrame->_private->contentFilterForBlockedLoad = WTF::move(contentFilter); 2250 } 2251 2241 2252 @implementation WebFramePolicyListener 2242 2253 -
trunk/Source/WebKit/mac/WebView/WebFrame.mm
r170710 r171252 1002 1002 } 1003 1003 1004 - (BOOL)_contentFilterDidHandleNavigationAction:(const WebCore::ResourceRequest &)request 1005 { 1006 #if PLATFORM(IOS) 1007 if (ContentFilter *contentFilter = _private->contentFilterForBlockedLoad.get()) { 1008 RetainPtr<WebFrame> retainedMainFrame = [[self webView] mainFrame]; 1009 return contentFilter->handleUnblockRequestAndDispatchIfSuccessful(request, [retainedMainFrame] { 1010 WebThreadRun(^ { 1011 [retainedMainFrame reload]; 1012 }); 1013 }); 1014 } 1015 #endif 1016 1017 return NO; 1018 } 1019 1004 1020 @end 1005 1021 -
trunk/Source/WebKit/mac/WebView/WebFrameInternal.h
r165676 r171252 31 31 #import "WebFramePrivate.h" 32 32 #import "WebPreferencesPrivate.h" 33 #import <WebCore/ContentFilter.h> 33 34 #import <WebCore/EditAction.h> 34 35 #import <WebCore/FrameLoaderTypes.h> … … 91 92 #if PLATFORM(IOS) 92 93 BOOL isCommitting; 93 #endif 94 #endif 95 std::unique_ptr<WebCore::ContentFilter> contentFilterForBlockedLoad; 94 96 } 95 97 @end … … 183 185 - (void)_commitData:(NSData *)data; 184 186 187 - (BOOL)_contentFilterDidHandleNavigationAction:(const WebCore::ResourceRequest&)request; 188 185 189 @end 186 190 -
trunk/Source/WebKit2/ChangeLog
r171250 r171252 1 2014-07-18 Andy Estes <aestes@apple.com> 2 3 [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad 4 https://bugs.webkit.org/show_bug.cgi?id=135072 5 <rdar://problem/17528188> 6 7 Reviewed by David Kilzer. 8 9 * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter. 10 * Shared/mac/WebCoreArgumentCodersMac.mm: 11 (IPC::ArgumentCoder<ContentFilter>::encode): Encoded the ContentFilter using a NSKeyedArchiver. 12 (IPC::ArgumentCoder<ContentFilter>::decode): Decoded the ContentFilter using a NSKeyedUnarchiver. 13 * UIProcess/Cocoa/WebPageProxyCocoa.mm: 14 (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::setContentFilterForBlockedLoad(). 15 * UIProcess/WebFrameProxy.cpp: 16 (WebKit::WebFrameProxy::didStartProvisionalLoad): Reset m_contentFilterForBlockedLoad to nullptr. 17 (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful(). 18 If the unblock is successful, reload the WebPageProxy. 19 * UIProcess/WebFrameProxy.h: 20 (WebKit::WebFrameProxy::setContentFilterForBlockedLoad): 21 * UIProcess/WebPageProxy.cpp: 22 (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check if this is navigation represents an unblock 23 request and ignore if so. 24 * UIProcess/WebPageProxy.h: 25 * UIProcess/WebPageProxy.messages.in: Defined ContentFilterDidBlockLoadForFrame. 26 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 27 (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): Sent ContentFilterDidBlockLoadForFrame to the WebPageProxy. 28 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 29 1 30 2014-07-18 Simon Fraser <simon.fraser@apple.com> 2 31 -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
r170406 r171252 106 106 #endif 107 107 108 #if USE(CONTENT_FILTERING) 109 namespace WebCore { 110 class ContentFilter; 111 } 112 #endif 113 108 114 namespace IPC { 109 115 … … 437 443 }; 438 444 445 #if USE(CONTENT_FILTERING) 446 template<> struct ArgumentCoder<WebCore::ContentFilter> { 447 static void encode(ArgumentEncoder&, const WebCore::ContentFilter&); 448 static bool decode(ArgumentDecoder&, WebCore::ContentFilter&); 449 }; 450 #endif 451 439 452 } // namespace IPC 440 453 -
trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm
r170685 r171252 32 32 #import "WebKitSystemInterface.h" 33 33 #import <WebCore/CertificateInfo.h> 34 #import <WebCore/ContentFilter.h> 34 35 #import <WebCore/KeyboardEvent.h> 35 36 #import <WebCore/ResourceError.h> … … 301 302 } 302 303 304 void ArgumentCoder<ContentFilter>::encode(ArgumentEncoder& encoder, const ContentFilter& contentFilter) 305 { 306 RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]); 307 RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 308 [archiver setRequiresSecureCoding:YES]; 309 contentFilter.encode(archiver.get()); 310 [archiver finishEncoding]; 311 IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get())); 312 } 313 314 bool ArgumentCoder<ContentFilter>::decode(ArgumentDecoder& decoder, ContentFilter& contentFilter) 315 { 316 RetainPtr<CFDataRef> data; 317 if (!IPC::decode(decoder, data)) 318 return false; 319 320 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]); 321 [unarchiver setRequiresSecureCoding:YES]; 322 if (!ContentFilter::decode(unarchiver.get(), contentFilter)) 323 return false; 324 325 [unarchiver finishDecoding]; 326 return true; 327 } 328 303 329 } // namespace IPC -
trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm
r170779 r171252 73 73 } 74 74 75 void WebPageProxy::contentFilterDidBlockLoadForFrame(const WebCore::ContentFilter& contentFilter, uint64_t frameID) 76 { 77 if (WebFrameProxy* frame = m_process->webFrame(frameID)) 78 frame->setContentFilterForBlockedLoad(std::make_unique<WebCore::ContentFilter>(contentFilter)); 75 79 } 80 81 } -
trunk/Source/WebKit2/UIProcess/WebFrameProxy.cpp
r170660 r171252 128 128 { 129 129 m_frameLoadState.didStartProvisionalLoad(url); 130 #if USE(CONTENT_FILTERING) 131 m_contentFilterForBlockedLoad = nullptr; 132 #endif 130 133 } 131 134 … … 231 234 } 232 235 236 #if USE(CONTENT_FILTERING) 237 bool WebFrameProxy::contentFilterDidHandleNavigationAction(const WebCore::ResourceRequest& request) 238 { 239 #if PLATFORM(IOS) 240 if (m_contentFilterForBlockedLoad) { 241 RefPtr<WebPageProxy> retainedPage = m_page; 242 return m_contentFilterForBlockedLoad->handleUnblockRequestAndDispatchIfSuccessful(request, [retainedPage] { 243 retainedPage->reload(false); 244 }); 245 } 246 #endif 247 248 return false; 249 } 250 #endif 251 233 252 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/WebFrameProxy.h
r170660 r171252 35 35 #include <wtf/PassRefPtr.h> 36 36 #include <wtf/text/WTFString.h> 37 38 #if USE(CONTENT_FILTERING) 39 #include <WebCore/ContentFilter.h> 40 #endif 37 41 38 42 namespace IPC { … … 114 118 WebFormSubmissionListenerProxy* setUpFormSubmissionListenerProxy(uint64_t listenerID); 115 119 120 #if USE(CONTENT_FILTERING) 121 void setContentFilterForBlockedLoad(std::unique_ptr<WebCore::ContentFilter> contentFilter) { m_contentFilterForBlockedLoad = WTF::move(contentFilter); } 122 bool contentFilterDidHandleNavigationAction(const WebCore::ResourceRequest&); 123 #endif 124 116 125 private: 117 126 WebFrameProxy(WebPageProxy* page, uint64_t frameID); … … 127 136 RefPtr<WebFrameListenerProxy> m_activeListener; 128 137 uint64_t m_frameID; 138 139 #if USE(CONTENT_FILTERING) 140 std::unique_ptr<WebCore::ContentFilter> m_contentFilterForBlockedLoad; 141 #endif 129 142 }; 130 143 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r171239 r171252 2855 2855 } 2856 2856 2857 #if USE(CONTENT_FILTERING) 2858 if (frame->contentFilterDidHandleNavigationAction(request)) { 2859 receivedPolicyAction = true; 2860 policyAction = PolicyIgnore; 2861 return; 2862 } 2863 #endif 2864 2857 2865 ASSERT(!m_inDecidePolicyForNavigationAction); 2858 2866 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r171239 r171252 1272 1272 #endif 1273 1273 1274 #if USE(CONTENT_FILTERING) 1275 void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilter&, uint64_t frameID); 1276 #endif 1277 1274 1278 uint64_t generateNavigationID(); 1275 1279 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r171239 r171252 406 406 407 407 WillChangeCurrentHistoryItem() 408 409 #if USE(CONTENT_FILTERING) 410 ContentFilterDidBlockLoadForFrame(WebCore::ContentFilter contentFilter, uint64_t frameID) 411 #endif 408 412 } -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r171239 r171252 1631 1631 } 1632 1632 1633 #if USE(CONTENT_FILTERING) 1634 void WebFrameLoaderClient::contentFilterDidBlockLoad(std::unique_ptr<WebCore::ContentFilter> contentFilter) 1635 { 1636 if (WebPage* webPage = m_frame->page()) 1637 webPage->send(Messages::WebPageProxy::ContentFilterDidBlockLoadForFrame(*contentFilter, m_frame->frameID())); 1638 } 1639 #endif 1640 1633 1641 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r171239 r171252 229 229 #endif 230 230 231 #if USE(CONTENT_FILTERING) 232 virtual void contentFilterDidBlockLoad(std::unique_ptr<WebCore::ContentFilter>) override; 233 #endif 234 231 235 WebFrame* m_frame; 232 236 RefPtr<PluginView> m_pluginView;
Note: See TracChangeset
for help on using the changeset viewer.