| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 class DevToolsNetworkControllerHelper; | 34 class DevToolsNetworkControllerHelper; |
| 35 } | 35 } |
| 36 | 36 |
| 37 // DevToolsNetworkTransaction is a wrapper for network transaction. All | 37 // DevToolsNetworkTransaction is a wrapper for network transaction. All |
| 38 // HttpTransaction methods are proxied to real transaction, but |callback| | 38 // HttpTransaction methods are proxied to real transaction, but |callback| |
| 39 // parameter is saved and replaced with proxy callback. Fail method should be | 39 // parameter is saved and replaced with proxy callback. Fail method should be |
| 40 // used to simulate network outage. It runs saved callback (if any) with | 40 // used to simulate network outage. It runs saved callback (if any) with |
| 41 // net::ERR_INTERNET_DISCONNECTED result value. | 41 // net::ERR_INTERNET_DISCONNECTED result value. |
| 42 class DevToolsNetworkTransaction : public net::HttpTransaction { | 42 class DevToolsNetworkTransaction : public net::HttpTransaction { |
| 43 public: | 43 public: |
| 44 static const char kDevToolsRequestInitiator[]; |
| 45 static const char kDevToolsEmulateNetworkConditionsClientId[]; |
| 46 |
| 44 DevToolsNetworkTransaction( | 47 DevToolsNetworkTransaction( |
| 45 DevToolsNetworkController* controller, | 48 DevToolsNetworkController* controller, |
| 46 scoped_ptr<net::HttpTransaction> network_transaction); | 49 scoped_ptr<net::HttpTransaction> network_transaction); |
| 47 | 50 |
| 48 ~DevToolsNetworkTransaction() override; | 51 ~DevToolsNetworkTransaction() override; |
| 49 | 52 |
| 50 const net::HttpRequestInfo* request() const { return request_; } | 53 const net::HttpRequestInfo* request() const { return request_; } |
| 51 | 54 |
| 52 // Checks if request contains DevTools specific headers. Found values are | 55 // Checks if request contains DevTools specific headers. Found values are |
| 53 // remembered and corresponding keys are removed from headers. | 56 // remembered and corresponding keys are removed from headers. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 int throttled_result_; | 156 int throttled_result_; |
| 154 int64_t throttled_byte_count_; | 157 int64_t throttled_byte_count_; |
| 155 CallbackType callback_type_; | 158 CallbackType callback_type_; |
| 156 net::CompletionCallback proxy_callback_; | 159 net::CompletionCallback proxy_callback_; |
| 157 net::CompletionCallback callback_; | 160 net::CompletionCallback callback_; |
| 158 | 161 |
| 159 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransaction); | 162 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransaction); |
| 160 }; | 163 }; |
| 161 | 164 |
| 162 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ | 165 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ |
| OLD | NEW |