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

Side by Side Diff: headless/public/util/url_request_dispatcher.h

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
« no previous file with comments | « headless/public/util/url_fetcher.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
(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 #ifndef HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_
6 #define HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_
7
8 #include "base/macros.h"
9 #include "net/base/net_errors.h"
10
11 namespace headless {
12 class ManagedDispatchURLRequestJob;
13
14 // Interface to abstract and potentially reorder (for determinism) calls to
15 // ManagedDispatchUrlRequestJob::OnHeadersComplete and
16 // ManagedDispatchUrlRequestJob::NotifyStartError.
17 class URLRequestDispatcher {
18 public:
19 URLRequestDispatcher() {}
20 virtual ~URLRequestDispatcher() {}
21
22 // Tells us a URLRequestJob was created. Can be called from any thread.
23 virtual void JobCreated(ManagedDispatchURLRequestJob* job) = 0;
24
25 // Tells us a URLRequestJob got killed. Can be called from any thread.
26 virtual void JobKilled(ManagedDispatchURLRequestJob* job) = 0;
27
28 // Tells us a URLRequestJob failed. Can be called from any thread.
29 virtual void JobFailed(ManagedDispatchURLRequestJob* job,
30 net::Error error) = 0;
31
32 // Tells us a URLRequestJob has fetched the data and is ready for the net
33 // stack to consume it. Can be called from any thread.
34 virtual void DataReady(ManagedDispatchURLRequestJob* job) = 0;
35
36 // Tells us the job has finished. Can be called from any thread.
37 virtual void JobDeleted(ManagedDispatchURLRequestJob* job) = 0;
38
39 private:
40 DISALLOW_COPY_AND_ASSIGN(URLRequestDispatcher);
41 };
42
43 } // namespace headless
44
45 #endif // HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_
OLDNEW
« no previous file with comments | « headless/public/util/url_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698