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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1164073006: Make the logic for stream interception by MimeHandlerViews consistent with starting the plugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 is_content_initiated, must_download, &throttles); 711 is_content_initiated, must_download, &throttles);
712 if (!throttles.empty()) { 712 if (!throttles.empty()) {
713 handler.reset( 713 handler.reset(
714 new ThrottlingResourceHandler( 714 new ThrottlingResourceHandler(
715 handler.Pass(), request, throttles.Pass())); 715 handler.Pass(), request, throttles.Pass()));
716 } 716 }
717 } 717 }
718 return handler.Pass(); 718 return handler.Pass();
719 } 719 }
720 720
721 scoped_ptr<ResourceHandler> 721 scoped_ptr<ResourceHandler> ResourceDispatcherHostImpl::MaybeInterceptAsStream(
722 ResourceDispatcherHostImpl::MaybeInterceptAsStream(net::URLRequest* request, 722 const base::FilePath& plugin_path,
723 ResourceResponse* response, 723 net::URLRequest* request,
724 std::string* payload) { 724 ResourceResponse* response,
725 std::string* payload) {
726 payload->clear();
725 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); 727 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request);
726 const std::string& mime_type = response->head.mime_type; 728 const std::string& mime_type = response->head.mime_type;
727 729
728 GURL origin; 730 GURL origin;
729 if (!delegate_ || 731 if (!delegate_ ||
730 !delegate_->ShouldInterceptResourceAsStream(request, 732 !delegate_->ShouldInterceptResourceAsStream(
731 mime_type, 733 request, plugin_path, mime_type, &origin, payload)) {
732 &origin,
733 payload)) {
734 return scoped_ptr<ResourceHandler>(); 734 return scoped_ptr<ResourceHandler>();
735 } 735 }
736 736
737 StreamContext* stream_context = 737 StreamContext* stream_context =
738 GetStreamContextForResourceContext(info->GetContext()); 738 GetStreamContextForResourceContext(info->GetContext());
739 739
740 scoped_ptr<StreamResourceHandler> handler( 740 scoped_ptr<StreamResourceHandler> handler(
741 new StreamResourceHandler(request, 741 new StreamResourceHandler(request,
742 stream_context->registry(), 742 stream_context->registry(),
743 origin)); 743 origin));
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
2352 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 2352 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
2353 && !policy->CanReadRawCookies(child_id)) { 2353 && !policy->CanReadRawCookies(child_id)) {
2354 VLOG(1) << "Denied unauthorized request for raw headers"; 2354 VLOG(1) << "Denied unauthorized request for raw headers";
2355 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 2355 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
2356 } 2356 }
2357 2357
2358 return load_flags; 2358 return load_flags;
2359 } 2359 }
2360 2360
2361 } // namespace content 2361 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | content/public/browser/resource_dispatcher_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698