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

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

Issue 11270027: Add a ResourceScheduler to ResourceDispatcherHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove all linked_ptrs Created 8 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 | Annotate | Revision Log
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 #include "content/browser/loader/resource_loader.h" 5 #include "content/browser/loader/resource_loader.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "content/browser/child_process_security_policy_impl.h" 10 #include "content/browser/child_process_security_policy_impl.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 if (login_delegate_) 72 if (login_delegate_)
73 login_delegate_->OnRequestCancelled(); 73 login_delegate_->OnRequestCancelled();
74 if (ssl_client_auth_handler_) 74 if (ssl_client_auth_handler_)
75 ssl_client_auth_handler_->OnRequestCancelled(); 75 ssl_client_auth_handler_->OnRequestCancelled();
76 76
77 // Run ResourceHandler destructor before we tear-down the rest of our state 77 // Run ResourceHandler destructor before we tear-down the rest of our state
78 // as the ResourceHandler may want to inspect the URLRequest and other state. 78 // as the ResourceHandler may want to inspect the URLRequest and other state.
79 handler_.reset(); 79 handler_.reset();
80 } 80 }
81 81
82
83 void ResourceLoader::ScheduleRequest(ResourceScheduler* scheduler) {
84 DCHECK(!load_handle_);
85 ResourceRequestInfoImpl* info = GetRequestInfo();
86 load_handle_ = scheduler->ScheduleLoad(info->GetChildID(),
87 info->GetRouteID(),
88 this);
89 }
90
91 const net::URLRequest& ResourceLoader::url_request() {
92 return *request();
93 }
94
82 void ResourceLoader::StartRequest() { 95 void ResourceLoader::StartRequest() {
83 if (delegate_->HandleExternalProtocol(this, request_->url())) { 96 if (delegate_->HandleExternalProtocol(this, request_->url())) {
84 CancelAndIgnore(); 97 CancelAndIgnore();
85 return; 98 return;
86 } 99 }
87 100
88 // Give the handler a chance to delay the URLRequest from being started. 101 // Give the handler a chance to delay the URLRequest from being started.
89 bool defer_start = false; 102 bool defer_start = false;
90 if (!handler_->OnWillStart(GetRequestInfo()->GetRequestID(), request_->url(), 103 if (!handler_->OnWillStart(GetRequestInfo()->GetRequestID(), request_->url(),
91 &defer_start)) { 104 &defer_start)) {
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 // we resume. 602 // we resume.
590 deferred_stage_ = DEFERRED_FINISH; 603 deferred_stage_ = DEFERRED_FINISH;
591 } 604 }
592 } 605 }
593 606
594 void ResourceLoader::CallDidFinishLoading() { 607 void ResourceLoader::CallDidFinishLoading() {
595 delegate_->DidFinishLoading(this); 608 delegate_->DidFinishLoading(this);
596 } 609 }
597 610
598 } // namespace content 611 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698