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

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

Issue 667483002: Account for NULL headers in streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test Created 6 years, 2 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
« no previous file with comments | « chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 origin)); 738 origin));
739 739
740 info->set_is_stream(true); 740 info->set_is_stream(true);
741 scoped_ptr<StreamInfo> stream_info(new StreamInfo); 741 scoped_ptr<StreamInfo> stream_info(new StreamInfo);
742 stream_info->handle = handler->stream()->CreateHandle(); 742 stream_info->handle = handler->stream()->CreateHandle();
743 stream_info->original_url = request->url(); 743 stream_info->original_url = request->url();
744 stream_info->mime_type = mime_type; 744 stream_info->mime_type = mime_type;
745 // Make a copy of the response headers so it is safe to pass across threads; 745 // Make a copy of the response headers so it is safe to pass across threads;
746 // the old handler (AsyncResourceHandler) may modify it in parallel via the 746 // the old handler (AsyncResourceHandler) may modify it in parallel via the
747 // ResourceDispatcherHostDelegate. 747 // ResourceDispatcherHostDelegate.
748 stream_info->response_headers = 748 if (response->head.headers.get()) {
749 new net::HttpResponseHeaders(response->head.headers->raw_headers()); 749 stream_info->response_headers =
750 new net::HttpResponseHeaders(response->head.headers->raw_headers());
751 }
750 delegate_->OnStreamCreated(request, stream_info.Pass()); 752 delegate_->OnStreamCreated(request, stream_info.Pass());
751 return handler.PassAs<ResourceHandler>(); 753 return handler.PassAs<ResourceHandler>();
752 } 754 }
753 755
754 ResourceDispatcherHostLoginDelegate* 756 ResourceDispatcherHostLoginDelegate*
755 ResourceDispatcherHostImpl::CreateLoginDelegate( 757 ResourceDispatcherHostImpl::CreateLoginDelegate(
756 ResourceLoader* loader, 758 ResourceLoader* loader,
757 net::AuthChallengeInfo* auth_info) { 759 net::AuthChallengeInfo* auth_info) {
758 if (!delegate_) 760 if (!delegate_)
759 return NULL; 761 return NULL;
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 2158
2157 // Add a flag to selectively bypass the data reduction proxy if the resource 2159 // Add a flag to selectively bypass the data reduction proxy if the resource
2158 // type is not an image. 2160 // type is not an image.
2159 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) 2161 if (request_data.resource_type != RESOURCE_TYPE_IMAGE)
2160 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; 2162 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
2161 2163
2162 return load_flags; 2164 return load_flags;
2163 } 2165 }
2164 2166
2165 } // namespace content 2167 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698