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

Issue 28273006: <webview>: Implement declarativeWebRequest API (Closed)

Created:
7 years, 2 months ago by Fady Samuel
Modified:
7 years, 1 month ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

<webview>: Implement declarativeWebRequest API This CL exposes the declarative WebRequest API to <webview>s. This CL isolates rules registries on a per-<profile, embedder_process_id, webview_instance_id> tuple. For extensions, the pair <embedder_process_id, webview_instance_id> == <0, 0>. Rules registries are now created on-demand rather than on creation of the RulesRegistryService. This is so that we only create rules registries for webviews if the webview adds rules. This also allows rules to be installed prior to initial navigation of a webview. Sample code: var webview = document.querySelector('webview'); var rule = { conditions: [ new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'slashdot.org' } }) ], actions: [ new chrome.webViewRequest.CancelRequest() ] }; webview.request.onRequest.addRules([rule]) BUG=273855 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=234724

Patch Set 1 #

Patch Set 2 : remove unnecessary line in web_view.js #

Patch Set 3 : Works #

Patch Set 4 : Isolation works #

Patch Set 5 : Isolation fixes #

Patch Set 6 : Cleanup #

Patch Set 7 : Add rules registries lazily to allow adding <webview> rules prior to attachment #

Patch Set 8 : Cleanup #

Patch Set 9 : Implement chrome.webViewRequest.*. #

Patch Set 10 : Implemented chrome.webViewRequest.* #

Patch Set 11 : Remove webview.request actions/conditions #

Patch Set 12 : All rules methods work #

Patch Set 13 : One content rules registry. Tests compile. #

Patch Set 14 : Fix tests #

Patch Set 15 : Fixed unit test failures #

Patch Set 16 : Patch #

Patch Set 17 : Remove rules registry when embedder is destroyed #

Patch Set 18 : Fixed unit tests #

Patch Set 19 : Added tests #

Total comments: 34

Patch Set 20 : Addressed most comments #

Patch Set 21 : Patch #

Patch Set 22 : Reupload #

Total comments: 1

Patch Set 23 : Merge with ToT; declarative API seems broken #

Patch Set 24 : Closer but still some test failure #

Patch Set 25 : Tests seem to work #

Patch Set 26 : Merged with toT #

Total comments: 6

Patch Set 27 : Fix assert failure #

Patch Set 28 : Addressed nits #

Patch Set 29 : Move to experimental #

Patch Set 30 : Remove extra console.log #

Total comments: 8

Patch Set 31 : Addressed Istiaque's comments #

Total comments: 6

Patch Set 32 : Addressed nits #

Patch Set 33 : Merge with ToT #

Patch Set 34 : Fix browser_tests #

Patch Set 35 : Fixed browser_tests build #

Total comments: 63

Patch Set 36 : #

Total comments: 6

