| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 // Get all response headers, as a HttpResponseHeaders object. | 112 // Get all response headers, as a HttpResponseHeaders object. |
| 113 net::HttpResponseHeaders* GetResponseHeaders() const; | 113 net::HttpResponseHeaders* GetResponseHeaders() const; |
| 114 | 114 |
| 115 // Returns a pointer to the downloaded data. | 115 // Returns a pointer to the downloaded data. |
| 116 unsigned char* Data() const; | 116 unsigned char* Data() const; |
| 117 | 117 |
| 118 // Get NPN or ALPN Negotiated Protocol (if any) from HttpResponseInfo. | 118 // Get NPN or ALPN Negotiated Protocol (if any) from HttpResponseInfo. |
| 119 std::string GetNegotiatedProtocol() const; | 119 std::string GetNegotiatedProtocol() const; |
| 120 | 120 |
| 121 // Returns whether the response is serviced from cache. |
| 122 bool GetWasCached() const; |
| 123 |
| 121 // net::URLRequest::Delegate implementation: | 124 // net::URLRequest::Delegate implementation: |
| 122 void OnResponseStarted(net::URLRequest* request) override; | 125 void OnResponseStarted(net::URLRequest* request) override; |
| 123 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; | 126 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; |
| 124 void OnReceivedRedirect(net::URLRequest* request, | 127 void OnReceivedRedirect(net::URLRequest* request, |
| 125 const net::RedirectInfo& redirect_info, | 128 const net::RedirectInfo& redirect_info, |
| 126 bool* defer_redirect) override; | 129 bool* defer_redirect) override; |
| 127 | 130 |
| 128 bool OnNetworkThread() const; | 131 bool OnNetworkThread() const; |
| 129 | 132 |
| 130 private: | 133 private: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 bool chunked_upload_; | 166 bool chunked_upload_; |
| 164 // Indicates whether redirect has been disabled. | 167 // Indicates whether redirect has been disabled. |
| 165 bool disable_redirect_; | 168 bool disable_redirect_; |
| 166 | 169 |
| 167 DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter); | 170 DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter); |
| 168 }; | 171 }; |
| 169 | 172 |
| 170 } // namespace cronet | 173 } // namespace cronet |
| 171 | 174 |
| 172 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ | 175 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ |
| OLD | NEW |