OLD | NEW |
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 <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2262 mojo::InterfaceRequest<mojom::URLLoader> mojo_request, | 2262 mojo::InterfaceRequest<mojom::URLLoader> mojo_request, |
2263 mojom::URLLoaderClientPtr url_loader_client, | 2263 mojom::URLLoaderClientPtr url_loader_client, |
2264 ResourceMessageFilter* filter) { | 2264 ResourceMessageFilter* filter) { |
2265 filter_ = filter; | 2265 filter_ = filter; |
2266 OnRequestResourceInternal(routing_id, request_id, request, | 2266 OnRequestResourceInternal(routing_id, request_id, request, |
2267 std::move(mojo_request), | 2267 std::move(mojo_request), |
2268 std::move(url_loader_client)); | 2268 std::move(url_loader_client)); |
2269 filter_ = nullptr; | 2269 filter_ = nullptr; |
2270 } | 2270 } |
2271 | 2271 |
| 2272 void ResourceDispatcherHostImpl::OnSyncLoadWithMojo( |
| 2273 int routing_id, |
| 2274 int request_id, |
| 2275 const ResourceRequest& request_data, |
| 2276 ResourceMessageFilter* filter, |
| 2277 const SyncLoadResultCallback& result_handler) { |
| 2278 filter_ = filter; |
| 2279 BeginRequest(request_id, request_data, result_handler, routing_id, |
| 2280 nullptr, nullptr); |
| 2281 filter_ = nullptr; |
| 2282 } |
| 2283 |
2272 // static | 2284 // static |
2273 int ResourceDispatcherHostImpl::CalculateApproximateMemoryCost( | 2285 int ResourceDispatcherHostImpl::CalculateApproximateMemoryCost( |
2274 net::URLRequest* request) { | 2286 net::URLRequest* request) { |
2275 // The following fields should be a minor size contribution (experimentally | 2287 // The following fields should be a minor size contribution (experimentally |
2276 // on the order of 100). However since they are variable length, it could | 2288 // on the order of 100). However since they are variable length, it could |
2277 // in theory be a sizeable contribution. | 2289 // in theory be a sizeable contribution. |
2278 int strings_cost = request->extra_request_headers().ToString().size() + | 2290 int strings_cost = request->extra_request_headers().ToString().size() + |
2279 request->original_url().spec().size() + | 2291 request->original_url().spec().size() + |
2280 request->referrer().size() + | 2292 request->referrer().size() + |
2281 request->method().size(); | 2293 request->method().size(); |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2733 &throttles); | 2745 &throttles); |
2734 if (!throttles.empty()) { | 2746 if (!throttles.empty()) { |
2735 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2747 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
2736 std::move(throttles))); | 2748 std::move(throttles))); |
2737 } | 2749 } |
2738 } | 2750 } |
2739 return handler; | 2751 return handler; |
2740 } | 2752 } |
2741 | 2753 |
2742 } // namespace content | 2754 } // namespace content |
OLD | NEW |