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

Issue 2830893002: Refactor of ExtensionNavigationThrottle (Closed)

Created:
3 years, 8 months ago by ncarter (slow)
Modified:
3 years, 7 months ago
Reviewers:
Devlin, Peter Kasting, nasko
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor of ExtensionNavigationThrottle Functional changes here are: - Treating an extension-origin "about:blank" iframe as extension, for the purposes of the web_accessible_resources ancestor check. - Treating nested URLs as non-web_accessible_resources for the purposes of subframe navigation (this fixes 661324) These should both be minor, and are incidental. Pure refactoring here is: - Preferring url::Origin() checks (which leads to the functional changes above). - Renaming of variables for clarity. - Hoisting the extension lookup to the top of the function, and eliminating !extension and !registry checks after dealing with the lookup result. - A more efficient lookup of the parent frame, in a way that shouldn't require an "this is safe" apology comment. - Reflow control logic in anticipation of adding new BLOCK cases for platform apps (in a follow-on CL). BUG=661324 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2830893002 Cr-Commit-Position: refs/heads/master@{#473717} Committed: https://chromium.googlesource.com/chromium/src/+/6cfe5c7f23e1447422a21ddc7b6aa597a0e7021a

Patch Set 1 #

Patch Set 2 : Survives local testing. #

Patch Set 3 : Fixes. #

Patch Set 4 : Carve out exception for guests. #

Patch Set 5 : Fix sandbox pages #

Patch Set 6 : Fix some tests. #

Patch Set 7 : Another shot. #

Patch Set 8 : block uninstalled extensions. #

Patch Set 9 : Pare down CL to just refactoring part. #

Patch Set 10 : EOF #

Patch Set 11 : Fix defect. #

Patch Set 12 : Blockage. #

Total comments: 3

Patch Set 13 : Nasko's fix #

Total comments: 12

Patch Set 14 : Test robustness changes. #

Patch Set 15 : More comments. #

Patch Set 16 : Fix ExtensionBrowserTest.WindowOpenInvalidExtension under PlzNavigate #

Total comments: 2

Patch Set 17 : One more comment #

Total comments: 9

Patch Set 18 : Expand WindowOpenInvalidExtension to demonstrate functional change of blocking invalid extensions. #

Patch Set 19 : Format #

Patch Set 20 : Expand unittests #

Patch Set 21 : Remove unnecessary line. #

Total comments: 8

Patch Set 22 : Rename test. #

Patch Set 23 : Fix comment. #

Patch Set 24 : Fix bug #

Patch Set 25 : Merge branch 'plznav_browser_initiated' into kill_107_reboot2 #

Patch Set 26 : Fix toolbar model unittest #

Total comments: 2

