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

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

Issue 1481583002: Narrow the interface to ResourceMessageFilter::GetContexts() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify when |origin_pid| argument is used. Created 5 years 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 deferred_loader->CompleteTransfer(); 1209 deferred_loader->CompleteTransfer();
1210 } else { 1210 } else {
1211 bad_message::ReceivedBadMessage( 1211 bad_message::ReceivedBadMessage(
1212 filter_, bad_message::RDH_REQUEST_NOT_TRANSFERRING); 1212 filter_, bad_message::RDH_REQUEST_NOT_TRANSFERRING);
1213 } 1213 }
1214 return; 1214 return;
1215 } 1215 }
1216 1216
1217 ResourceContext* resource_context = NULL; 1217 ResourceContext* resource_context = NULL;
1218 net::URLRequestContext* request_context = NULL; 1218 net::URLRequestContext* request_context = NULL;
1219 filter_->GetContexts(request_data, &resource_context, &request_context); 1219 filter_->GetContexts(request_data.resource_type, request_data.origin_pid,
1220 &resource_context, &request_context);
1220 // http://crbug.com/90971 1221 // http://crbug.com/90971
1221 CHECK(ContainsKey(active_resource_contexts_, resource_context)); 1222 CHECK(ContainsKey(active_resource_contexts_, resource_context));
1222 1223
1223 // Parse the headers before calling ShouldServiceRequest, so that they are 1224 // Parse the headers before calling ShouldServiceRequest, so that they are
1224 // available to be validated. 1225 // available to be validated.
1225 net::HttpRequestHeaders headers; 1226 net::HttpRequestHeaders headers;
1226 headers.AddHeadersFromString(request_data.headers); 1227 headers.AddHeadersFromString(request_data.headers);
1227 1228
1228 if (is_shutdown_ || 1229 if (is_shutdown_ ||
1229 !ShouldServiceRequest(process_type, child_id, request_data, headers, 1230 !ShouldServiceRequest(process_type, child_id, request_data, headers,
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 load_flags |= net::LOAD_PREFETCH; 2440 load_flags |= net::LOAD_PREFETCH;
2440 } 2441 }
2441 2442
2442 if (is_sync_load) 2443 if (is_sync_load)
2443 load_flags |= net::LOAD_IGNORE_LIMITS; 2444 load_flags |= net::LOAD_IGNORE_LIMITS;
2444 2445
2445 return load_flags; 2446 return load_flags;
2446 } 2447 }
2447 2448
2448 } // namespace content 2449 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698