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

Issue 519036: Fixes bug where recreating the document element via altering |documentElement... (Closed)

Created:
10 years, 11 months ago by Bons
Modified:
9 years, 5 months ago
CC:
chromium-reviews_googlegroups.com, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=35479

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -0 lines) Patch
M chrome/browser/extensions/extension_host.cc View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Bons
10 years, 11 months ago (2010-01-04 19:38:28 UTC) #1
Pam (message me for reviews)
LGTM. - Pam
10 years, 11 months ago (2010-01-04 20:41:02 UTC) #2
Erik does not do reviews
10 years, 11 months ago (2010-01-04 20:46:36 UTC) #3
LGTM


On Mon, Jan 4, 2010 at 11:38 AM, <andybons@chromium.org> wrote:

> Reviewers: Pam, Erik Kay,
>
> Description:
> 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.
>
> Please review this at http://codereview.chromium.org/519036
>
> SVN Base: svn://chrome-svn/chrome/trunk/src/
>
> Affected files:
>  M     chrome/browser/extensions/extension_host.cc
>
>
> Index: chrome/browser/extensions/extension_host.cc
> ===================================================================
> --- chrome/browser/extensions/extension_host.cc (revision 35457)
> +++ chrome/browser/extensions/extension_host.cc (working copy)
> @@ -355,6 +355,11 @@
>  }
>
>  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();
>
>
>

Powered by Google App Engine
This is Rietveld 408576698