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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 12189018: <webview>: Implement WebRequest API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor fix to tear down Created 7 years, 7 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/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index d1c6caa70571d17934a403df875256317881262a..fe659bea7b51b2a1c669500c1f5e440050981216 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -275,7 +275,8 @@ BrowserPluginGuest::BrowserPluginGuest(
pending_lock_request_(false),
embedder_visible_(true),
next_permission_request_id_(0),
- has_render_view_(has_render_view) {
+ has_render_view_(has_render_view),
+ is_being_destroyed_(false) {
DCHECK(web_contents);
web_contents->SetDelegate(this);
if (opener)
@@ -320,11 +321,15 @@ void BrowserPluginGuest::DestroyUnattachedWindows() {
}
void BrowserPluginGuest::Destroy() {
+ if (is_being_destroyed_)
+ return;
+ is_being_destroyed_ = true;
if (!attached() && opener())
opener()->pending_new_windows_.erase(this);
DestroyUnattachedWindows();
GetWebContents()->GetBrowserPluginGuestManager()->RemoveGuest(instance_id_);
- delete GetWebContents();
+ if (!GetWebContents()->IsBeingDestroyed())
+ delete GetWebContents();
}
bool BrowserPluginGuest::OnMessageReceivedFromEmbedder(

Powered by Google App Engine
This is Rietveld 408576698