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 "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
10 #include "net/base/load_states.h" | 10 #include "net/base/load_states.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 scoped_ptr<net::HttpTransaction> network_transaction); | 40 scoped_ptr<net::HttpTransaction> network_transaction); |
41 | 41 |
42 virtual ~DevToolsNetworkTransaction(); | 42 virtual ~DevToolsNetworkTransaction(); |
43 | 43 |
44 const net::HttpRequestInfo* request() const { return request_; } | 44 const net::HttpRequestInfo* request() const { return request_; } |
45 bool failed() const { return failed_; } | 45 bool failed() const { return failed_; } |
46 | 46 |
47 // Runs callback (if any) with net::ERR_INTERNET_DISCONNECTED result value. | 47 // Runs callback (if any) with net::ERR_INTERNET_DISCONNECTED result value. |
48 void Fail(); | 48 void Fail(); |
49 | 49 |
| 50 int64_t throttled_byte_count() const { return throttled_byte_count_; } |
| 51 void DecreaseThrottledByteCount(int64_t delta); |
| 52 void FireThrottledCallback(); |
| 53 |
50 // HttpTransaction methods: | 54 // HttpTransaction methods: |
51 virtual int Start( | 55 virtual int Start( |
52 const net::HttpRequestInfo* request, | 56 const net::HttpRequestInfo* request, |
53 const net::CompletionCallback& callback, | 57 const net::CompletionCallback& callback, |
54 const net::BoundNetLog& net_log) OVERRIDE; | 58 const net::BoundNetLog& net_log) OVERRIDE; |
55 virtual int RestartIgnoringLastError( | 59 virtual int RestartIgnoringLastError( |
56 const net::CompletionCallback& callback) OVERRIDE; | 60 const net::CompletionCallback& callback) OVERRIDE; |
57 virtual int RestartWithCertificate( | 61 virtual int RestartWithCertificate( |
58 net::X509Certificate* client_cert, | 62 net::X509Certificate* client_cert, |
59 const net::CompletionCallback& callback) OVERRIDE; | 63 const net::CompletionCallback& callback) OVERRIDE; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 scoped_ptr<net::HttpTransaction> network_transaction_; | 99 scoped_ptr<net::HttpTransaction> network_transaction_; |
96 | 100 |
97 const net::HttpRequestInfo* request_; | 101 const net::HttpRequestInfo* request_; |
98 | 102 |
99 // True if Start was already invoked. | 103 // True if Start was already invoked. |
100 bool started_; | 104 bool started_; |
101 | 105 |
102 // True if Fail was already invoked. | 106 // True if Fail was already invoked. |
103 bool failed_; | 107 bool failed_; |
104 | 108 |
| 109 enum CallbackType { |
| 110 NONE, |
| 111 READ, |
| 112 RESTART_IGNORING_LAST_ERROR, |
| 113 RESTART_WITH_AUTH, |
| 114 RESTART_WITH_CERTIFICATE, |
| 115 START |
| 116 }; |
| 117 |
| 118 int SetupCallback( |
| 119 net::CompletionCallback callback, |
| 120 int result, |
| 121 CallbackType callback_type); |
| 122 |
| 123 void Throttle(int result); |
| 124 |
| 125 int throttled_result_; |
| 126 int64_t throttled_byte_count_; |
| 127 CallbackType callback_type_; |
105 net::CompletionCallback proxy_callback_; | 128 net::CompletionCallback proxy_callback_; |
106 net::CompletionCallback callback_; | 129 net::CompletionCallback callback_; |
107 | 130 |
108 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransaction); | 131 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransaction); |
109 }; | 132 }; |
110 | 133 |
111 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ | 134 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_H_ |
OLD | NEW |