diff options
author | benjhayden@chromium.org <benjhayden@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 17:04:29 +0000 |
---|---|---|
committer | benjhayden@chromium.org <benjhayden@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 17:04:29 +0000 |
commit | 898f2f39a4e16b6205d16920c451bc719fa5002c (patch) | |
tree | 307cdcedb208badf0f8bed5960ec0a3a5e57fa66 /chrome/browser/ui/tab_contents/tab_contents_wrapper.h | |
parent | 444ccbad174b78ea996df35431e7f669a61b5737 (diff) | |
download | chromium_src-898f2f39a4e16b6205d16920c451bc719fa5002c.zip chromium_src-898f2f39a4e16b6205d16920c451bc719fa5002c.tar.gz chromium_src-898f2f39a4e16b6205d16920c451bc719fa5002c.tar.bz2 |
Fix crashes in DownloadRequestLimiter when extension popups/bubbles initiate downloads automatically
Automatically cancel automatic (non-user-gesture) downloads from bubbles after the first.
Merge DownloadRequestLimiterObserver into TabDownloadState. (NavigationController and WebContents are 1:1.)
TODO eventually: send a message to extensions' consoles about chrome.downloads.download() when automatic downloads are automatically cancelled.
Every WebContents continues to get one automatic download.
This patch is based on Avi's https://chromiumcodereview.appspot.com/10409031/
BUG=128368
Review URL: https://chromiumcodereview.appspot.com/10412061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139554 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/tab_contents/tab_contents_wrapper.h')
-rw-r--r-- | chrome/browser/ui/tab_contents/tab_contents_wrapper.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h index 83a5d3f..3bff9f2 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h @@ -22,7 +22,6 @@ class BlockedContentTabHelper; class BookmarkTabHelper; class ConstrainedWindowTabHelper; class CoreTabHelper; -class DownloadRequestLimiterObserver; class ExtensionTabHelper; class ExternalProtocolObserver; class FaviconTabHelper; @@ -75,6 +74,19 @@ class SafeBrowsingTabObserver; // Wraps WebContents and all of its supporting objects in order to control // their ownership and lifetime. // +// WARNING: Not every place where HTML can run has a TabContentsWrapper. This +// class is *only* used in a visible, actual, tab inside a browser. Examples of +// things that do not have tab wrappers include: +// - Extension background pages and popup bubbles +// - HTML notification bubbles +// - Screensavers on Chrome OS +// - Other random places we decide to display HTML over time +// +// Consider carefully whether your feature is something that makes sense only +// when a tab is displayed, or could make sense in other cases we use HTML. It +// may makes sense to push down into WebContents and make configurable, or at +// least to make easy for other WebContents hosts to include and support. +// // TODO(avi): Eventually, this class will become TabContents as far as // the browser front-end is concerned. class TabContentsWrapper : public content::WebContentsObserver { @@ -271,7 +283,6 @@ class TabContentsWrapper : public content::WebContentsObserver { // and silently do their thing live here.) scoped_ptr<AlternateErrorPageTabObserver> alternate_error_page_tab_observer_; - scoped_ptr<DownloadRequestLimiterObserver> download_request_limiter_observer_; scoped_ptr<extensions::WebNavigationTabObserver> webnavigation_observer_; scoped_ptr<ExternalProtocolObserver> external_protocol_observer_; scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; |