diff options
author | karen@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 05:16:29 +0000 |
---|---|---|
committer | karen@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 05:16:29 +0000 |
commit | 3f0e57d372e6998a5ab9a230eeaa5c8068761086 (patch) | |
tree | b1c1702c182e3b3799b315fea15abb772205a4a2 | |
parent | 92059b6576ac83188278e62842af57752fcb9374 (diff) | |
download | chromium_src-3f0e57d372e6998a5ab9a230eeaa5c8068761086.zip chromium_src-3f0e57d372e6998a5ab9a230eeaa5c8068761086.tar.gz chromium_src-3f0e57d372e6998a5ab9a230eeaa5c8068761086.tar.bz2 |
Merge 235263 "Fix for crash related to tab restore containing NP..."
> Fix for crash related to tab restore containing NPAPI plugins in metro/ash environment. This crash happens because
> as it stands right now, background tabs are not added in ash/shell root window hierarchy until they become active, but
> renderviewcreated notification is sent whenever tab views are created. We use renderviewcreated notification to block
> npapi plugin from loading if view is on ash/metro desktop. This CL modifies this logic with detection of last known active desktop.
>
> This is a temporary fix as there could be instances on both desktop at the same time, which could break global state.
>
> R=bauerb@chromium.org, cpu@chromium.org, ananta, cpu
> TBR=bauerb@chromium.org
> BUG=317940
>
> Review URL: https://codereview.chromium.org/73153002
TBR=shrikant@chromium.org
Review URL: https://codereview.chromium.org/74983002
git-svn-id: svn://svn.chromium.org/chrome/branches/1700/src@235620 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/plugins/plugin_observer.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc index 54120b2..b170b7f 100644 --- a/chrome/browser/plugins/plugin_observer.cc +++ b/chrome/browser/plugins/plugin_observer.cc @@ -191,9 +191,22 @@ void PluginObserver::RenderViewCreated( // the IO thread by PluginInfoMessageFilter of this proces,s but it's more // complex to manage a map of Ash views in PluginInfoMessageFilter than // just telling the renderer via IPC. - content::WebContentsView* wcv = web_contents()->GetView(); - aura::Window* window = wcv->GetNativeView(); - if (chrome::GetHostDesktopTypeForNativeView(window) == + + // TODO(shrikant): Implement solution which will help associate + // render_view_host/webcontents/view/window instance with host desktop. + // Refer to issue http://crbug.com/317940. + // When non-active tabs are restored they are not added in view/window parent + // hierarchy (chrome::CreateRestoredTab/CreateParams). Normally we traverse + // parent hierarchy to identify containing desktop (like in function + // chrome::GetHostDesktopTypeForNativeView). + // Possible issue with chrome::GetActiveDesktop, is that it's global + // state, which remembers last active desktop, which may break in scenarios + // where we have instances on both Ash and Native desktop. + + // We will do both tests. Both have some factor of unreliability. + aura::Window* window = web_contents()->GetView()->GetNativeView(); + if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH || + chrome::GetHostDesktopTypeForNativeView(window) == chrome::HOST_DESKTOP_TYPE_ASH) { int routing_id = render_view_host->GetRoutingID(); render_view_host->Send(new ChromeViewMsg_NPAPINotSupported(routing_id)); |