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

Issue 1164073006: Make the logic for stream interception by MimeHandlerViews consistent with starting the plugin (Closed)

Created:
5 years, 6 months ago by raymes
Modified:
5 years, 5 months ago
Reviewers:
Sam McNally, Deepak, jam, mmenke
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, darin-cc_chromium.org, jam, extensions-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org, Deepak
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make the logic for stream interception by MimeHandlerViews consistent with starting the plugin Currently there is logic in the renderer which checks whether a plugin can handle a mime type and if it can the plugin is started. This is also how MimeHandlerView plugins are started in the renderer. MimeHandlerViews also rely on the original http request being intercepted as a stream which the plugin can read when it chooses. This happens in the browser. Currently the logic for determining whether the stream should be intercepted is different to the logic for determining whether to start the plugin which can lead to problems in some cases. This CL makes sure the logic is the same: on both sides we check whether the plugin can handle the mime type. MimeHandlerView plugins load a chrome extension inside a BrowserPlugin. Once it has been determined that the plugin can handle the mime type inside BufferedResourceHandler, the extension ID of the plugin is passed down through into ChromeResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream. It is then checked that the extension is enabled and if so the stream is intercepted. There is some complexity because we also need to support the legacy case where the stream is intercepted for the streamsPrivate api in which case there is no MimeHandlerView plugin. This CL was originally written by deepak.m1@samsung.com (Deepak Mittal) and landed here: https://codereview.chromium.org/953793003/. It was reverted because of a bug it triggered with not downloading PDFs when the PDF plugin was disabled. This bug has been addressed and a test added for that case. BUG=443466 Committed: https://crrev.com/9dcebac2889710b6e92b751d0434d06bf240dba4 Cr-Commit-Position: refs/heads/master@{#339816}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 10

Patch Set 4 : #

Total comments: 36

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 4

Patch Set 9 : #

Total comments: 32

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : #

Patch Set 14 : #

Total comments: 6

Patch Set 15 : #

Patch Set 16 : #

