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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 // Get all response headers, as a HttpResponseHeaders object. | 103 // Get all response headers, as a HttpResponseHeaders object. |
104 net::HttpResponseHeaders* GetResponseHeaders() const; | 104 net::HttpResponseHeaders* GetResponseHeaders() const; |
105 | 105 |
106 // Returns the overall number of bytes read. | 106 // Returns the overall number of bytes read. |
107 size_t bytes_read() const { return bytes_read_; } | 107 size_t bytes_read() const { return bytes_read_; } |
108 | 108 |
109 // Returns a pointer to the downloaded data. | 109 // Returns a pointer to the downloaded data. |
110 unsigned char* Data() const; | 110 unsigned char* Data() const; |
111 | 111 |
| 112 // Get NPN or ALPN Negotiated Protocol (if any) from HttpResponseInfo. |
| 113 std::string GetNegotiatedProtocol() const; |
| 114 |
112 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 115 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
113 | 116 |
114 virtual void OnReadCompleted(net::URLRequest* request, | 117 virtual void OnReadCompleted(net::URLRequest* request, |
115 int bytes_read) OVERRIDE; | 118 int bytes_read) OVERRIDE; |
116 | 119 |
117 private: | 120 private: |
118 static void OnDestroyRequest(URLRequestAdapter* self); | 121 static void OnDestroyRequest(URLRequestAdapter* self); |
119 | 122 |
120 void OnInitiateConnection(); | 123 void OnInitiateConnection(); |
121 void OnCancelRequest(); | 124 void OnCancelRequest(); |
(...skipping 24 matching lines...) Expand all Loading... |
146 bool canceled_; | 149 bool canceled_; |
147 int64 expected_size_; | 150 int64 expected_size_; |
148 bool chunked_upload_; | 151 bool chunked_upload_; |
149 | 152 |
150 DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter); | 153 DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter); |
151 }; | 154 }; |
152 | 155 |
153 } // namespace cronet | 156 } // namespace cronet |
154 | 157 |
155 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ | 158 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ |
OLD | NEW |