| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 DCHECK(http_header_interceptor_map_.find(http_header) == | 490 DCHECK(http_header_interceptor_map_.find(http_header) == |
| 491 http_header_interceptor_map_.end()); | 491 http_header_interceptor_map_.end()); |
| 492 | 492 |
| 493 HeaderInterceptorInfo interceptor_info; | 493 HeaderInterceptorInfo interceptor_info; |
| 494 interceptor_info.starts_with = starts_with; | 494 interceptor_info.starts_with = starts_with; |
| 495 interceptor_info.interceptor = interceptor; | 495 interceptor_info.interceptor = interceptor; |
| 496 | 496 |
| 497 http_header_interceptor_map_[http_header] = interceptor_info; | 497 http_header_interceptor_map_[http_header] = interceptor_info; |
| 498 } | 498 } |
| 499 | 499 |
| 500 void ResourceDispatcherHostImpl::ReprioritizeRequest( |
| 501 net::URLRequest* request, |
| 502 net::RequestPriority priority) { |
| 503 scheduler_->ReprioritizeRequest(request, priority); |
| 504 } |
| 505 |
| 500 void ResourceDispatcherHostImpl::Shutdown() { | 506 void ResourceDispatcherHostImpl::Shutdown() { |
| 501 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 507 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 502 io_thread_task_runner_->PostTask( | 508 io_thread_task_runner_->PostTask( |
| 503 FROM_HERE, base::Bind(&ResourceDispatcherHostImpl::OnShutdown, | 509 FROM_HERE, base::Bind(&ResourceDispatcherHostImpl::OnShutdown, |
| 504 base::Unretained(this))); | 510 base::Unretained(this))); |
| 505 } | 511 } |
| 506 | 512 |
| 507 std::unique_ptr<ResourceHandler> | 513 std::unique_ptr<ResourceHandler> |
| 508 ResourceDispatcherHostImpl::CreateResourceHandlerForDownload( | 514 ResourceDispatcherHostImpl::CreateResourceHandlerForDownload( |
| 509 net::URLRequest* request, | 515 net::URLRequest* request, |
| (...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2617 &throttles); | 2623 &throttles); |
| 2618 if (!throttles.empty()) { | 2624 if (!throttles.empty()) { |
| 2619 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2625 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
| 2620 std::move(throttles))); | 2626 std::move(throttles))); |
| 2621 } | 2627 } |
| 2622 } | 2628 } |
| 2623 return handler; | 2629 return handler; |
| 2624 } | 2630 } |
| 2625 | 2631 |
| 2626 } // namespace content | 2632 } // namespace content |
| OLD | NEW |