WebKit Bugzilla
Attachment 347651 Details for
Bug 188764
: WKNavigationDelegate needs to allow clients to specify a custom blocked plug-in message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188764-20180821093819.patch (text/plain), 6.55 KB, created by
Jeff Miller
on 2018-08-21 09:38:20 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jeff Miller
Created:
2018-08-21 09:38:20 PDT
Size:
6.55 KB
patch
obsolete
>Subversion Revision: 235116 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 47d23dabb8a34aa932a5dd6319bcffbba1a7838d..aa3e9b1044fea170c2b47b80fd06e3ddc5ae2d97 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,24 @@ >+2018-08-20 Jeff Miller <jeffm@apple.com> >+ >+ WKNavigationDelegate needs to allow clients to specify a custom blocked plug-in message >+ https://bugs.webkit.org/show_bug.cgi?id=188764 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: >+ Add alternate version of -decidePolicyForPluginLoadWithCurrentPolicy: that allows clients to >+ return the unavailibility description. >+ >+ * UIProcess/Cocoa/NavigationState.h: >+ Add flag for new delegate method. >+ >+ * UIProcess/Cocoa/NavigationState.mm: >+ (WebKit::NavigationState::setNavigationDelegate): >+ Calculate flag for new delegate method. >+ >+ (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad): >+ Prefer new delegate method, if available. >+ > 2018-08-21 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r234981. >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h >index fea2ae751af595b2b401ed7a280b7b94b8c1bf5c..c90f4259fa0588d165817cb799008b35101fd510 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h >@@ -107,6 +107,7 @@ static const WKNavigationResponsePolicy _WKNavigationResponsePolicyBecomeDownloa > - (void)_webView:(WKWebView *)webView didFailToInitializePlugInWithInfo:(NSDictionary *)info WK_API_AVAILABLE(macosx(10.13.4)); > - (void)_webView:(WKWebView *)webView didBlockInsecurePluginVersionWithInfo:(NSDictionary *)info WK_API_AVAILABLE(macosx(WK_MAC_TBA)); > - (_WKPluginModuleLoadPolicy)_webView:(WKWebView *)webView decidePolicyForPluginLoadWithCurrentPolicy:(_WKPluginModuleLoadPolicy)policy pluginInfo:(NSDictionary *)info unavailabilityDescription:(NSString *)unavailabilityDescription WK_API_AVAILABLE(macosx(WK_MAC_TBA)); >+- (_WKPluginModuleLoadPolicy)_webView:(WKWebView *)webView decidePolicyForPluginLoadWithCurrentPolicy:(_WKPluginModuleLoadPolicy)policy pluginInfo:(NSDictionary *)info outUnavailabilityDescription:(NSString **)outUnavailabilityDescription WK_API_AVAILABLE(macosx(WK_MAC_TBA)); > - (void)_webView:(WKWebView *)webView backForwardListItemAdded:(WKBackForwardListItem *)itemAdded removed:(NSArray<WKBackForwardListItem *> *)itemsRemoved WK_API_AVAILABLE(macosx(10.13.4)); > #endif > >diff --git a/Source/WebKit/UIProcess/Cocoa/NavigationState.h b/Source/WebKit/UIProcess/Cocoa/NavigationState.h >index d16d2a9f9bc215bd7055749316f90a80ca0657de..c3182ff9732f7c8fd01c0f843f74b61fc67fcb5b 100644 >--- a/Source/WebKit/UIProcess/Cocoa/NavigationState.h >+++ b/Source/WebKit/UIProcess/Cocoa/NavigationState.h >@@ -230,6 +230,7 @@ private: > bool webViewDidBlockInsecurePluginVersionWithInfo : 1; > bool webViewWillGoToBackForwardListItemInPageCache : 1; > bool webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoUnavailabilityDescription : 1; >+ bool webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoOutUnavailabilityDescription : 1; > #endif > } m_navigationDelegateMethods; > >diff --git a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >index 8f60c3697b1a3dda4aff4fa3480107bb73b92323..c9b2c6b1029b4f32d4dab58d92d129279707f9a4 100644 >--- a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >+++ b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >@@ -187,6 +187,7 @@ void NavigationState::setNavigationDelegate(id <WKNavigationDelegate> delegate) > m_navigationDelegateMethods.webViewDidBlockInsecurePluginVersionWithInfo = [delegate respondsToSelector:@selector(_webView:didBlockInsecurePluginVersionWithInfo:)]; > m_navigationDelegateMethods.webViewBackForwardListItemAddedRemoved = [delegate respondsToSelector:@selector(_webView:backForwardListItemAdded:removed:)]; > m_navigationDelegateMethods.webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoUnavailabilityDescription = [delegate respondsToSelector:@selector(_webView:decidePolicyForPluginLoadWithCurrentPolicy:pluginInfo:unavailabilityDescription:)]; >+ m_navigationDelegateMethods.webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoOutUnavailabilityDescription = [delegate respondsToSelector:@selector(_webView:decidePolicyForPluginLoadWithCurrentPolicy:pluginInfo:outUnavailabilityDescription:)]; > #endif > } > >@@ -361,13 +362,23 @@ static _WKPluginModuleLoadPolicy wkPluginModuleLoadPolicy(WebKit::PluginModuleLo > > WebKit::PluginModuleLoadPolicy NavigationState::NavigationClient::decidePolicyForPluginLoad(WebKit::WebPageProxy&, WebKit::PluginModuleLoadPolicy currentPluginLoadPolicy, API::Dictionary& pluginInformation, WTF::String& unavailabilityDescription) > { >- if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoUnavailabilityDescription) >+ if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoUnavailabilityDescription && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoOutUnavailabilityDescription) > return currentPluginLoadPolicy; > > auto navigationDelegate = m_navigationState.m_navigationDelegate.get(); > if (!navigationDelegate) > return currentPluginLoadPolicy; > >+ if (m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoOutUnavailabilityDescription) { >+ NSString *unavailabilityDescriptionOut = nil; >+ WebKit::PluginModuleLoadPolicy policy = pluginModuleLoadPolicy([(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView decidePolicyForPluginLoadWithCurrentPolicy:wkPluginModuleLoadPolicy(currentPluginLoadPolicy) pluginInfo:wrapper(pluginInformation) outUnavailabilityDescription:&unavailabilityDescriptionOut]); >+ >+ if (unavailabilityDescriptionOut) >+ unavailabilityDescription = WTF::String(unavailabilityDescriptionOut); >+ >+ return policy; >+ } >+ > return pluginModuleLoadPolicy([(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView decidePolicyForPluginLoadWithCurrentPolicy:wkPluginModuleLoadPolicy(currentPluginLoadPolicy) pluginInfo:wrapper(pluginInformation) unavailabilityDescription:unavailabilityDescription]); > } >
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188764
:
347586
|
347651
|
347713
|
347726
|
347816