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

Issue 2455393002: PS - Adjusting webRequest API for use in Public Sessions (Closed)

Created:
4 years, 1 month ago by Ivan Šandrk
Modified:
4 years, 1 month ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Filter out privacy/security sensitive data from webRequests in Public Sessions. Enable all URLs for webRequest for regular extensions in Public Sessions. Note: Origin/URL permissions are completely disabled in Public Sessions for privacy/security reasons so this is a workaround. Doc explaining the changes to webRequest API in details go/webrequest-whitelisting. BUG=661678 Committed: https://crrev.com/3e7318b652b0fa22e68b3cb4de0e93cfef12f15c Cr-Commit-Position: refs/heads/master@{#432469}

Patch Set 1 #

Patch Set 2 : Added #ifdef(OS_CHROMEOS) #

Patch Set 3 : Fixed broken tests #

Patch Set 4 : Removed unnecessary include #

Patch Set 5 : Updated IsPublicSession function #

Total comments: 4

Patch Set 6 : Added a CHECK to make sure the extension is installed by policy #

Patch Set 7 : Moved a part of code and added unit tests for URL whitelisting (part 1/2) #

Total comments: 6

Patch Set 8 : Drew's nits #

Total comments: 2

Patch Set 9 : Merged other CL, added tests #

Patch Set 10 : Fixed build error, ifdef(chromeos) #

Patch Set 11 : Added unit test for WebRequestEventDetails #

Patch Set 12 : Renamed var, fixed errors (empty constructor initialization) #

Patch Set 13 : Fixed unittest error #

Total comments: 24

Patch Set 14 : Updated code #

Total comments: 3

Patch Set 15 : Devlin's comments #

Patch Set 16 : Changed wrong framework.js file, fixing #

Total comments: 2

Patch Set 17 : Fixed unittest #

Total comments: 14

Patch Set 18 : Devlin's comments #2 #

Patch Set 19 : Rebase #

Total comments: 4

Patch Set 20 : Nits, disable chrome:// URLs, chrome:// test #

Patch Set 21 : webRequest and webRequestBlocking are safe permissions now #

Unified diffs Side-by-side diffs Delta from patch set Stats (+812 lines, -15 lines) Patch
M chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +3 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +18 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/web_request/web_request_event_details_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +67 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +76 lines, -8 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_public_session/framework.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +417 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_public_session/manifest.json View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_public_session/res/a.html View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_public_session/res/b.html View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_public_session/test.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_public_session/test.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +110 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +32 lines, -1 line 0 comments Download
M extensions/browser/api/web_request/web_request_api_constants.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api_constants.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_event_details.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +10 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_event_details.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +30 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_permissions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_permissions.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +24 lines, -0 lines 0 comments Download

Messages

