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

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

Issue 12243002: Pass WebKit priority changes and parsing messages up to the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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/throttling_resource_handler.h" 5 #include "content/browser/loader/throttling_resource_handler.h"
6 6
7 #include "content/public/browser/resource_throttle.h" 7 #include "content/public/browser/resource_throttle.h"
8 #include "content/public/common/resource_response.h" 8 #include "content/public/common/resource_response.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 deferred_response_ = response; 94 deferred_response_ = response;
95 return true; // Do not cancel. 95 return true; // Do not cancel.
96 } 96 }
97 } 97 }
98 98
99 index_ = 0; // Reset for next time. 99 index_ = 0; // Reset for next time.
100 100
101 return next_handler_->OnResponseStarted(request_id, response, defer); 101 return next_handler_->OnResponseStarted(request_id, response, defer);
102 } 102 }
103 103
104 void ThrottlingResourceHandler::OnRequestPriorityChanged(int request_id) {
105 for (size_t i = 0; i < throttles_.size(); ++i) {
106 throttles_[i]->OnRequestPriorityChanged();
107 }
108 next_handler_->OnRequestPriorityChanged(request_id);
109 }
110
104 void ThrottlingResourceHandler::Cancel() { 111 void ThrottlingResourceHandler::Cancel() {
105 cancelled_by_resource_throttle_ = true; 112 cancelled_by_resource_throttle_ = true;
106 controller()->Cancel(); 113 controller()->Cancel();
107 } 114 }
108 115
109 void ThrottlingResourceHandler::CancelAndIgnore() { 116 void ThrottlingResourceHandler::CancelAndIgnore() {
110 cancelled_by_resource_throttle_ = true; 117 cancelled_by_resource_throttle_ = true;
111 controller()->CancelAndIgnore(); 118 controller()->CancelAndIgnore();
112 } 119 }
113 120
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 182
176 bool defer = false; 183 bool defer = false;
177 if (!OnResponseStarted(request_id_, response, &defer)) { 184 if (!OnResponseStarted(request_id_, response, &defer)) {
178 controller()->Cancel(); 185 controller()->Cancel();
179 } else if (!defer) { 186 } else if (!defer) {
180 controller()->Resume(); 187 controller()->Resume();
181 } 188 }
182 } 189 }
183 190
184 } // namespace content 191 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698