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

Unified Diff: components/plugins/renderer/plugin_placeholder.cc

Issue 131073002: Don't try to access the plugin_ after we deleted in the in plugin placeholder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/plugin_placeholder.cc
diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc
index 343c7ad1614d011fed492ac95b5327f4129cc6ab..f99ee489fb6de122f4533dfe261fc63e682ab083 100644
--- a/components/plugins/renderer/plugin_placeholder.cc
+++ b/components/plugins/renderer/plugin_placeholder.cc
@@ -107,6 +107,8 @@ void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) {
void PluginPlaceholder::HidePlugin() {
hidden_ = true;
+ if (!plugin_)
+ return;
WebPluginContainer* container = plugin_->container();
WebElement element = container->element();
element.setAttribute("style", "display: none;");
@@ -158,6 +160,8 @@ void PluginPlaceholder::SetMessage(const base::string16& message) {
}
void PluginPlaceholder::UpdateMessage() {
+ if (!plugin_)
+ return;
std::string script =
"window.setMessage(" + base::GetQuotedJSONString(message_) + ")";
plugin_->web_view()->mainFrame()->executeScript(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698