Total comments: 2

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+310 lines, -124 lines) Patch
M chrome/browser/pdf/pdf_extension_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +90 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +22 lines, -45 lines 0 comments Download
M content/browser/loader/mime_type_resource_handler.h View 1 2 3 4 5 6 7 8 9 2 chunks +9 lines, -1 line 0 comments Download
M content/browser/loader/mime_type_resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +53 lines, -45 lines 0 comments Download
M content/browser/loader/mime_type_resource_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 12 chunks +96 lines, -10 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +17 lines, -5 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -8 lines 0 comments Download
M content/public/browser/resource_dispatcher_host_delegate.h View 1 2 3 4 5 6 7 8 2 chunks +13 lines, -10 lines 0 comments Download
M content/public/browser/resource_dispatcher_host_delegate.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 40 (11 generated)
raymes
mmenke: PTAL :) Note that this is the same as the patch which Deepak landed ...
5 years, 6 months ago (2015-06-05 00:26:29 UTC) #2
Deepak
As far as I remember earlier @thakis was asking test case that should hit ChromeResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream() ...
5 years, 6 months ago (2015-06-05 03:04:00 UTC) #4
raymes
On 2015/06/05 03:04:00, Deepak wrote: > As far as I remember earlier @thakis was asking ...
5 years, 6 months ago (2015-06-05 03:08:50 UTC) #5
mmenke
I hate reviewing this code. It's not at all clear what it's doing, due to ...
5 years, 6 months ago (2015-06-05 18:45:50 UTC) #6
raymes
mmenke: I'm really sorry that it's painful code to review :( Please note that I ...
5 years, 6 months ago (2015-06-09 00:10:46 UTC) #7
raymes
ping
5 years, 6 months ago (2015-06-10 23:58:05 UTC) #8
mmenke
On 2015/06/09 00:10:46, raymes wrote: > mmenke: I'm really sorry that it's painful code to ...
5 years, 6 months ago (2015-06-11 16:19:19 UTC) #9
mmenke
Haven't looked at the unittest https://codereview.chromium.org/1164073006/diff/60001/chrome/browser/pdf/pdf_extension_test.cc File chrome/browser/pdf/pdf_extension_test.cc (right): https://codereview.chromium.org/1164073006/diff/60001/chrome/browser/pdf/pdf_extension_test.cc#newcode178 chrome/browser/pdf/pdf_extension_test.cc:178: url_ = GURL(); Is ...
5 years, 6 months ago (2015-06-11 19:38:04 UTC) #10
mmenke
Also, FYI: I have a CL out to rename BufferedResourceHandler to MimeTypeResourceHandler.
5 years, 6 months ago (2015-06-11 20:01:26 UTC) #11
mmenke
On 2015/06/11 20:01:26, mmenke wrote: > Also, FYI: I have a CL out to rename ...
5 years, 6 months ago (2015-06-15 16:40:02 UTC) #12
raymes
+sammc to take a look at chrome_resource_dispatcher_host_delegate.cc Thanks mmenke! This has also been low on ...
5 years, 5 months ago (2015-07-01 05:13:19 UTC) #14
Sam McNally
https://codereview.chromium.org/1164073006/diff/140001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/1164073006/diff/140001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode625 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:625: if (!plugin_path.empty()) { How about looking up the extension ...
5 years, 5 months ago (2015-07-03 06:21:31 UTC) #15
raymes
https://codereview.chromium.org/1164073006/diff/140001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/1164073006/diff/140001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode625 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:625: if (!plugin_path.empty()) { On 2015/07/03 06:21:31, Sam McNally wrote: ...
5 years, 5 months ago (2015-07-06 02:30:04 UTC) #16
Sam McNally
chrome_resource_dispatcher_host_delegate LGTM https://codereview.chromium.org/1164073006/diff/160001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/1164073006/diff/160001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode636 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:636: } else { else if
5 years, 5 months ago (2015-07-07 06:44:28 UTC) #17
mmenke
https://codereview.chromium.org/1164073006/diff/160001/chrome/browser/pdf/pdf_extension_test.cc File chrome/browser/pdf/pdf_extension_test.cc (right): https://codereview.chromium.org/1164073006/diff/160001/chrome/browser/pdf/pdf_extension_test.cc#newcode188 chrome/browser/pdf/pdf_extension_test.cc:188: GURL GetLastUrl() { nit: const GURL& last_url() const https://codereview.chromium.org/1164073006/diff/160001/chrome/browser/pdf/pdf_extension_test.cc#newcode189 ...
5 years, 5 months ago (2015-07-09 20:35:40 UTC) #18
raymes
https://codereview.chromium.org/1164073006/diff/160001/chrome/browser/pdf/pdf_extension_test.cc File chrome/browser/pdf/pdf_extension_test.cc (right): https://codereview.chromium.org/1164073006/diff/160001/chrome/browser/pdf/pdf_extension_test.cc#newcode188 chrome/browser/pdf/pdf_extension_test.cc:188: GURL GetLastUrl() { On 2015/07/09 20:35:39, mmenke wrote: > ...
5 years, 5 months ago (2015-07-17 03:21:01 UTC) #19
mmenke
Think this is my last set of comments. https://codereview.chromium.org/1164073006/diff/260001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/1164073006/diff/260001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode609 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:609: // ...
5 years, 5 months ago (2015-07-17 19:47:51 UTC) #20
raymes
Thanks! https://codereview.chromium.org/1164073006/diff/260001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/1164073006/diff/260001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode609 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:609: // streamsPrivate API. On 2015/07/17 19:47:51, mmenke wrote: ...
5 years, 5 months ago (2015-07-20 04:14:18 UTC) #21
mmenke
LGTM! https://codereview.chromium.org/1164073006/diff/300001/content/browser/loader/mime_type_resource_handler.cc File content/browser/loader/mime_type_resource_handler.cc (right): https://codereview.chromium.org/1164073006/diff/300001/content/browser/loader/mime_type_resource_handler.cc#newcode297 content/browser/loader/mime_type_resource_handler.cc:297: *handled_by_plugin = false; nit: +2 indent
5 years, 5 months ago (2015-07-20 15:20:48 UTC) #22
mmenke
And thanks for your patience on this one. :)
5 years, 5 months ago (2015-07-20 15:21:06 UTC) #23
raymes
Thanks for your patience and help too :) +jam for OWNERS chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h content/public/browser/resource_dispatcher_host_delegate.cc content/public/browser/resource_dispatcher_host_delegate.h ...
5 years, 5 months ago (2015-07-21 00:15:45 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1164073006/340001
5 years, 5 months ago (2015-07-21 00:17:17 UTC) #27
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 5 months ago (2015-07-21 01:13:02 UTC) #29
jam
lgtm
5 years, 5 months ago (2015-07-21 16:23:16 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1164073006/340001
5 years, 5 months ago (2015-07-22 00:47:25 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/76034) ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 5 months ago (2015-07-22 00:50:55 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1164073006/360001
5 years, 5 months ago (2015-07-22 01:02:13 UTC) #38
commit-bot: I haz the power
Committed patchset #19 (id:360001)
5 years, 5 months ago (2015-07-22 02:03:55 UTC) #39
commit-bot: I haz the power
5 years, 5 months ago (2015-07-22 02:04:43 UTC) #40
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/9dcebac2889710b6e92b751d0434d06bf240dba4
Cr-Commit-Position: refs/heads/master@{#339816}

Powered by Google App Engine
This is Rietveld 408576698