Commit c6391e1a authored by Timothy Loh's avatar Timothy Loh Committed by Commit Bot

Revert "[ MimeHandlerView ] Block PluginStatus != kAllowed/kPlayImportantContent"

This reverts commit 4ded38ed.

Reason for revert: WebViewPluginTest.TestLoadPluginInternalResource timing out on linux-chromeos-dbg

e.g. https://ci.chromium.org/p/chromium/builders/ci/linux-chromeos-dbg/12542

Original change's description:
> [ MimeHandlerView ] Block PluginStatus != kAllowed/kPlayImportantContent
> 
> Currently, a MimeHandlerView is created as long as there is a plugin
> for it. This behavior undermines issues such as <webview> permissions
> API.
> 
> This CL will avoid creating MimeHandlerView if the plugin is not
> allowed. This change will also make the test
> WebViewPluginTest.TestLoadPluginInternalResource pass with the flag
> MimeHandlerViewInCrossProcessFrame.
> 
> Note that when the plugin is not allowed, no (frame-based)
> MimeHandlerView will be created and the code will follow the ordinary
> CreatePlugin code path.
> 
> Bug: 963694
> Change-Id: I91b88956480139ffdb0df06077d099746b713751
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1622890
> Reviewed-by: Ehsan Karamad <ekaramad@chromium.org>
> Reviewed-by: James MacLean <wjmaclean@chromium.org>
> Reviewed-by: Tommy Li <tommycli@chromium.org>
> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
> Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#662641}

TBR=thestig@chromium.org,tommycli@chromium.org,ekaramad@chromium.org,lukasza@chromium.org,wjmaclean@chromium.org

Change-Id: I348e495fd03a3acaed1aaa86d71fee38770a9aa5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 963694
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627837Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Commit-Queue: Timothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662947}
parent 491fbb62
...@@ -3320,6 +3320,12 @@ IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) { ...@@ -3320,6 +3320,12 @@ IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) {
} }
IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginInternalResource) { IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginInternalResource) {
if (content::MimeHandlerViewMode::UsesCrossProcessFrame()) {
// Permissions are broken with frame-based MimeHandlerView as it never goes
// through the same plugin checks when attaching an <embed>. Fix this asap.
// (https://crbug.com/963694).
return;
}
const char kTestMimeType[] = "application/pdf"; const char kTestMimeType[] = "application/pdf";
const char kTestFileType[] = "pdf"; const char kTestFileType[] = "pdf";
content::WebPluginInfo plugin_info; content::WebPluginInfo plugin_info;
......
...@@ -608,14 +608,7 @@ bool ChromeContentRendererClient::MaybeCreateMimeHandlerView( ...@@ -608,14 +608,7 @@ bool ChromeContentRendererClient::MaybeCreateMimeHandlerView(
render_frame->GetRoutingID(), original_url, render_frame->GetRoutingID(), original_url,
render_frame->GetWebFrame()->Top()->GetSecurityOrigin(), mime_type, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(), mime_type,
&plugin_info); &plugin_info);
// TODO(ekaramad): Not continuing here due to a disallowed status should take if (plugin_info->status == chrome::mojom::PluginStatus::kNotFound ||
// us to CreatePlugin. See if more in depths investigation of |status| is
// necessary here (see https://crbug.com/965747). For now, returning false
// should take us to CreatePlugin after HTMLPlugInElement which is called
// through HTMLPlugInElement::LoadPlugin code path.
if ((plugin_info->status != chrome::mojom::PluginStatus::kAllowed &&
plugin_info->status !=
chrome::mojom::PluginStatus::kPlayImportantContent) ||
!ChromeExtensionsRendererClient::MaybeCreateMimeHandlerView( !ChromeExtensionsRendererClient::MaybeCreateMimeHandlerView(
plugin_element, original_url, plugin_info->actual_mime_type, plugin_element, original_url, plugin_info->actual_mime_type,
plugin_info->plugin)) { plugin_info->plugin)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment