summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-04 21:27:59 +0000
committerandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-04 21:27:59 +0000
commit97c6401de6a70293b8c6506408934d9f15749cfb (patch)
tree633edcd3fde8af6dada45da6880cdc24cd333e03 /chrome
parentfbe3426109d49108f9d474ed00c061672e861cab (diff)
downloadchromium_src-97c6401de6a70293b8c6506408934d9f15749cfb.zip
chromium_src-97c6401de6a70293b8c6506408934d9f15749cfb.tar.gz
chromium_src-97c6401de6a70293b8c6506408934d9f15749cfb.tar.bz2
Fixes bug where recreating the document element via altering |documentElement.innerHTML| would cause ExtensionHost::DocumentAvailableInMainFrame to be called more than once for a single RenderViewHost. Since setup is performed within that function that does not need to be done more than once (and cannot be since it registers for notifications from all sources), we check to see if setup has been performed and bail if so.
BUG=31170 TEST=Install the eBay extension (id khhckppjhonfmcpegdjdibmngahahhck ) and click on the browser action button in Debug mode. It should not hit the DCHECK from registering redundant notifications. Review URL: http://codereview.chromium.org/519036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extension_host.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 525b267..e905291 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -355,6 +355,11 @@ void ExtensionHost::DidStopLoading() {
}
void ExtensionHost::DocumentAvailableInMainFrame(RenderViewHost* rvh) {
+ // If the document has already been marked as available for this host, then
+ // bail. No need for the redundant setup. http://crbug.com/31170
+ if (document_element_available_)
+ return;
+
document_element_available_ = true;
if (is_background_page()) {
extension_->SetBackgroundPageReady();