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

Issue 10310124: Implement a ResourceThrottle for URL overriding in Chrome on Android. (Closed)

Created:
8 years, 7 months ago by mkosiba (inactive)
Modified:
8 years, 6 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, jam, darin-cc_chromium.org, brettw-cc_chromium.org, groby-ooo-7-16
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Implement a ResourceThrottle for URL overriding in Chrome on Android. This gives the embedder the opportunity to cancel top level navigations. This is required in Chrome on Android if we want to handle a url (such as m.youtube.com) in an external application. BUG=130006 TEST=unit_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=143167

Patch Set 1 #

Total comments: 26

Patch Set 2 : incorporated feedback #

Total comments: 1

Patch Set 3 : added unit tests #

Total comments: 4

Patch Set 4 : rebase + incorporated feedback #

Patch Set 5 : fix layering problem with unittest #

Total comments: 14

Patch Set 6 : incorporated feedback #

Total comments: 1

Patch Set 7 : removed changes related to cancelling with the HANDLED_EXTERNALLY status code #

Total comments: 4

Patch Set 8 : removed code from web_contents_impl #

Total comments: 4

Patch Set 9 : removed ChildProcessSecurityPolicy from FilterURL #

Patch Set 10 : moved the InterceptNavigationResourceThrottle to src/content #

Patch Set 11 : added missing header file #

Patch Set 12 : fixed chromeos build issue + rebase #

Total comments: 10

Patch Set 13 : moved back to src/chrome, not using WebContentsDelegate #

Total comments: 14

Patch Set 14 : incorporated feedback + rebase #

Total comments: 6

Patch Set 15 : fixed nits + rebase #

