| 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 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "net/base/chunked_upload_data_stream.h" |
| 16 #include "net/base/request_priority.h" | 17 #include "net/base/request_priority.h" |
| 17 #include "net/http/http_request_headers.h" | 18 #include "net/http/http_request_headers.h" |
| 18 #include "net/url_request/url_request.h" | 19 #include "net/url_request/url_request.h" |
| 19 | 20 |
| 20 namespace net { | 21 namespace net { |
| 22 class HttpResponseHeaders; |
| 21 class IOBufferWithSize; | 23 class IOBufferWithSize; |
| 22 class HttpResponseHeaders; | |
| 23 class UploadDataStream; | 24 class UploadDataStream; |
| 24 struct RedirectInfo; | 25 struct RedirectInfo; |
| 25 } // namespace net | 26 } // namespace net |
| 26 | 27 |
| 27 namespace cronet { | 28 namespace cronet { |
| 28 | 29 |
| 29 class URLRequestContextAdapter; | 30 class URLRequestContextAdapter; |
| 30 | 31 |
| 31 // An adapter from the JNI |UrlRequest| object and the Chromium |URLRequest| | 32 // An adapter from the JNI |UrlRequest| object and the Chromium |URLRequest| |
| 32 // object. | 33 // object. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 bool HandleReadResult(int bytes_read); | 150 bool HandleReadResult(int bytes_read); |
| 150 | 151 |
| 151 URLRequestContextAdapter* context_; | 152 URLRequestContextAdapter* context_; |
| 152 scoped_refptr<URLRequestAdapterDelegate> delegate_; | 153 scoped_refptr<URLRequestAdapterDelegate> delegate_; |
| 153 GURL url_; | 154 GURL url_; |
| 154 net::RequestPriority priority_; | 155 net::RequestPriority priority_; |
| 155 std::string method_; | 156 std::string method_; |
| 156 net::HttpRequestHeaders headers_; | 157 net::HttpRequestHeaders headers_; |
| 157 scoped_ptr<net::URLRequest> url_request_; | 158 scoped_ptr<net::URLRequest> url_request_; |
| 158 scoped_ptr<net::UploadDataStream> upload_data_stream_; | 159 scoped_ptr<net::UploadDataStream> upload_data_stream_; |
| 160 scoped_ptr<net::ChunkedUploadDataStream::Writer> chunked_upload_writer_; |
| 159 scoped_refptr<net::IOBufferWithSize> read_buffer_; | 161 scoped_refptr<net::IOBufferWithSize> read_buffer_; |
| 160 int total_bytes_read_; | 162 int total_bytes_read_; |
| 161 int error_code_; | 163 int error_code_; |
| 162 int http_status_code_; | 164 int http_status_code_; |
| 163 std::string http_status_text_; | 165 std::string http_status_text_; |
| 164 std::string content_type_; | 166 std::string content_type_; |
| 165 bool canceled_; | 167 bool canceled_; |
| 166 int64_t expected_size_; | 168 int64_t expected_size_; |
| 167 bool chunked_upload_; | 169 bool chunked_upload_; |
| 168 // Indicates whether redirect has been disabled. | 170 // Indicates whether redirect has been disabled. |
| 169 bool disable_redirect_; | 171 bool disable_redirect_; |
| 170 | 172 |
| 171 DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter); | 173 DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter); |
| 172 }; | 174 }; |
| 173 | 175 |
| 174 } // namespace cronet | 176 } // namespace cronet |
| 175 | 177 |
| 176 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ | 178 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_ |
| OLD | NEW |