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 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // DevToolsNetworkTransaction is a wrapper for network transaction. All | 40 // DevToolsNetworkTransaction is a wrapper for network transaction. All |
41 // HttpTransaction methods are proxied to real transaction, but |callback| | 41 // HttpTransaction methods are proxied to real transaction, but |callback| |
42 // parameter is saved and replaced with proxy callback. Fail method should be | 42 // parameter is saved and replaced with proxy callback. Fail method should be |
43 // used to simulate network outage. It runs saved callback (if any) with | 43 // used to simulate network outage. It runs saved callback (if any) with |
44 // net::ERR_INTERNET_DISCONNECTED result value. | 44 // net::ERR_INTERNET_DISCONNECTED result value. |
45 class DevToolsNetworkTransaction | 45 class DevToolsNetworkTransaction |
46 : public net::HttpTransaction { | 46 : public net::HttpTransaction { |
47 public: | 47 public: |
48 static const char kDevToolsEmulateNetworkConditionsClientId[]; | 48 static const char kDevToolsEmulateNetworkConditionsClientId[]; |
| 49 static const char kDevToolsRequestId[]; |
49 | 50 |
50 DevToolsNetworkTransaction( | 51 DevToolsNetworkTransaction( |
51 DevToolsNetworkController* controller, | 52 DevToolsNetworkController* controller, |
52 std::unique_ptr<net::HttpTransaction> network_transaction); | 53 std::unique_ptr<net::HttpTransaction> network_transaction); |
53 | 54 |
54 ~DevToolsNetworkTransaction() override; | 55 ~DevToolsNetworkTransaction() override; |
55 | 56 |
56 // HttpTransaction methods: | 57 // HttpTransaction methods: |
57 int Start(const net::HttpRequestInfo* request, | 58 int Start(const net::HttpRequestInfo* request, |
58 const net::CompletionCallback& callback, | 59 const net::CompletionCallback& callback, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 125 |
125 const net::HttpRequestInfo* request_; | 126 const net::HttpRequestInfo* request_; |
126 | 127 |
127 // True if Fail was already invoked. | 128 // True if Fail was already invoked. |
128 bool failed_; | 129 bool failed_; |
129 | 130 |
130 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransaction); | 131 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransaction); |
131 }; | 132 }; |
132 | 133 |
133 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ | 134 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ |
OLD | NEW |