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

Issue 647853002: Create a proprietary scheme for loading web-accessible resources. (Closed)

Created:
6 years, 2 months ago by jbroman
Modified:
4 years, 5 months ago
CC:
chromium-reviews, mkwst+moarreviews-renderer_chromium.org, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Create a proprietary scheme for loading web-accessible resources. This adds a chrome-resource:// scheme which is web-accessible and exempt from CSP, like chrome-extension:// web-accessible resources. This is intended to be used to expose image and style resources from Blink to web content, permitting new features to use a similar loading process to author content. No resources are currently exposed; they will be added in subsequent CLs. TEST=content_unittests:ResourceProtocolHandlerTest.* BUG=414849

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : rebase #

Patch Set 4 : add android_webview support #

Patch Set 5 : clang-format #

Patch Set 6 : refactor for testing; add unit test #

Patch Set 7 : cleanup for review #

Patch Set 8 : security warnings #

Patch Set 9 : brace for two-line if statement (why didn't clang-format change this?) #

Total comments: 2

Patch Set 10 : msvc fix #

Total comments: 12

Patch Set 11 : rebase #

Patch Set 12 : tsepez nits, clang-format again #

Total comments: 3

Patch Set 13 : use https://codereview.chromium.org/730203007/ to permit only images and CSS on resource protocol #

Total comments: 8

Patch Set 14 : davidben comments #

Patch Set 15 : mmenke comments #

Patch Set 16 : update include guards too #

Unified diffs Side-by-side diffs Delta from patch set Stats (+342 lines, -13 lines) Patch
M android_webview/browser/net/aw_url_request_context_getter.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -13 lines 0 comments Download
M chrome/browser/profiles/profile_io_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/child_process_security_policy_impl.cc View 1 chunk +1 line, -0 lines 0 comments Download
A content/browser/resource_protocol_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +70 lines, -0 lines 0 comments Download
A content/browser/resource_protocol_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +155 lines, -0 lines 0 comments Download
A content/browser/resource_protocol_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +83 lines, -0 lines 0 comments Download
M content/browser/storage_partition_impl_map.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -0 lines 0 comments Download
M content/common/url_schemes.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/content_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 content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/url_constants.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/url_constants.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (5 generated)
jbroman
Hey, here's the chrome-resource:// CL I mentioned. It's gained a little bit of complexity to ...
6 years, 1 month ago (2014-11-14 18:46:35 UTC) #2
Mike West
I won't be able to look at this in any detail until Monday. Adding Tom, ...
6 years, 1 month ago (2014-11-15 13:28:13 UTC) #4
Tom Sepez
https://codereview.chromium.org/647853002/diff/410001/content/browser/resource_protocol.cc File content/browser/resource_protocol.cc (right): https://codereview.chromium.org/647853002/diff/410001/content/browser/resource_protocol.cc#newcode32 content/browser/resource_protocol.cc:32: static const char kBlinkHostname[] = "blink"; nit: static redundant ...
6 years, 1 month ago (2014-11-17 18:09:11 UTC) #5
jbroman
https://codereview.chromium.org/647853002/diff/410001/content/browser/resource_protocol.cc File content/browser/resource_protocol.cc (right): https://codereview.chromium.org/647853002/diff/410001/content/browser/resource_protocol.cc#newcode32 content/browser/resource_protocol.cc:32: static const char kBlinkHostname[] = "blink"; On 2014/11/17 18:09:11, ...
6 years, 1 month ago (2014-11-17 18:35:17 UTC) #6
Tom Sepez
> Is that clear and reasonable, or have I missed your point? Yes, its clear. ...
6 years, 1 month ago (2014-11-17 19:26:15 UTC) #7
Tom Sepez
Perhaps the underlying issue is that schemeShouldBypassContentSecurityPolicy() is too big a hammer. If it were ...
6 years, 1 month ago (2014-11-17 19:43:01 UTC) #8
Mike West
On 2014/11/17 19:43:01, Tom Sepez wrote: > Perhaps the underlying issue is that schemeShouldBypassContentSecurityPolicy() > ...
6 years, 1 month ago (2014-11-17 19:55:37 UTC) #9
Mike West
On 2014/11/17 19:26:15, Tom Sepez wrote: > So if the author isn't aware, how does ...
6 years, 1 month ago (2014-11-17 19:56:10 UTC) #10
Tom Sepez
jbroman - if you file a follow-on bug for a more granular bypass, then I'll ...
6 years, 1 month ago (2014-11-17 19:58:39 UTC) #11
jbroman
On 2014/11/17 19:56:10, Mike West wrote: > On 2014/11/17 19:26:15, Tom Sepez wrote: > > ...
6 years, 1 month ago (2014-11-17 20:15:23 UTC) #12
Mike West
Conceptually, this LGTM from the Blink side. I'm not sure about the name (it feels ...
6 years, 1 month ago (2014-11-18 20:38:51 UTC) #13
Tom Sepez
https://codereview.chromium.org/647853002/diff/450001/content/renderer/render_thread_impl.cc File content/renderer/render_thread_impl.cc (right): https://codereview.chromium.org/647853002/diff/450001/content/renderer/render_thread_impl.cc#newcode994 content/renderer/render_thread_impl.cc:994: resource_scheme); I thought I'd see one of your newfangled ...
6 years, 1 month ago (2014-11-18 20:47:17 UTC) #14
jbroman
https://codereview.chromium.org/647853002/diff/450001/content/public/common/url_constants.h File content/public/common/url_constants.h (right): https://codereview.chromium.org/647853002/diff/450001/content/public/common/url_constants.h#newcode22 content/public/common/url_constants.h:22: CONTENT_EXPORT extern const char kResourceScheme[]; On 2014/11/18 20:38:51, Mike ...
6 years, 1 month ago (2014-11-18 20:47:18 UTC) #15
Tom Sepez
> Some random alternatives (though the "chrome-" prefix is nice insofar as its > clear ...
6 years, 1 month ago (2014-11-18 20:49:12 UTC) #16
jbroman
On 2014/11/18 20:47:17, Tom Sepez wrote: > https://codereview.chromium.org/647853002/diff/450001/content/renderer/render_thread_impl.cc > File content/renderer/render_thread_impl.cc (right): > > https://codereview.chromium.org/647853002/diff/450001/content/renderer/render_thread_impl.cc#newcode994 ...
6 years, 1 month ago (2014-11-18 20:49:54 UTC) #17
jbroman
On 2014/11/18 20:49:54, jbroman wrote: > On 2014/11/18 20:47:17, Tom Sepez wrote: > > > ...
6 years, 1 month ago (2014-11-18 20:59:54 UTC) #18
Tom Sepez
lgtm
6 years, 1 month ago (2014-11-18 21:03:34 UTC) #19
jbroman
+davidben for content/ review This has been reviewed by mkwst/tsepez for CSP/security concerns, and is ...
6 years, 1 month ago (2014-11-18 21:16:00 UTC) #21
davidben
+mmenke in case he has opinions on how things bridging resource_ids into URLRequestJobs should work. ...
6 years, 1 month ago (2014-11-19 00:21:21 UTC) #23
jbroman
https://codereview.chromium.org/647853002/diff/470001/content/browser/resource_protocol.cc File content/browser/resource_protocol.cc (right): https://codereview.chromium.org/647853002/diff/470001/content/browser/resource_protocol.cc#newcode104 content/browser/resource_protocol.cc:104: for (const auto& resource : kBlinkWebAccessibleResources) { On 2014/11/19 ...
6 years, 1 month ago (2014-11-19 15:06:54 UTC) #24
mmenke
I'll take a look, but I'm not familiar with the logic used for chrome URLs. ...
6 years, 1 month ago (2014-11-19 16:58:51 UTC) #25
jbroman
6 years, 1 month ago (2014-11-19 18:55:05 UTC) #26
On 2014/11/19 16:58:51, mmenke wrote:
> I'll take a look, but I'm not familiar with the logic used for chrome URLs.
> 
> One thing this CL needs to do, though:  Update
ProfileIOData::IsHandledProtocol
> to return true for the new protocol.  Unfortunately, it's currently not called
> just on the IO thread, so we can't call into the URLRequestJobFactory to see
> what protocol handlers it has hooked up, unfortunately.

Done.

> Also, the resource_protocol files should be called resource_protocol_handler.

Done.

Powered by Google App Engine
This is Rietveld 408576698