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

Side by Side Diff: headless/public/util/managed_dispatch_url_request_job.cc

Issue 2260793002: Headless utility classes for making deterministic protocol handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 4 years, 4 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698