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

Unified Diff: chrome/browser/download/download_request_limiter_observer.h

Issue 10412061: Fix crashes in DownloadRequestLimiter when extension popups/bubbles initiate downloads automatically (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 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: chrome/browser/download/download_request_limiter_observer.h
diff --git a/chrome/browser/download/download_request_limiter_observer.h b/chrome/browser/download/download_request_limiter_observer.h
index b0fa5953874f6115b9cfdab3f2b22e32d24c1202..6096e930599800e1448dd41094892d1a30b678e3 100644
--- a/chrome/browser/download/download_request_limiter_observer.h
+++ b/chrome/browser/download/download_request_limiter_observer.h
@@ -5,18 +5,28 @@
#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_OBSERVER_H_
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_OBSERVER_H_
+#include "base/callback.h"
#include "content/public/browser/web_contents_observer.h"
// Watches for user gesture notifications.
class DownloadRequestLimiterObserver : public content::WebContentsObserver {
public:
- explicit DownloadRequestLimiterObserver(content::WebContents* web_contents);
+ typedef base::Callback<void(DownloadRequestLimiterObserver*)>
+ DestroyedCallback;
+
+ DownloadRequestLimiterObserver(
+ content::WebContents* web_contents,
+ const DestroyedCallback& on_destroyed);
virtual ~DownloadRequestLimiterObserver();
// content::WebContentsObserver overrides.
virtual void DidGetUserGesture() OVERRIDE;
+ virtual void WebContentsDestroyed(
+ content::WebContents* web_contents) OVERRIDE;
private:
+ DestroyedCallback on_destroyed_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiterObserver);
};

Powered by Google App Engine
This is Rietveld 408576698