Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1062)

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 618823002: GuestView: Move lifetime management out of content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix extensionoptions cleanup Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index b51b452161e21addcbdd5addba00153b3615874c..7e91f85cc05af6ec95895039c4c96b3911b6bbf4 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -83,13 +83,6 @@ BrowserPlugin::BrowserPlugin(RenderViewImpl* render_view,
BrowserPlugin::~BrowserPlugin() {
browser_plugin_manager()->RemoveBrowserPlugin(browser_plugin_instance_id_);
-
- if (!ready())
- return;
-
- browser_plugin_manager()->Send(
- new BrowserPluginHostMsg_PluginDestroyed(render_view_routing_id_,
- browser_plugin_instance_id_));
}
bool BrowserPlugin::OnMessageReceived(const IPC::Message& message) {
@@ -174,7 +167,6 @@ void BrowserPlugin::OnCompositorFrameSwapped(const IPC::Message& message) {
BrowserPluginMsg_CompositorFrameSwapped::Param param;
if (!BrowserPluginMsg_CompositorFrameSwapped::Read(&message, &param))
return;
-
// Note that there is no need to send ACK for this message.
// If the guest has updated pixels then it is no longer crashed.
guest_crashed_ = false;
@@ -317,6 +309,8 @@ bool BrowserPlugin::initialize(WebPluginContainer* container) {
g_plugin_container_map.Get().insert(std::make_pair(container_, this));
+ browser_plugin_manager()->AddBrowserPlugin(browser_plugin_instance_id_, this);
+
// This is a way to notify observers of our attributes that this plugin is
// available in render tree.
// TODO(lazyboy): This should be done through the delegate instead. Perhaps
@@ -324,7 +318,6 @@ bool BrowserPlugin::initialize(WebPluginContainer* container) {
UpdateDOMAttribute("internalinstanceid",
base::IntToString(browser_plugin_instance_id_));
- browser_plugin_manager()->AddBrowserPlugin(browser_plugin_instance_id_, this);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698