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

Issue 2213123002: [Extensions] Ensure ordering of extension [un]loaded, activated messages (Closed)

Created:
4 years, 4 months ago by Devlin
Modified:
4 years, 4 months ago
Reviewers:
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2785
Target Ref:
refs/pending/branch-heads/2785
Project:
chromium
Visibility:
Public.

Description

[Extensions] Ensure ordering of extension [un]loaded, activated messages We send three messages to the renderer in order to maintain extension lifetime and active state: extension loaded, extension unloaded, and extension activated. The loaded message is sent when a) an extension is loaded and b) initially when the render process starts. Unloaded messages are sent when an extension is unloaded to any running process. Activated messages are sent to a renderer when a render view corresponding to an extension is created. Unfortunately, the existent render processes are not always initialized. We have code to queue up messages until the render process is properly initialized, which ensures that at least the loaded message with all currently-loaded extensions is sent first, followed by queued messages in FIFO. However, this breaks in the following scenario: - Renderer created, not fully initialized (channel not created) - Render view created, activate extension 'A' message sent. Since the process is not initialized, this message is queued. - Extension unloaded. Extension 'A' unloaded message is also queued. - Renderer initialized. We initialize the renderer with all loaded extensions, however, Extension 'A' is no longer loaded, so is (rightly) included in the list. - Extension renderer receives messages for loaded extensions, activate extension 'A', unload extension 'A'. Since extension 'A' was never loaded, the queued messages break assumptions (and cause a crash). Fix this by passing all loaded, unloaded, and activated messages through a common source that keeps track of initialized render processes, and will not send messages until the process is initialized, as well as cleaning up unnecessary messages (such as activating extensions that have since been unloaded). Also add a regression test. BUG=528026 Review-Url: https://codereview.chromium.org/2162983002 Cr-Commit-Position: refs/heads/master@{#407796} (cherry picked from commit 5e510e8037bb3cdf0bfb5cf07bbb7fe3c94450f9) Committed: https://chromium.googlesource.com/chromium/src/+/1719b2ac728c8745554ca458188af7f6d20b3d0f

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -39 lines) Patch
M chrome/browser/extensions/extension_service.h View 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 4 chunks +6 lines, -30 lines 0 comments Download
A chrome/browser/extensions/renderer_initialization_browsertest.cc View 1 chunk +40 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/simple_with_file/file.html View 1 chunk +9 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/simple_with_file/manifest.json View 1 chunk +2 lines, -1 line 0 comments Download
M extensions/browser/extension_web_contents_observer.cc View 2 chunks +4 lines, -1 line 0 comments Download
M extensions/browser/renderer_startup_helper.h View 4 chunks +41 lines, -1 line 0 comments Download
M extensions/browser/renderer_startup_helper.cc View 3 chunks +69 lines, -3 lines 0 comments Download
M extensions/renderer/dispatcher.cc View 3 chunks +11 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (1 generated)
Devlin
Committed patchset #1 (id:1) manually as 1719b2ac728c8745554ca458188af7f6d20b3d0f.
4 years, 4 months ago (2016-08-04 20:05:19 UTC) #2
Devlin
4 years, 4 months ago (2016-08-04 20:53:00 UTC) #3
Message was sent while issue was closed.
A revert of this CL (patchset #1 id:1) has been created in
https://codereview.chromium.org/2211213002/ by rdevlin.cronin@chromium.org.

The reason for reverting is: Broke compile.

Powered by Google App Engine
This is Rietveld 408576698