OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 uint32_t num_bytes_; | 134 uint32_t num_bytes_; |
135 uint32_t offset_; | 135 uint32_t offset_; |
136 | 136 |
137 DISALLOW_COPY_AND_ASSIGN(UploadDataPipeElementReader); | 137 DISALLOW_COPY_AND_ASSIGN(UploadDataPipeElementReader); |
138 }; | 138 }; |
139 | 139 |
140 } // namespace | 140 } // namespace |
141 | 141 |
142 URLLoaderImpl::URLLoaderImpl(NetworkContext* context, | 142 URLLoaderImpl::URLLoaderImpl(NetworkContext* context, |
143 InterfaceRequest<URLLoader> request, | 143 InterfaceRequest<URLLoader> request, |
144 scoped_ptr<mojo::AppRefCount> app_refcount) | 144 scoped_ptr<mojo::MessageLoopRef> app_refcount) |
145 : context_(context), | 145 : context_(context), |
146 response_body_buffer_size_(0), | 146 response_body_buffer_size_(0), |
147 response_body_bytes_read_(0), | 147 response_body_bytes_read_(0), |
148 auto_follow_redirects_(true), | 148 auto_follow_redirects_(true), |
149 connected_(true), | 149 connected_(true), |
150 binding_(this, std::move(request)), | 150 binding_(this, std::move(request)), |
151 app_refcount_(std::move(app_refcount)), | 151 app_refcount_(std::move(app_refcount)), |
152 weak_ptr_factory_(this) { | 152 weak_ptr_factory_(this) { |
153 binding_.set_connection_error_handler([this]() { OnConnectionError(); }); | 153 binding_.set_connection_error_handler([this]() { OnConnectionError(); }); |
154 context_->RegisterURLLoader(this); | 154 context_->RegisterURLLoader(this); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 void URLLoaderImpl::ListenForPeerClosed() { | 418 void URLLoaderImpl::ListenForPeerClosed() { |
419 handle_watcher_.Start(response_body_stream_.get(), | 419 handle_watcher_.Start(response_body_stream_.get(), |
420 MOJO_HANDLE_SIGNAL_PEER_CLOSED, | 420 MOJO_HANDLE_SIGNAL_PEER_CLOSED, |
421 MOJO_DEADLINE_INDEFINITE, | 421 MOJO_DEADLINE_INDEFINITE, |
422 base::Bind(&URLLoaderImpl::OnResponseBodyStreamClosed, | 422 base::Bind(&URLLoaderImpl::OnResponseBodyStreamClosed, |
423 base::Unretained(this))); | 423 base::Unretained(this))); |
424 } | 424 } |
425 | 425 |
426 } // namespace mojo | 426 } // namespace mojo |
OLD | NEW |