Patch Set 16 : fix build (Referrer is a struct, not a class) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+522 lines, -21 lines) Patch
M chrome/browser/chromeos/gview_request_interceptor_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_protocols_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
A chrome/browser/renderer_host/intercept_navigation_resource_throttle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +56 lines, -0 lines 0 comments Download
A chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +127 lines, -0 lines 0 comments Download
A chrome/browser/renderer_host/intercept_navigation_resource_throttle_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +287 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/download_resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/renderer_host/resource_request_info_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/resource_request_info_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -3 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -6 lines 0 comments Download
M content/public/browser/render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +8 lines, -0 lines 0 comments Download
M content/public/browser/resource_request_info.h View 1 2 3 4 5 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 42 (0 generated)
mkosiba (inactive)
8 years, 7 months ago (2012-05-11 14:45:14 UTC) #1
joth
https://chromiumcodereview.appspot.com/10310124/diff/1/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://chromiumcodereview.appspot.com/10310124/diff/1/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode175 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:175: throttles->push_back(new ShouldIgnoreNavigationResourceThrottle(request)); this looks like a good point to ...
8 years, 7 months ago (2012-05-11 15:34:13 UTC) #2
mkosiba (inactive)
http://codereview.chromium.org/10310124/diff/1/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): http://codereview.chromium.org/10310124/diff/1/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode175 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:175: throttles->push_back(new ShouldIgnoreNavigationResourceThrottle(request)); On 2012/05/11 15:34:13, joth wrote: > this ...
8 years, 7 months ago (2012-05-15 14:20:23 UTC) #3
joth
This LG from my side. I suggest OWNERS review for the content/public changes next, then ...
8 years, 7 months ago (2012-05-15 14:30:43 UTC) #4
mkosiba (inactive)
Hi Charlie, I'm adding you to the review since this is a ResourceThrottle-based reimplementation of ...
8 years, 7 months ago (2012-05-16 15:46:34 UTC) #5
Charlie Reis
This looks like a much better approach. Rubber stamp LGTM with the nits below, but ...
8 years, 7 months ago (2012-05-17 22:18:56 UTC) #6
mkosiba (inactive)
http://codereview.chromium.org/10310124/diff/13002/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): http://codereview.chromium.org/10310124/diff/13002/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode191 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:191: throttles->push_back(new ShouldIgnoreNavigationResourceThrottle(request)); On 2012/05/17 22:18:57, creis wrote: > nit: ...
8 years, 7 months ago (2012-05-18 12:33:01 UTC) #7
Matt Perry
I don't know much about ResourceThrottles, actually. BTW, waiting for the UI thread does add ...
8 years, 7 months ago (2012-05-18 20:38:08 UTC) #8
mkosiba (inactive)
On 2012/05/18 20:38:08, Matt Perry wrote: > I don't know much about ResourceThrottles, actually. > ...
8 years, 7 months ago (2012-05-21 10:19:02 UTC) #9
mkosiba (inactive)
Hi Darin, Please take a look. Thanks! Martin
8 years, 7 months ago (2012-05-23 09:38:14 UTC) #10
darin (slow to review)
This sounds like something that should piggyback on WebIntents, which also wants to enable "external ...
8 years, 7 months ago (2012-05-23 18:03:49 UTC) #11
darin (slow to review)
This sounds like something that should piggyback on WebIntents, which also wants to enable "external ...
8 years, 7 months ago (2012-05-23 18:03:58 UTC) #12
darin (slow to review)
https://chromiumcodereview.appspot.com/10310124/diff/4003/chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc File chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc (right): https://chromiumcodereview.appspot.com/10310124/diff/4003/chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc#newcode24 chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc:24: void CheckShouldIgnoreNavigationOnUiThread( nit: UiThread -> UIThread https://chromiumcodereview.appspot.com/10310124/diff/4003/chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc#newcode63 chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc:63: *defer ...
8 years, 7 months ago (2012-05-23 18:18:28 UTC) #13
mkosiba (inactive)
https://chromiumcodereview.appspot.com/10310124/diff/4003/chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc File chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc (right): https://chromiumcodereview.appspot.com/10310124/diff/4003/chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc#newcode24 chrome/browser/renderer_host/ignore_navigation_resource_throttle.cc:24: void CheckShouldIgnoreNavigationOnUiThread( On 2012/05/23 18:18:29, darin wrote: > nit: ...
8 years, 6 months ago (2012-05-28 16:06:52 UTC) #14
mkosiba (inactive)
Updated version is uploaded, please take a look.
8 years, 6 months ago (2012-05-29 09:14:07 UTC) #15
darin (slow to review)
On 2012/05/29 09:14:07, Martin Kosiba wrote: > Updated version is uploaded, please take a look. ...
8 years, 6 months ago (2012-05-29 20:54:43 UTC) #16
mkosiba (inactive)
On 2012/05/29 20:54:43, darin wrote: > On 2012/05/29 09:14:07, Martin Kosiba wrote: > > Updated ...
8 years, 6 months ago (2012-05-29 22:03:51 UTC) #17
Greg Billock
If we had an existing mechanism for mapping web intents to Android intents, including navigational ...
8 years, 6 months ago (2012-05-29 22:10:45 UTC) #18
James Hawkins
I had a chat with Greg off-line about this, and we're in agreement with each ...
8 years, 6 months ago (2012-05-29 23:07:08 UTC) #19
James Hawkins
The parenthetical should read: and I think with Darin as well, if I'm not reading ...
8 years, 6 months ago (2012-05-29 23:08:01 UTC) #20
darin (slow to review)
Right. If this current CL is the correct stepping stone toward that longer term plan, ...
8 years, 6 months ago (2012-05-29 23:19:57 UTC) #21
darin (slow to review)
https://chromiumcodereview.appspot.com/10310124/diff/25002/net/url_request/url_request.h File net/url_request/url_request.h (right): https://chromiumcodereview.appspot.com/10310124/diff/25002/net/url_request/url_request.h#newcode541 net/url_request/url_request.h:541: void CancelWithHandledExternallyStatus(); It looks like this may actually be ...
8 years, 6 months ago (2012-05-29 23:39:32 UTC) #22
mkosiba (inactive)
On 2012/05/29 23:39:32, darin wrote: > https://chromiumcodereview.appspot.com/10310124/diff/25002/net/url_request/url_request.h > File net/url_request/url_request.h (right): > > https://chromiumcodereview.appspot.com/10310124/diff/25002/net/url_request/url_request.h#newcode541 > ...
8 years, 6 months ago (2012-05-30 14:03:11 UTC) #23
darin (slow to review)
https://chromiumcodereview.appspot.com/10310124/diff/33001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://chromiumcodereview.appspot.com/10310124/diff/33001/content/browser/web_contents/web_contents_impl.cc#newcode2734 content/browser/web_contents/web_contents_impl.cc:2734: bool WebContentsImpl::ShouldIgnoreNavigation( I'm trying to understand why the embedder ...
8 years, 6 months ago (2012-05-31 21:13:39 UTC) #24
mkosiba (inactive)
Uploaded new version. https://chromiumcodereview.appspot.com/10310124/diff/33001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://chromiumcodereview.appspot.com/10310124/diff/33001/content/browser/web_contents/web_contents_impl.cc#newcode2734 content/browser/web_contents/web_contents_impl.cc:2734: bool WebContentsImpl::ShouldIgnoreNavigation( On 2012/05/31 21:13:39, darin ...
8 years, 6 months ago (2012-06-01 20:35:11 UTC) #25
darin (slow to review)
https://chromiumcodereview.appspot.com/10310124/diff/35001/content/public/browser/render_view_host.h File content/public/browser/render_view_host.h (right): https://chromiumcodereview.appspot.com/10310124/diff/35001/content/public/browser/render_view_host.h#newcode67 content/public/browser/render_view_host.h:67: static void FilterURL(ChildProcessSecurityPolicy* policy, it seems like you shouldn't ...
8 years, 6 months ago (2012-06-01 20:57:41 UTC) #26
Greg Billock
On 2012/06/01 20:57:41, darin wrote: > https://chromiumcodereview.appspot.com/10310124/diff/35001/content/public/browser/render_view_host.h > File content/public/browser/render_view_host.h (right): > > https://chromiumcodereview.appspot.com/10310124/diff/35001/content/public/browser/render_view_host.h#newcode67 > ...
8 years, 6 months ago (2012-06-04 17:20:14 UTC) #27
mkosiba (inactive)
New version ready for review. The big difference is that the throttle is now under ...
8 years, 6 months ago (2012-06-06 16:11:19 UTC) #28
mkosiba (inactive)
8 years, 6 months ago (2012-06-08 14:47:52 UTC) #29
joth
LGTM It looks like the overall structure is now in line with the discussion. Who ...
8 years, 6 months ago (2012-06-13 22:32:49 UTC) #30
darin (slow to review)
On 2012/06/06 16:11:19, Martin Kosiba wrote: > New version ready for review. The big difference ...
8 years, 6 months ago (2012-06-13 23:26:44 UTC) #31
mkosiba (inactive)
On 2012/06/13 23:26:44, darin wrote: > On 2012/06/06 16:11:19, Martin Kosiba wrote: > > New ...
8 years, 6 months ago (2012-06-15 11:05:09 UTC) #32
mkosiba (inactive)
new version ready http://codereview.chromium.org/10310124/diff/57003/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): http://codereview.chromium.org/10310124/diff/57003/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode46 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:46: // TODO(oshima): Enable this for other ...
8 years, 6 months ago (2012-06-15 11:05:36 UTC) #33
darin (slow to review)
http://codereview.chromium.org/10310124/diff/59001/chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc File chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc (right): http://codereview.chromium.org/10310124/diff/59001/chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc#newcode28 chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc:28: void CheckShouldIgnoreNavigationOnUIThread( nit: CheckIfShouldIgnoreNavigationOnUIThread http://codereview.chromium.org/10310124/diff/59001/chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc#newcode52 chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc:52: web_contents, validated_url, referrer, ...
8 years, 6 months ago (2012-06-15 19:52:55 UTC) #34
mkosiba (inactive)
Hi Darin, Thanks for the feedback! New version ready for review. Cheers! http://codereview.chromium.org/10310124/diff/59001/chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc File chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc ...
8 years, 6 months ago (2012-06-18 10:47:06 UTC) #35
darin (slow to review)
On 2012/06/18 10:47:06, Martin Kosiba wrote: ... > chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc:68: > weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { > On 2012/06/15 ...
8 years, 6 months ago (2012-06-19 17:28:08 UTC) #36
darin (slow to review)
LGTM http://codereview.chromium.org/10310124/diff/65002/chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc File chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc (right): http://codereview.chromium.org/10310124/diff/65002/chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc#newcode90 chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc:90: if (!info->GetAssociatedRenderView(&render_process_id, &render_view_id)) { nit: be consistent about ...
8 years, 6 months ago (2012-06-19 17:33:02 UTC) #37
mkosiba (inactive)
Nits fixed. Thanks for the review everyone! http://codereview.chromium.org/10310124/diff/65002/chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc File chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc (right): http://codereview.chromium.org/10310124/diff/65002/chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc#newcode90 chrome/browser/renderer_host/intercept_navigation_resource_throttle.cc:90: if (!info->GetAssociatedRenderView(&render_process_id, ...
8 years, 6 months ago (2012-06-20 10:16:08 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkosiba@chromium.org/10310124/56007
8 years, 6 months ago (2012-06-20 10:16:37 UTC) #39
commit-bot: I haz the power
Try job failure for 10310124-56007 (retry) on mac_rel for step "compile" (clobber build). It's a ...
8 years, 6 months ago (2012-06-20 10:42:52 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkosiba@chromium.org/10310124/70008
8 years, 6 months ago (2012-06-20 10:54:18 UTC) #41
commit-bot: I haz the power
8 years, 6 months ago (2012-06-20 14:03:56 UTC) #42
Change committed as 143167

Powered by Google App Engine
This is Rietveld 408576698