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

Unified Diff: chrome/browser/guestview/guestview.h

Issue 139603002: <webview>: Speculative crash fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adddressed comment 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 | chrome/browser/guestview/guestview.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/guestview/guestview.h
diff --git a/chrome/browser/guestview/guestview.h b/chrome/browser/guestview/guestview.h
index 46485840a62a5b616aa07ee4e700bc82360060c2..368e94a66babbfd9b6e65e934d944f834b96b30c 100644
--- a/chrome/browser/guestview/guestview.h
+++ b/chrome/browser/guestview/guestview.h
@@ -7,6 +7,7 @@
#include <queue>
+#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "content/public/browser/browser_plugin_guest_delegate.h"
#include "content/public/browser/web_contents.h"
@@ -132,6 +133,10 @@ class GuestView : public content::BrowserPluginGuestDelegate {
// the guest is attached to a particular embedder.
std::queue<Event*> pending_events_;
+ // This is used to ensure pending tasks will not fire after this object is
+ // destroyed.
+ base::WeakPtrFactory<GuestView> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GuestView);
};
« no previous file with comments | « no previous file | chrome/browser/guestview/guestview.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698