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

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: Resilient to crashing renderers 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/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "content/browser/child_process_security_policy_impl.h" 9 #include "content/browser/child_process_security_policy_impl.h"
10 #include "content/browser/loader/doomed_resource_handler.h" 10 #include "content/browser/loader/doomed_resource_handler.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (login_delegate_) 69 if (login_delegate_)
70 login_delegate_->OnRequestCancelled(); 70 login_delegate_->OnRequestCancelled();
71 if (ssl_client_auth_handler_) 71 if (ssl_client_auth_handler_)
72 ssl_client_auth_handler_->OnRequestCancelled(); 72 ssl_client_auth_handler_->OnRequestCancelled();
73 73
74 // Run ResourceHandler destructor before we tear-down the rest of our state 74 // Run ResourceHandler destructor before we tear-down the rest of our state
75 // as the ResourceHandler may want to inspect the URLRequest and other state. 75 // as the ResourceHandler may want to inspect the URLRequest and other state.
76 handler_.reset(); 76 handler_.reset();
77 } 77 }
78 78
79
80 void ResourceLoader::ScheduleRequest(ResourceScheduler* scheduler) {
81 DCHECK(!load_handle_);
82 ResourceRequestInfoImpl* info = GetRequestInfo();
83 load_handle_ = scheduler->ScheduleLoad(info->GetChildID(),
84 info->GetRouteID(),
85 this);
86 }
87
88 const net::URLRequest* ResourceLoader::url_request() {
89 return request();
90 }
91
79 void ResourceLoader::StartRequest() { 92 void ResourceLoader::StartRequest() {
80 if (delegate_->HandleExternalProtocol(this, request_->url())) { 93 if (delegate_->HandleExternalProtocol(this, request_->url())) {
81 CancelAndIgnore(); 94 CancelAndIgnore();
82 return; 95 return;
83 } 96 }
84 97
85 // Give the handler a chance to delay the URLRequest from being started. 98 // Give the handler a chance to delay the URLRequest from being started.
86 bool defer_start = false; 99 bool defer_start = false;
87 if (!handler_->OnWillStart(GetRequestInfo()->GetRequestID(), request_->url(), 100 if (!handler_->OnWillStart(GetRequestInfo()->GetRequestID(), request_->url(),
88 &defer_start)) { 101 &defer_start)) {
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 // we resume. 586 // we resume.
574 deferred_stage_ = DEFERRED_FINISH; 587 deferred_stage_ = DEFERRED_FINISH;
575 } 588 }
576 } 589 }
577 590
578 void ResourceLoader::CallDidFinishLoading() { 591 void ResourceLoader::CallDidFinishLoading() {
579 delegate_->DidFinishLoading(this); 592 delegate_->DidFinishLoading(this);
580 } 593 }
581 594
582 } // namespace content 595 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698