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

Issue 10114015: Fix bug where transient pages would miss events dispatched while it was (Closed)

Created:
8 years, 8 months ago by Matt Perry
Modified:
8 years, 8 months ago
Reviewers:
Yoyo Zhou
CC:
chromium-reviews, Aaron Boodman, darin-cc_chromium.org, mihaip+watch_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Fix bug where transient pages would miss events dispatched while it was unloading. The fix is a 2-parter: Part 1: lazy_background_queue.* now checks if the background page is unloading before allowing a task to run. If it is unloading, we wait until the page unloads, then reload it. Part 2: Part 1 exposed the problem which I had previously outlined in extension_process_manager.cc:403 - after we reload the page, we occasionally received messages from the renderer to decrement the keepalive count for the old page, throwing the count out of balance. The fix is to make sure we decrement keepalive counts only if the host we incremented them for is still active. BUG=123243 TEST=no Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=133079

Patch Set 1 #

Total comments: 20

Patch Set 2 : yoyo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+307 lines, -226 lines) Patch
M chrome/browser/extensions/extension_event_router.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_event_router.cc View 1 1 chunk +16 lines, -9 lines 0 comments Download
M chrome/browser/extensions/extension_function.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_host.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_host.cc View 1 3 chunks +27 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_message_service.cc View 11 chunks +51 lines, -38 lines 0 comments Download
M chrome/browser/extensions/extension_process_manager.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_process_manager.cc View 2 chunks +10 lines, -9 lines 0 comments Download
M chrome/browser/extensions/lazy_background_task_queue.h View 1 4 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/extensions/lazy_background_task_queue.cc View 1 5 chunks +43 lines, -17 lines 0 comments Download
M chrome/browser/renderer_host/chrome_render_message_filter.h View 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/chrome_render_message_filter.cc View 4 chunks +0 lines, -41 lines 0 comments Download
M chrome/common/extensions/extension_messages.h View 2 chunks +3 lines, -7 lines 0 comments Download
M chrome/renderer/extensions/extension_custom_bindings.cc View 1 2 chunks +16 lines, -86 lines 0 comments Download
M chrome/renderer/extensions/extension_dispatcher.cc View 1 4 chunks +23 lines, -13 lines 0 comments Download
M chrome/renderer/extensions/extension_helper.h View 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_helper.cc View 1 2 chunks +87 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Matt Perry
8 years, 8 months ago (2012-04-18 01:30:06 UTC) #1
Matt Perry
http://codereview.chromium.org/10114015/diff/1/chrome/renderer/extensions/extension_custom_bindings.cc File chrome/renderer/extensions/extension_custom_bindings.cc (left): http://codereview.chromium.org/10114015/diff/1/chrome/renderer/extensions/extension_custom_bindings.cc#oldcode33 chrome/renderer/extensions/extension_custom_bindings.cc:33: class ExtensionViewAccumulator : public content::RenderViewVisitor { BTW, I moved ...
8 years, 8 months ago (2012-04-19 18:57:36 UTC) #2
Yoyo Zhou
http://codereview.chromium.org/10114015/diff/1/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): http://codereview.chromium.org/10114015/diff/1/chrome/browser/extensions/extension_event_router.cc#newcode412 chrome/browser/extensions/extension_event_router.cc:412: ExtensionHost* host = pm->GetBackgroundHostForExtension(extension->id()); You could put this inside ...
8 years, 8 months ago (2012-04-19 21:47:13 UTC) #3
Matt Perry
http://codereview.chromium.org/10114015/diff/1/chrome/browser/extensions/extension_event_router.cc File chrome/browser/extensions/extension_event_router.cc (right): http://codereview.chromium.org/10114015/diff/1/chrome/browser/extensions/extension_event_router.cc#newcode412 chrome/browser/extensions/extension_event_router.cc:412: ExtensionHost* host = pm->GetBackgroundHostForExtension(extension->id()); On 2012/04/19 21:47:13, Yoyo Zhou ...
8 years, 8 months ago (2012-04-19 22:21:53 UTC) #4
Yoyo Zhou
LGTM http://codereview.chromium.org/10114015/diff/1/chrome/browser/extensions/extension_message_service.cc File chrome/browser/extensions/extension_message_service.cc (right): http://codereview.chromium.org/10114015/diff/1/chrome/browser/extensions/extension_message_service.cc#newcode102 chrome/browser/extensions/extension_message_service.cc:102: int dest_port_id, const std::string& channel_name, On 2012/04/19 22:21:53, ...
8 years, 8 months ago (2012-04-19 22:32:55 UTC) #5
Matt Perry
8 years, 8 months ago (2012-04-19 22:34:56 UTC) #6
http://codereview.chromium.org/10114015/diff/1/chrome/browser/extensions/exte...
File chrome/browser/extensions/extension_message_service.cc (right):

http://codereview.chromium.org/10114015/diff/1/chrome/browser/extensions/exte...
chrome/browser/extensions/extension_message_service.cc:102: int dest_port_id,
const std::string& channel_name,
On 2012/04/19 22:32:55, Yoyo Zhou wrote:
> On 2012/04/19 22:21:53, Matt Perry wrote:
> > On 2012/04/19 21:47:13, Yoyo Zhou wrote:
> > > nit: why this change?
> > 
> > Just bringing it up to style code:
> > http://dev.chromium.org/developers/coding-style#TOC-Code-formatting
> 
> It doesn't look particularly recommended for function declarations.

See bullet point that starts "For function declarations and definitions"

Powered by Google App Engine
This is Rietveld 408576698