OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_ | 5 #ifndef HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_ |
6 #define HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_ | 6 #define HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "headless/public/headless_export.h" |
9 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
10 | 11 |
11 namespace headless { | 12 namespace headless { |
12 class ManagedDispatchURLRequestJob; | 13 class ManagedDispatchURLRequestJob; |
13 class NavigationRequest; | 14 class NavigationRequest; |
14 | 15 |
15 // Interface to abstract and potentially reorder (for determinism) calls to | 16 // Interface to abstract and potentially reorder (for determinism) calls to |
16 // ManagedDispatchUrlRequestJob::OnHeadersComplete and | 17 // ManagedDispatchUrlRequestJob::OnHeadersComplete and |
17 // ManagedDispatchUrlRequestJob::NotifyStartError. | 18 // ManagedDispatchUrlRequestJob::NotifyStartError. |
18 class URLRequestDispatcher { | 19 class HEADLESS_EXPORT URLRequestDispatcher { |
19 public: | 20 public: |
20 URLRequestDispatcher() {} | 21 URLRequestDispatcher() {} |
21 virtual ~URLRequestDispatcher() {} | 22 virtual ~URLRequestDispatcher() {} |
22 | 23 |
23 // Tells us a URLRequestJob was created. Can be called from any thread. | 24 // Tells us a URLRequestJob was created. Can be called from any thread. |
24 virtual void JobCreated(ManagedDispatchURLRequestJob* job) = 0; | 25 virtual void JobCreated(ManagedDispatchURLRequestJob* job) = 0; |
25 | 26 |
26 // Tells us a URLRequestJob got killed. Can be called from any thread. | 27 // Tells us a URLRequestJob got killed. Can be called from any thread. |
27 virtual void JobKilled(ManagedDispatchURLRequestJob* job) = 0; | 28 virtual void JobKilled(ManagedDispatchURLRequestJob* job) = 0; |
28 | 29 |
(...skipping 12 matching lines...) Expand all Loading... |
41 virtual void NavigationRequested( | 42 virtual void NavigationRequested( |
42 std::unique_ptr<NavigationRequest> navigation_request) = 0; | 43 std::unique_ptr<NavigationRequest> navigation_request) = 0; |
43 | 44 |
44 private: | 45 private: |
45 DISALLOW_COPY_AND_ASSIGN(URLRequestDispatcher); | 46 DISALLOW_COPY_AND_ASSIGN(URLRequestDispatcher); |
46 }; | 47 }; |
47 | 48 |
48 } // namespace headless | 49 } // namespace headless |
49 | 50 |
50 #endif // HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_ | 51 #endif // HEADLESS_PUBLIC_UTIL_URL_REQUEST_DISPATCHER_H_ |
OLD | NEW |