Patch Set 27 : \ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -168 lines) Patch
M chrome/browser/extensions/extension_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +12 lines, -17 lines 0 comments Download
M chrome/browser/extensions/extension_navigation_throttle_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +63 lines, -7 lines 0 comments Download
M chrome/browser/extensions/process_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +9 lines, -25 lines 0 comments Download
M chrome/browser/extensions/window_open_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +25 lines, -10 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 3 chunks +42 lines, -28 lines 0 comments Download
M extensions/browser/extension_navigation_throttle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +90 lines, -81 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 131 (106 generated)
ncarter (slow)
nasko, please review
3 years, 7 months ago (2017-04-27 21:08:07 UTC) #48
nasko
LGTM https://codereview.chromium.org/2830893002/diff/220001/chrome/browser/extensions/process_manager_browsertest.cc File chrome/browser/extensions/process_manager_browsertest.cc (left): https://codereview.chromium.org/2830893002/diff/220001/chrome/browser/extensions/process_manager_browsertest.cc#oldcode870 chrome/browser/extensions/process_manager_browsertest.cc:870: !content::IsBrowserSideNavigationEnabled()) { Nice to see this difference gone! ...
3 years, 7 months ago (2017-04-27 23:14:06 UTC) #53
ncarter (slow)
https://codereview.chromium.org/2830893002/diff/220001/extensions/browser/extension_navigation_throttle.cc File extensions/browser/extension_navigation_throttle.cc (right): https://codereview.chromium.org/2830893002/diff/220001/extensions/browser/extension_navigation_throttle.cc#newcode92 extensions/browser/extension_navigation_throttle.cc:92: std::string resource_path = url.path(); On 2017/04/27 23:14:06, nasko wrote: ...
3 years, 7 months ago (2017-04-27 23:19:41 UTC) #54
ncarter (slow)
Devlin, please review
3 years, 7 months ago (2017-04-27 23:19:57 UTC) #56
Devlin
https://codereview.chromium.org/2830893002/diff/240001/extensions/browser/extension_navigation_throttle.cc File extensions/browser/extension_navigation_throttle.cc (right): https://codereview.chromium.org/2830893002/diff/240001/extensions/browser/extension_navigation_throttle.cc#newcode38 extensions/browser/extension_navigation_throttle.cc:38: bool url_has_extension_scheme = url.SchemeIs(kExtensionScheme); Is it worth a brief ...
3 years, 7 months ago (2017-04-28 22:13:03 UTC) #65
ncarter (slow)
https://codereview.chromium.org/2830893002/diff/240001/extensions/browser/extension_navigation_throttle.cc File extensions/browser/extension_navigation_throttle.cc (right): https://codereview.chromium.org/2830893002/diff/240001/extensions/browser/extension_navigation_throttle.cc#newcode38 extensions/browser/extension_navigation_throttle.cc:38: bool url_has_extension_scheme = url.SchemeIs(kExtensionScheme); On 2017/04/28 22:13:02, Devlin wrote: ...
3 years, 7 months ago (2017-05-01 21:50:38 UTC) #74
Devlin
https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc File extensions/browser/extension_navigation_throttle.cc (right): https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc#newcode65 extensions/browser/extension_navigation_throttle.cc:65: return content::NavigationThrottle::PROCEED; On 2017/05/01 21:50:37, ncarter wrote: > Note ...
3 years, 7 months ago (2017-05-01 22:04:28 UTC) #77
ncarter (slow)
https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc File extensions/browser/extension_navigation_throttle.cc (right): https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc#newcode148 extensions/browser/extension_navigation_throttle.cc:148: // Cancel navigations to nested URLs, to match the ...
3 years, 7 months ago (2017-05-01 22:42:54 UTC) #78
Devlin
https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc File extensions/browser/extension_navigation_throttle.cc (right): https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc#newcode148 extensions/browser/extension_navigation_throttle.cc:148: // Cancel navigations to nested URLs, to match the ...
3 years, 7 months ago (2017-05-02 01:52:10 UTC) #79
ncarter (slow)
https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc File extensions/browser/extension_navigation_throttle.cc (right): https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc#newcode65 extensions/browser/extension_navigation_throttle.cc:65: return content::NavigationThrottle::PROCEED; On 2017/05/01 22:04:28, Devlin wrote: > On ...
3 years, 7 months ago (2017-05-02 20:14:15 UTC) #80
ncarter (slow)
https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc File extensions/browser/extension_navigation_throttle.cc (right): https://codereview.chromium.org/2830893002/diff/320001/extensions/browser/extension_navigation_throttle.cc#newcode65 extensions/browser/extension_navigation_throttle.cc:65: return content::NavigationThrottle::PROCEED; On 2017/05/02 20:14:15, ncarter wrote: > On ...
3 years, 7 months ago (2017-05-02 23:53:15 UTC) #81
ncarter (slow)
Remove unnecessary line.
3 years, 7 months ago (2017-05-11 20:29:09 UTC) #86
ncarter (slow)
Nasko: PTAL. I've restored the blocking of invalid/disabled extensions so that it applies to the ...
3 years, 7 months ago (2017-05-11 20:40:09 UTC) #89
nasko
On 2017/05/11 20:40:09, ncarter wrote: > Nasko: PTAL. > > I've restored the blocking of ...
3 years, 7 months ago (2017-05-11 22:14:06 UTC) #92
Devlin
lgtm https://codereview.chromium.org/2830893002/diff/400001/chrome/browser/extensions/extension_navigation_throttle_unittest.cc File chrome/browser/extensions/extension_navigation_throttle_unittest.cc (right): https://codereview.chromium.org/2830893002/diff/400001/chrome/browser/extensions/extension_navigation_throttle_unittest.cc#newcode194 chrome/browser/extensions/extension_navigation_throttle_unittest.cc:194: // Test blob and filesystem URLs with disabled/invalid ...
3 years, 7 months ago (2017-05-12 01:19:42 UTC) #93
ncarter (slow)
https://codereview.chromium.org/2830893002/diff/400001/chrome/browser/extensions/extension_navigation_throttle_unittest.cc File chrome/browser/extensions/extension_navigation_throttle_unittest.cc (right): https://codereview.chromium.org/2830893002/diff/400001/chrome/browser/extensions/extension_navigation_throttle_unittest.cc#newcode194 chrome/browser/extensions/extension_navigation_throttle_unittest.cc:194: // Test blob and filesystem URLs with disabled/invalid extensions. ...
3 years, 7 months ago (2017-05-12 17:32:19 UTC) #96
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/2830893002/440001
3 years, 7 months ago (2017-05-12 17:34:55 UTC) #99
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/453215)
3 years, 7 months ago (2017-05-12 19:48:25 UTC) #101
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/2830893002/440001
3 years, 7 months ago (2017-05-12 22:19:59 UTC) #103
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/453567)
3 years, 7 months ago (2017-05-12 23:38:58 UTC) #105
ncarter (slow)
+pkasting: please look at toolbar_model_unittest.cc. My changes to the ExtensionNavigationThrottle required that this test use ...
3 years, 7 months ago (2017-05-17 19:07:20 UTC) #118
Peter Kasting
LGTM https://codereview.chromium.org/2830893002/diff/500001/chrome/browser/ui/toolbar/toolbar_model_unittest.cc File chrome/browser/ui/toolbar/toolbar_model_unittest.cc (right): https://codereview.chromium.org/2830893002/diff/500001/chrome/browser/ui/toolbar/toolbar_model_unittest.cc#newcode102 chrome/browser/ui/toolbar/toolbar_model_unittest.cc:102: // valid. Nit: I would extend this comment ...
3 years, 7 months ago (2017-05-17 23:13:59 UTC) #119
ncarter (slow)
https://codereview.chromium.org/2830893002/diff/500001/chrome/browser/ui/toolbar/toolbar_model_unittest.cc File chrome/browser/ui/toolbar/toolbar_model_unittest.cc (right): https://codereview.chromium.org/2830893002/diff/500001/chrome/browser/ui/toolbar/toolbar_model_unittest.cc#newcode102 chrome/browser/ui/toolbar/toolbar_model_unittest.cc:102: // valid. On 2017/05/17 23:13:59, Peter Kasting wrote: > ...
3 years, 7 months ago (2017-05-22 21:14:29 UTC) #123
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/2830893002/520001
3 years, 7 months ago (2017-05-22 21:15:35 UTC) #128
commit-bot: I haz the power
3 years, 7 months ago (2017-05-22 22:01:04 UTC) #131
Message was sent while issue was closed.
Committed patchset #27 (id:520001) as
https://chromium.googlesource.com/chromium/src/+/6cfe5c7f23e1447422a21ddc7b6a...

Powered by Google App Engine
This is Rietveld 408576698