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

Issue 2355183002: [Extensions] Don't run unload listeners when an extension is removed (Closed)

Created:
4 years, 3 months ago by Devlin
Modified:
4 years, 2 months ago
Reviewers:
Charlie Reis, sky
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, nasko
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions] Don't run unload listeners when an extension is removed When an extension is removed, we close all the tabs for that extension*. If any of these tabs had unload or beforeunload listeners, this close process is asynchronous. However, if the listener performs any network request, this would result in Chrome killing the tab for having an invalid origin (the extension has been removed). Instead, don't run these listeners at all. Since the extension has been removed, there's no reason the code in the tab should run - the extension should not be able to continue acting. *a tab for an extension refers to a tab pointing to a resource of that extension, like chrome-extension://<id>/page.html. Note: This does not address the case of terminated extensions, where we don't currently close the extension tabs, or the case of embedded iframes in non-extension pages. BUG=531378 Committed: https://crrev.com/235441341064c329b155b09235d1aa8e5ea006f4 Cr-Commit-Position: refs/heads/master@{#421024}

Patch Set 1 : ready #

Total comments: 15

Patch Set 2 : Charlie's #

Patch Set 3 : Remove terminated extensions reference #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -1 line) Patch
A chrome/browser/extensions/extension_unload_browsertest.cc View 1 2 1 chunk +40 lines, -0 lines 0 comments Download
M chrome/browser/ui/fast_unload_controller.cc View 1 2 chunks +18 lines, -1 line 0 comments Download
M chrome/browser/ui/unload_controller.cc View 1 2 chunks +18 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/unload_listener/manifest.json View 1 chunk +6 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/unload_listener/page.html View 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/unload_listener/page.js View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (17 generated)
Devlin
Hey Charlie, mind taking a look? As mentioned in the CL description, this doesn't address ...
4 years, 3 months ago (2016-09-21 17:50:05 UTC) #8
Charlie Reis
Thanks for the quick CL! Mostly looks good with nits, with one question about iframes. ...
4 years, 3 months ago (2016-09-21 18:29:33 UTC) #9
Devlin
> I did confirm that an embedded extension iframe will be killed if it makes ...
4 years, 3 months ago (2016-09-22 00:35:21 UTC) #10
Devlin
+sky for UI owners
4 years, 3 months ago (2016-09-22 00:36:00 UTC) #12
sky
LGTM
4 years, 3 months ago (2016-09-22 13:11:37 UTC) #13
Charlie Reis
On 2016/09/22 00:35:21, Devlin (OOO until sep 26) wrote: > > I did confirm that ...
4 years, 3 months ago (2016-09-22 20:37:48 UTC) #14
Devlin
https://codereview.chromium.org/2355183002/diff/20001/chrome/browser/extensions/extension_unload_browsertest.cc File chrome/browser/extensions/extension_unload_browsertest.cc (right): https://codereview.chromium.org/2355183002/diff/20001/chrome/browser/extensions/extension_unload_browsertest.cc#newcode38 chrome/browser/extensions/extension_unload_browsertest.cc:38: // TODO(devlin): We should replicate this behavior for terminated ...
4 years, 2 months ago (2016-09-26 19:44:46 UTC) #20
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/2355183002/60001
4 years, 2 months ago (2016-09-26 19:45:51 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:60001)
4 years, 2 months ago (2016-09-26 22:39:29 UTC) #25
commit-bot: I haz the power
4 years, 2 months ago (2016-09-26 22:43:45 UTC) #27
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/235441341064c329b155b09235d1aa8e5ea006f4
Cr-Commit-Position: refs/heads/master@{#421024}

Powered by Google App Engine
This is Rietveld 408576698