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

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

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
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 <utility>
8
7 #include "content/browser/loader/resource_request_info_impl.h" 9 #include "content/browser/loader/resource_request_info_impl.h"
8 #include "content/public/browser/resource_throttle.h" 10 #include "content/public/browser/resource_throttle.h"
9 #include "content/public/common/resource_response.h" 11 #include "content/public/common/resource_response.h"
10 #include "net/url_request/url_request.h" 12 #include "net/url_request/url_request.h"
11 13
12 namespace content { 14 namespace content {
13 15
14 ThrottlingResourceHandler::ThrottlingResourceHandler( 16 ThrottlingResourceHandler::ThrottlingResourceHandler(
15 scoped_ptr<ResourceHandler> next_handler, 17 scoped_ptr<ResourceHandler> next_handler,
16 net::URLRequest* request, 18 net::URLRequest* request,
17 ScopedVector<ResourceThrottle> throttles) 19 ScopedVector<ResourceThrottle> throttles)
18 : LayeredResourceHandler(request, next_handler.Pass()), 20 : LayeredResourceHandler(request, std::move(next_handler)),
19 deferred_stage_(DEFERRED_NONE), 21 deferred_stage_(DEFERRED_NONE),
20 throttles_(throttles.Pass()), 22 throttles_(std::move(throttles)),
21 next_index_(0), 23 next_index_(0),
22 cancelled_by_resource_throttle_(false) { 24 cancelled_by_resource_throttle_(false) {
23 for (size_t i = 0; i < throttles_.size(); ++i) { 25 for (size_t i = 0; i < throttles_.size(); ++i) {
24 throttles_[i]->set_controller(this); 26 throttles_[i]->set_controller(this);
25 // Throttles must have a name, as otherwise, bugs where a throttle fails 27 // Throttles must have a name, as otherwise, bugs where a throttle fails
26 // to resume a request can be very difficult to debug. 28 // to resume a request can be very difficult to debug.
27 DCHECK(throttles_[i]->GetNameForLogging()); 29 DCHECK(throttles_[i]->GetNameForLogging());
28 } 30 }
29 } 31 }
30 32
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } else if (!defer) { 227 } else if (!defer) {
226 controller()->Resume(); 228 controller()->Resume();
227 } 229 }
228 } 230 }
229 231
230 void ThrottlingResourceHandler::OnRequestDefered(int throttle_index) { 232 void ThrottlingResourceHandler::OnRequestDefered(int throttle_index) {
231 request()->LogBlockedBy(throttles_[throttle_index]->GetNameForLogging()); 233 request()->LogBlockedBy(throttles_[throttle_index]->GetNameForLogging());
232 } 234 }
233 235
234 } // namespace content 236 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/temporary_file_stream_unittest.cc ('k') | content/browser/manifest/manifest_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698