OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "headless/public/util/managed_dispatch_url_request_job.h" |
| 6 |
| 7 #include "headless/public/util/url_request_dispatcher.h" |
| 8 |
| 9 namespace headless { |
| 10 |
| 11 ManagedDispatchURLRequestJob::ManagedDispatchURLRequestJob( |
| 12 net::URLRequest* request, |
| 13 net::NetworkDelegate* network_delegate, |
| 14 URLRequestDispatcher* url_request_dispatcher) |
| 15 : net::URLRequestJob(request, network_delegate), |
| 16 url_request_dispatcher_(url_request_dispatcher) { |
| 17 url_request_dispatcher_->JobCreated(this); |
| 18 } |
| 19 |
| 20 ManagedDispatchURLRequestJob::~ManagedDispatchURLRequestJob() { |
| 21 // We can be fairly certain the renderer has finished by the time the job gets |
| 22 // deleted. |
| 23 url_request_dispatcher_->JobDeleted(this); |
| 24 } |
| 25 |
| 26 void ManagedDispatchURLRequestJob::Kill() { |
| 27 url_request_dispatcher_->JobKilled(this); |
| 28 URLRequestJob::Kill(); |
| 29 } |
| 30 |
| 31 void ManagedDispatchURLRequestJob::DispatchStartError(net::Error error) { |
| 32 url_request_dispatcher_->JobFailed(this, error); |
| 33 } |
| 34 |
| 35 void ManagedDispatchURLRequestJob::DispatchHeadersComplete() { |
| 36 url_request_dispatcher_->DataReady(this); |
| 37 } |
| 38 |
| 39 void ManagedDispatchURLRequestJob::OnHeadersComplete() { |
| 40 NotifyHeadersComplete(); |
| 41 } |
| 42 |
| 43 void ManagedDispatchURLRequestJob::OnStartError(net::Error error) { |
| 44 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, error)); |
| 45 } |
| 46 |
| 47 } // namespace headless |
OLD | NEW |