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

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

Issue 263513004: Forward MIME types to BrowserPlugin when a viewer is specified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fixes Created 6 years, 8 months 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
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index c5e067d8cd77d2a30bf0a0d702cef1bd32cb1514..83a301e7f30ecaf49b1e8d030a9f7997a807dd46 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -605,7 +605,7 @@ ResourceDispatcherHostImpl::CreateResourceHandlerForDownload(
return handler.Pass();
}
-scoped_ptr<ResourceHandler>
+scoped_ptr<StreamResourceHandler>
ResourceDispatcherHostImpl::MaybeInterceptAsStream(net::URLRequest* request,
ResourceResponse* response) {
ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request);
@@ -613,13 +613,17 @@ ResourceDispatcherHostImpl::MaybeInterceptAsStream(net::URLRequest* request,
GURL origin;
std::string target_id;
+ std::string payload;
+ std::string view_id;
if (!delegate_ ||
!delegate_->ShouldInterceptResourceAsStream(info->GetContext(),
request->url(),
mime_type,
&origin,
- &target_id)) {
- return scoped_ptr<ResourceHandler>();
+ &target_id,
+ &payload,
+ &view_id)) {
+ return scoped_ptr<StreamResourceHandler>();
}
StreamContext* stream_context =
@@ -628,7 +632,8 @@ ResourceDispatcherHostImpl::MaybeInterceptAsStream(net::URLRequest* request,
scoped_ptr<StreamResourceHandler> handler(
new StreamResourceHandler(request,
stream_context->registry(),
- origin));
+ origin,
+ payload));
info->set_is_stream(true);
delegate_->OnStreamCreated(
@@ -636,12 +641,13 @@ ResourceDispatcherHostImpl::MaybeInterceptAsStream(net::URLRequest* request,
info->GetChildID(),
info->GetRouteID(),
target_id,
+ view_id,
handler->stream()->CreateHandle(
request->url(),
mime_type,
response->head.headers),
request->GetExpectedContentSize());
- return handler.PassAs<ResourceHandler>();
+ return handler.Pass();
}
void ResourceDispatcherHostImpl::ClearSSLClientAuthHandlerForRequest(

Powered by Google App Engine
This is Rietveld 408576698