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 | |
507 void ResourceDispatcherHostImpl::Shutdown() { | 501 void ResourceDispatcherHostImpl::Shutdown() { |
508 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 502 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
509 io_thread_task_runner_->PostTask( | 503 io_thread_task_runner_->PostTask( |
510 FROM_HERE, base::Bind(&ResourceDispatcherHostImpl::OnShutdown, | 504 FROM_HERE, base::Bind(&ResourceDispatcherHostImpl::OnShutdown, |
511 base::Unretained(this))); | 505 base::Unretained(this))); |
512 } | 506 } |
513 | 507 |
514 std::unique_ptr<ResourceHandler> | 508 std::unique_ptr<ResourceHandler> |
515 ResourceDispatcherHostImpl::CreateResourceHandlerForDownload( | 509 ResourceDispatcherHostImpl::CreateResourceHandlerForDownload( |
516 net::URLRequest* request, | 510 net::URLRequest* request, |
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2633 &throttles); | 2627 &throttles); |
2634 if (!throttles.empty()) { | 2628 if (!throttles.empty()) { |
2635 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2629 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
2636 std::move(throttles))); | 2630 std::move(throttles))); |
2637 } | 2631 } |
2638 } | 2632 } |
2639 return handler; | 2633 return handler; |
2640 } | 2634 } |
2641 | 2635 |
2642 } // namespace content | 2636 } // namespace content |
OLD | NEW |