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

Unified Diff: content/browser/loader/buffered_resource_handler.cc

Issue 694773003: Allow URL requests for object/embed tags to be intercepted as streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-guest-view-container-3
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/loader/buffered_resource_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/buffered_resource_handler.cc
diff --git a/content/browser/loader/buffered_resource_handler.cc b/content/browser/loader/buffered_resource_handler.cc
index f96b5506d8c455f1526a89b3917d5e65bb3d82dd..f308b470529cf48586d02ecc52368d7ba21a46ae 100644
--- a/content/browser/loader/buffered_resource_handler.cc
+++ b/content/browser/loader/buffered_resource_handler.cc
@@ -312,6 +312,15 @@ bool BufferedResourceHandler::SelectNextHandler(bool* defer) {
return UseAlternateNextHandler(handler.Pass(), std::string());
}
+ // Allow requests for object/embed tags to be intercepted as streams.
+ if (info->GetResourceType() == content::RESOURCE_TYPE_OBJECT) {
Zachary Kuznia 2014/11/13 23:18:08 Why isn't this caught by line 333?
raymes 2014/11/13 23:42:10 Because in these cases |allow_download| is always
Zachary Kuznia 2014/11/13 23:48:42 It feels like we should share this call with the o
raymes 2014/11/14 20:55:29 I did try to share the code in a few different way
Zachary Kuznia 2014/11/14 22:01:45 Fair enough, I thought that might be the case.
+ DCHECK(!info->allow_download());
+ std::string payload;
+ scoped_ptr<ResourceHandler> handler(
+ host_->MaybeInterceptAsStream(request(), response_.get(), &payload));
+ return UseAlternateNextHandler(handler.Pass(), payload);
Zachary Kuznia 2014/11/13 23:18:08 Is there a reason not to test that handler is set?
raymes 2014/11/13 23:42:10 There is one other place where requests are made o
Zachary Kuznia 2014/11/13 23:48:42 In that case, shouldn't we maintain the current be
raymes 2014/11/14 20:55:29 Yes, good catch! I added a test for this.
+ }
+
if (!info->allow_download())
return true;
« no previous file with comments | « no previous file | content/browser/loader/buffered_resource_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698