Total messages: 107 (83 generated)
Ivan Šandrk
Hey Devlin, mind taking a preliminary look at this and tell me what you think? ...
4 years, 1 month ago (2016-11-02 15:44:47 UTC) #17
Devlin
https://codereview.chromium.org/2455393002/diff/80001/extensions/browser/api/web_request/web_request_api.cc File extensions/browser/api/web_request/web_request_api.cc (right): https://codereview.chromium.org/2455393002/diff/80001/extensions/browser/api/web_request/web_request_api.cc#newcode1460 extensions/browser/api/web_request/web_request_api.cc:1460: if (IsPublicSession() && extension && extension->is_extension()) { We want ...
4 years, 1 month ago (2016-11-03 00:33:46 UTC) #24
Ivan Šandrk
I also wonder what you think about the general structure of the changes, are you ...
4 years, 1 month ago (2016-11-03 14:45:12 UTC) #25
Ivan Šandrk
Hey Devlin, polite ping!
4 years, 1 month ago (2016-11-04 16:39:00 UTC) #27
Devlin
On 2016/11/03 14:45:12, Ivan Šandrk wrote: > I also wonder what you think about the ...
4 years, 1 month ago (2016-11-05 06:04:37 UTC) #28
Devlin
Also note we will need tests for this.
4 years, 1 month ago (2016-11-05 06:05:16 UTC) #29
Ivan Šandrk
Btw I guess you should also take a look at this doc go/webrequest-whitelisting (doc explaining ...
4 years, 1 month ago (2016-11-07 10:50:03 UTC) #31
Ivan Šandrk
In Patch Set 7 I moved a part of code because I didn't see an ...
4 years, 1 month ago (2016-11-07 14:59:39 UTC) #34
Andrew T Wilson (Slow)
LGTM with a few comment nits https://codereview.chromium.org/2455393002/diff/120001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc File chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc (right): https://codereview.chromium.org/2455393002/diff/120001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc#newcode216 chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc:216: false /*crosses_incognito*/, please ...
4 years, 1 month ago (2016-11-09 08:36:00 UTC) #37
Ivan Šandrk
https://codereview.chromium.org/2455393002/diff/120001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc File chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc (right): https://codereview.chromium.org/2455393002/diff/120001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc#newcode216 chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc:216: false /*crosses_incognito*/, On 2016/11/09 08:36:00, Andrew T Wilson (Slow) ...
4 years, 1 month ago (2016-11-09 12:12:13 UTC) #40
Devlin
https://codereview.chromium.org/2455393002/diff/140001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc File chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc (right): https://codereview.chromium.org/2455393002/diff/140001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc#newcode225 chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc:225: // Host permission checks are disabled in Public Sessions, ...
4 years, 1 month ago (2016-11-10 16:04:58 UTC) #43
Ivan Šandrk
I've merged the other CL in this one because with the tests being so similar ...
4 years, 1 month ago (2016-11-10 17:56:19 UTC) #46
Ivan Šandrk
Hi Devlin, could you take a look at this today? We'd like to land it ...
4 years, 1 month ago (2016-11-11 13:40:32 UTC) #67
Devlin
> I've also disabled the CHECK you requested for now because I'm unsure how to ...
4 years, 1 month ago (2016-11-14 17:44:39 UTC) #70
Ivan Šandrk
This should be it. If I missed something, sorry. Pretty tired at this point. https://codereview.chromium.org/2455393002/diff/260001/chrome/browser/extensions/api/web_request/web_request_event_details_unittest.cc ...
4 years, 1 month ago (2016-11-14 20:16:13 UTC) #71
Devlin
https://codereview.chromium.org/2455393002/diff/260001/extensions/browser/api/web_request/web_request_api.cc File extensions/browser/api/web_request/web_request_api.cc (right): https://codereview.chromium.org/2455393002/diff/260001/extensions/browser/api/web_request/web_request_api.cc#newcode1134 extensions/browser/api/web_request/web_request_api.cc:1134: event_details = event_details->WhitelistedCopyForPublicSession(); On 2016/11/14 20:16:13, Ivan Šandrk wrote: ...
4 years, 1 month ago (2016-11-15 01:19:37 UTC) #72
Ivan Šandrk
This should be it! https://codereview.chromium.org/2455393002/diff/260001/extensions/browser/api/web_request/web_request_api.cc File extensions/browser/api/web_request/web_request_api.cc (right): https://codereview.chromium.org/2455393002/diff/260001/extensions/browser/api/web_request/web_request_api.cc#newcode1134 extensions/browser/api/web_request/web_request_api.cc:1134: event_details = event_details->WhitelistedCopyForPublicSession(); On 2016/11/15 ...
4 years, 1 month ago (2016-11-15 13:49:58 UTC) #75
Devlin
https://codereview.chromium.org/2455393002/diff/320001/chrome/browser/extensions/api/web_request/web_request_apitest.cc File chrome/browser/extensions/api/web_request/web_request_apitest.cc (right): https://codereview.chromium.org/2455393002/diff/320001/chrome/browser/extensions/api/web_request/web_request_apitest.cc#newcode177 chrome/browser/extensions/api/web_request/web_request_apitest.cc:177: WebRequestPermissions::AllowAllExtensionLocationsInPublicSessionForTesting( On 2016/11/15 13:49:58, Ivan Šandrk wrote: > QQ ...
4 years, 1 month ago (2016-11-15 15:12:03 UTC) #80
Ivan Šandrk
Thanks for explaining how tests are setup and torn down :) https://codereview.chromium.org/2455393002/diff/340001/chrome/browser/extensions/api/web_request/web_request_event_details_unittest.cc File chrome/browser/extensions/api/web_request/web_request_event_details_unittest.cc (right): ...
4 years, 1 month ago (2016-11-15 16:07:40 UTC) #85
Devlin
lgtm; thanks for your patience! https://codereview.chromium.org/2455393002/diff/370001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc File chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc (right): https://codereview.chromium.org/2455393002/diff/370001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc#newcode207 chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc:207: GURL("http://example.org"), net::DEFAULT_PRIORITY, NULL)); nit: ...
4 years, 1 month ago (2016-11-16 02:42:37 UTC) #92
Ivan Šandrk
All done. Thanks for your help! https://codereview.chromium.org/2455393002/diff/370001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc File chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc (right): https://codereview.chromium.org/2455393002/diff/370001/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc#newcode207 chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc:207: GURL("http://example.org"), net::DEFAULT_PRIORITY, NULL)); ...
4 years, 1 month ago (2016-11-16 10:07:51 UTC) #98
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/2455393002/410001
4 years, 1 month ago (2016-11-16 12:19:19 UTC) #103
commit-bot: I haz the power
Committed patchset #21 (id:410001)
4 years, 1 month ago (2016-11-16 13:03:09 UTC) #105
commit-bot: I haz the power
4 years, 1 month ago (2016-11-16 13:07:11 UTC) #107
Message was sent while issue was closed.
Patchset 21 (id:??) landed as
https://crrev.com/3e7318b652b0fa22e68b3cb4de0e93cfef12f15c
Cr-Commit-Position: refs/heads/master@{#432469}

Powered by Google App Engine
This is Rietveld 408576698