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

Issue 2211213002: Revert of [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

Revert of [Extensions] Ensure ordering of extension [un]loaded, activated messages (patchset #1 id:1 of https://codereview.chromium.org/2213123002/ ) Reason for revert: Broke compile Original issue's 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 TBR= # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=528026

Patch Set 1 #

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

Messages

Total messages: 4 (1 generated)
Devlin
Created Revert of [Extensions] Ensure ordering of extension [un]loaded, activated messages
4 years, 4 months ago (2016-08-04 20:53:01 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2211213002/1
4 years, 4 months ago (2016-08-04 20:53:37 UTC) #3
commit-bot: I haz the power
4 years, 4 months ago (2016-08-04 20:55:58 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1)

Powered by Google App Engine
This is Rietveld 408576698