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

Side by Side Diff: content/child/url_loader_client_impl.cc

Issue 2710403002: Use the loading task runner for mojo-loading (Closed)
Patch Set: fix Created 3 years, 9 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
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/child/url_loader_client_impl.h" 5 #include "content/child/url_loader_client_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "content/child/resource_dispatcher.h" 9 #include "content/child/resource_dispatcher.h"
10 #include "content/child/url_response_body_consumer.h" 10 #include "content/child/url_response_body_consumer.h"
(...skipping 12 matching lines...) Expand all
23 task_runner_(std::move(task_runner)), 23 task_runner_(std::move(task_runner)),
24 weak_factory_(this) {} 24 weak_factory_(this) {}
25 25
26 URLLoaderClientImpl::~URLLoaderClientImpl() { 26 URLLoaderClientImpl::~URLLoaderClientImpl() {
27 if (body_consumer_) 27 if (body_consumer_)
28 body_consumer_->Cancel(); 28 body_consumer_->Cancel();
29 } 29 }
30 30
31 void URLLoaderClientImpl::Bind( 31 void URLLoaderClientImpl::Bind(
32 mojom::URLLoaderClientAssociatedPtrInfo* client_ptr_info) { 32 mojom::URLLoaderClientAssociatedPtrInfo* client_ptr_info) {
33 // TODO(yhirano): Use |task_runner_| here.
34 // Currently it is unable because of a ChannelAssociatedInterface restriction.
33 binding_.Bind(client_ptr_info); 35 binding_.Bind(client_ptr_info);
34 } 36 }
35 37
36 void URLLoaderClientImpl::SetDefersLoading() { 38 void URLLoaderClientImpl::SetDefersLoading() {
37 is_deferred_ = true; 39 is_deferred_ = true;
38 if (body_consumer_) 40 if (body_consumer_)
39 body_consumer_->SetDefersLoading(); 41 body_consumer_->SetDefersLoading();
40 } 42 }
41 43
42 void URLLoaderClientImpl::UnsetDefersLoading() { 44 void URLLoaderClientImpl::UnsetDefersLoading() {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 180
179 void URLLoaderClientImpl::OnUploadProgress(int64_t current_position, 181 void URLLoaderClientImpl::OnUploadProgress(int64_t current_position,
180 int64_t total_size, 182 int64_t total_size,
181 const base::Closure& ack_callback) { 183 const base::Closure& ack_callback) {
182 Dispatch( 184 Dispatch(
183 ResourceMsg_UploadProgress(request_id_, current_position, total_size)); 185 ResourceMsg_UploadProgress(request_id_, current_position, total_size));
184 ack_callback.Run(); 186 ack_callback.Run();
185 } 187 }
186 188
187 } // namespace content 189 } // namespace content
OLDNEW
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698