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