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

Side by Side Diff: mojo/services/network/url_loader_impl.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/services/network/url_loader_impl.h" 5 #include "mojo/services/network/url_loader_impl.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "mojo/common/common_type_converters.h" 8 #include "mojo/common/common_type_converters.h"
9 #include "mojo/services/network/network_context.h" 9 #include "mojo/services/network/network_context.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 URLLoaderImpl::URLLoaderImpl(NetworkContext* context) 111 URLLoaderImpl::URLLoaderImpl(NetworkContext* context)
112 : context_(context), 112 : context_(context),
113 response_body_buffer_size_(0), 113 response_body_buffer_size_(0),
114 auto_follow_redirects_(true), 114 auto_follow_redirects_(true),
115 weak_ptr_factory_(this) { 115 weak_ptr_factory_(this) {
116 } 116 }
117 117
118 URLLoaderImpl::~URLLoaderImpl() { 118 URLLoaderImpl::~URLLoaderImpl() {
119 } 119 }
120 120
121 void URLLoaderImpl::OnConnectionError() {
122 delete this;
123 }
124
125 void URLLoaderImpl::Start(URLRequestPtr request, 121 void URLLoaderImpl::Start(URLRequestPtr request,
126 const Callback<void(URLResponsePtr)>& callback) { 122 const Callback<void(URLResponsePtr)>& callback) {
127 if (url_request_) { 123 if (url_request_) {
128 SendError(net::ERR_UNEXPECTED, callback); 124 SendError(net::ERR_UNEXPECTED, callback);
129 return; 125 return;
130 } 126 }
131 127
132 if (!request) { 128 if (!request) {
133 SendError(net::ERR_INVALID_ARGUMENT, callback); 129 SendError(net::ERR_INVALID_ARGUMENT, callback);
134 return; 130 return;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 if (completed_synchronously) { 318 if (completed_synchronously) {
323 base::MessageLoop::current()->PostTask( 319 base::MessageLoop::current()->PostTask(
324 FROM_HERE, 320 FROM_HERE,
325 base::Bind(&URLLoaderImpl::ReadMore, weak_ptr_factory_.GetWeakPtr())); 321 base::Bind(&URLLoaderImpl::ReadMore, weak_ptr_factory_.GetWeakPtr()));
326 } else { 322 } else {
327 ReadMore(); 323 ReadMore();
328 } 324 }
329 } 325 }
330 326
331 } // namespace mojo 327 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/network/url_loader_impl.h ('k') | mojo/services/public/cpp/view_manager/lib/view_manager_client_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698