Patch Set 37 : Addressed nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+598 lines, -96 lines) Patch
M chrome/browser/apps/web_view_browsertest.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 27 28 29 30 31 32 33 34 35 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/apps/web_view_interactive_browsertest.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 27 28 29 30 31 32 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/declarative/declarative_api.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 27 28 29 30 31 32 33 34 35 36 3 chunks +46 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative/declarative_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/api/declarative/initializing_rules_registry_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 27 28 29 30 31 32 33 34 35 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry.h 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 27 28 29 30 31 32 33 34 35 36 5 chunks +28 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry.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 27 28 29 30 31 32 33 34 35 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_service.h 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 27 28 29 30 31 32 33 34 35 2 chunks +29 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_service.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 27 28 29 30 31 32 33 34 35 6 chunks +90 lines, -21 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_service_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 27 28 29 30 31 32 33 34 35 36 4 chunks +64 lines, -11 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_with_cache_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 27 28 29 30 31 32 33 34 35 5 chunks +22 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/declarative/test_rules_registry.h 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 27 28 29 30 31 32 33 34 35 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative/test_rules_registry.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 27 28 29 30 31 32 33 34 35 1 chunk +8 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/declarative_content/content_rules_registry.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 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h 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 27 28 29 30 31 32 33 34 35 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.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 27 28 29 30 31 32 33 34 35 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_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 27 28 29 30 31 32 33 34 35 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_api.h 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 27 28 29 30 31 32 33 34 35 3 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/extensions/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 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 4 chunks +34 lines, -6 lines 0 comments Download
M chrome/common/extensions/api/_api_features.json 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 27 28 29 30 31 32 33 34 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/events.json 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 27 28 29 30 31 32 33 34 35 3 chunks +18 lines, -0 lines 0 comments Download
A chrome/common/extensions/api/webview_request.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/common/extensions_api_resources.grd View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/extensions/dispatcher.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 27 28 29 30 31 32 33 34 35 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/renderer/resources/extensions/event.js 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 27 28 29 30 31 32 33 34 35 4 chunks +16 lines, -7 lines 0 comments Download
M chrome/renderer/resources/extensions/web_request_internal_custom_bindings.js View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/renderer/resources/extensions/web_view.js 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 27 28 29 30 5 chunks +17 lines, -6 lines 0 comments Download
M chrome/renderer/resources/extensions/web_view_experimental.js 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 27 28 29 30 31 32 1 chunk +3 lines, -3 lines 0 comments Download
A chrome/renderer/resources/extensions/webview_request_custom_bindings.js 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 27 28 29 30 1 chunk +55 lines, -0 lines 0 comments Download
M chrome/renderer/resources/renderer_resources.grd 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 27 28 29 30 31 32 33 34 35 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +43 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/shim/main.js 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 27 28 29 30 31 32 33 34 4 chunks +56 lines, -5 lines 0 comments Download
M extensions/common/extension_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
Fady Samuel
This CL is still a work-in-progress. Things seem to work fine now though. Extensions and ...
7 years, 2 months ago (2013-10-23 14:48:58 UTC) #1
Fady Samuel
On 2013/10/23 14:48:58, Fady Samuel wrote: > This CL is still a work-in-progress. Things seem ...
7 years, 2 months ago (2013-10-23 14:53:22 UTC) #2
Fady Samuel
Note: This CL is also potentially a prerequisite for other declarative <webview> APIs such as ...
7 years, 2 months ago (2013-10-23 15:03:16 UTC) #3
Fady Samuel
7 years, 1 month ago (2013-10-25 16:48:43 UTC) #4
Fady Samuel
I feel that this CL is now officially ready for review. I've done quite a ...
7 years, 1 month ago (2013-10-25 16:51:35 UTC) #5
vabr (Chromium)
Hi Fady, I took a look at the parts touching (Declarative) Web Request (DWR in ...
7 years, 1 month ago (2013-10-25 20:40:23 UTC) #6
Fady Samuel
Addressed most comments except two. I'm looking into those now. vabr@, if I don't have ...
7 years, 1 month ago (2013-10-25 22:48:08 UTC) #7
vabr (Chromium)
Thanks, Fady. Responses to the easier comments now, and back to the GTalk window with ...
7 years, 1 month ago (2013-10-28 14:46:08 UTC) #8
Fady Samuel
PTAL vabr@ This is diffed against a decoupled RulesCacheDelegate! w00t!
7 years, 1 month ago (2013-11-01 23:23:41 UTC) #9
vabr (Chromium)
DWR part LGTM with comments. Thanks Fady, for your great efforts with this change! Vaclav ...
7 years, 1 month ago (2013-11-04 11:12:12 UTC) #10
Fady Samuel
+lazyboy@: Please take a look at the webview parts of this change. We can chat ...
7 years, 1 month ago (2013-11-04 20:13:52 UTC) #11
lazyboy
Looked at the web_view related files, some comments. https://codereview.chromium.org/28273006/diff/1270002/chrome/renderer/resources/extensions/web_view_experimental.js File chrome/renderer/resources/extensions/web_view_experimental.js (right): https://codereview.chromium.org/28273006/diff/1270002/chrome/renderer/resources/extensions/web_view_experimental.js#newcode36 chrome/renderer/resources/extensions/web_view_experimental.js:36: WebViewInternal.prototype.maybeAttachWebRequestEventToWebview_ ...
7 years, 1 month ago (2013-11-04 23:16:01 UTC) #12
Fady Samuel
PTAL Istiaque. https://codereview.chromium.org/28273006/diff/1270002/chrome/renderer/resources/extensions/web_view_experimental.js File chrome/renderer/resources/extensions/web_view_experimental.js (right): https://codereview.chromium.org/28273006/diff/1270002/chrome/renderer/resources/extensions/web_view_experimental.js#newcode36 chrome/renderer/resources/extensions/web_view_experimental.js:36: WebViewInternal.prototype.maybeAttachWebRequestEventToWebview_ = On 2013/11/04 23:16:01, lazyboy wrote: ...
7 years, 1 month ago (2013-11-05 19:53:00 UTC) #13
lazyboy
web_view API related part + webview tests LGTM https://chromiumcodereview.appspot.com/28273006/diff/1450001/chrome/browser/extensions/api/web_request/web_request_api.h File chrome/browser/extensions/api/web_request/web_request_api.h (right): https://chromiumcodereview.appspot.com/28273006/diff/1450001/chrome/browser/extensions/api/web_request/web_request_api.h#newcode479 chrome/browser/extensions/api/web_request/web_request_api.h:479: // ...
7 years, 1 month ago (2013-11-05 20:43:50 UTC) #14
Fady Samuel
Attempting CQ. I'm not sure if the failing bots are the fault of this CL ...
7 years, 1 month ago (2013-11-06 14:54:14 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/28273006/1610001
7 years, 1 month ago (2013-11-06 14:54:32 UTC) #16
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=34756
7 years, 1 month ago (2013-11-06 15:12:59 UTC) #17
Fady Samuel
7 years, 1 month ago (2013-11-06 15:14:02 UTC) #18
Jeffrey Yasskin
https://codereview.chromium.org/28273006/diff/1940001/chrome/browser/extensions/api/declarative/declarative_api.cc File chrome/browser/extensions/api/declarative/declarative_api.cc (right): https://codereview.chromium.org/28273006/diff/1940001/chrome/browser/extensions/api/declarative/declarative_api.cc#newcode29 chrome/browser/extensions/api/declarative/declarative_api.cc:29: using extensions::RulesRegistryService; Since the main body of this file ...
7 years, 1 month ago (2013-11-09 02:47:21 UTC) #19
Fady Samuel
Wow, that's great feedback Jeffrey! Thanks! https://codereview.chromium.org/28273006/diff/1940001/chrome/browser/extensions/api/declarative/declarative_api.cc File chrome/browser/extensions/api/declarative/declarative_api.cc (right): https://codereview.chromium.org/28273006/diff/1940001/chrome/browser/extensions/api/declarative/declarative_api.cc#newcode29 chrome/browser/extensions/api/declarative/declarative_api.cc:29: using extensions::RulesRegistryService; On ...
7 years, 1 month ago (2013-11-10 03:39:55 UTC) #20
Jeffrey Yasskin
lgtm with some nits and small changes. No need to wait for a re-review after ...
7 years, 1 month ago (2013-11-11 05:37:35 UTC) #21
Fady Samuel
Addressed nits. CQ'ing now. https://codereview.chromium.org/28273006/diff/2130001/chrome/browser/extensions/api/declarative/declarative_api.cc File chrome/browser/extensions/api/declarative/declarative_api.cc (right): https://codereview.chromium.org/28273006/diff/2130001/chrome/browser/extensions/api/declarative/declarative_api.cc#newcode40 chrome/browser/extensions/api/declarative/declarative_api.cc:40: return event_name.compare(0, strlen(kWebView), kWebView) == ...
7 years, 1 month ago (2013-11-11 19:52:32 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/28273006/2730001
7 years, 1 month ago (2013-11-11 21:35:06 UTC) #23
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=35543
7 years, 1 month ago (2013-11-11 22:04:18 UTC) #24
Fady Samuel
+jam@ for OWNER approval of trivial *.grd changes.
7 years, 1 month ago (2013-11-11 22:07:06 UTC) #25
Fady Samuel
-jam@ as he's backed up. +jhawkins@ for chrome OWNER approval. It looks like I'm blocked ...
7 years, 1 month ago (2013-11-11 22:42:38 UTC) #26
James Hawkins
LGTM
7 years, 1 month ago (2013-11-11 23:48:07 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/28273006/2730001
7 years, 1 month ago (2013-11-11 23:53:45 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/28273006/2730001
7 years, 1 month ago (2013-11-12 23:27:40 UTC) #29
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 1 month ago (2013-11-13 01:40:24 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/28273006/2730001
7 years, 1 month ago (2013-11-13 01:49:18 UTC) #31
commit-bot: I haz the power
7 years, 1 month ago (2013-11-13 03:28:27 UTC) #32
Message was sent while issue was closed.
Change committed as 234724

Powered by Google App Engine
This is Rietveld 408576698