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 COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ |
6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ | 6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 unsigned char* Data() const; | 110 unsigned char* Data() const; |
111 | 111 |
112 // Get NPN or ALPN Negotiated Protocol (if any) from HttpResponseInfo. | 112 // Get NPN or ALPN Negotiated Protocol (if any) from HttpResponseInfo. |
113 std::string GetNegotiatedProtocol() const; | 113 std::string GetNegotiatedProtocol() const; |
114 | 114 |
115 virtual void OnResponseStarted(net::URLRequest* request) override; | 115 virtual void OnResponseStarted(net::URLRequest* request) override; |
116 | 116 |
117 virtual void OnReadCompleted(net::URLRequest* request, | 117 virtual void OnReadCompleted(net::URLRequest* request, |
118 int bytes_read) override; | 118 int bytes_read) override; |
119 | 119 |
| 120 bool OnNetworkThread() const; |
| 121 |
120 private: | 122 private: |
121 static void OnDestroyRequest(URLRequestAdapter* self); | 123 static void OnDestroyRequest(URLRequestAdapter* self); |
122 | 124 |
123 void OnInitiateConnection(); | 125 void OnInitiateConnection(); |
124 void OnCancelRequest(); | 126 void OnCancelRequest(); |
125 void OnRequestSucceeded(); | 127 void OnRequestSucceeded(); |
126 void OnRequestFailed(); | 128 void OnRequestFailed(); |
127 void OnRequestCompleted(); | 129 void OnRequestCompleted(); |
128 void OnRequestCanceled(); | 130 void OnRequestCanceled(); |
129 void OnBytesRead(int bytes_read); | 131 void OnBytesRead(int bytes_read); |
(...skipping 19 matching lines...) Expand all Loading... |
149 bool canceled_; | 151 bool canceled_; |
150 int64 expected_size_; | 152 int64 expected_size_; |
151 bool chunked_upload_; | 153 bool chunked_upload_; |
152 | 154 |
153 DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter); | 155 DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter); |
154 }; | 156 }; |
155 | 157 |
156 } // namespace cronet | 158 } // namespace cronet |
157 | 159 |
158 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ | 160 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ |
OLD | NEW |