| 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_PEER_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ |
| 6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ | 6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 // Returns the value of the content-length response header. | 81 // Returns the value of the content-length response header. |
| 82 int64 content_length() const { return expected_size_; } | 82 int64 content_length() const { return expected_size_; } |
| 83 | 83 |
| 84 // Returns the value of the content-type response header. | 84 // Returns the value of the content-type response header. |
| 85 std::string content_type() const { return content_type_; } | 85 std::string content_type() const { return content_type_; } |
| 86 | 86 |
| 87 // Returns the value of the specified response header. | 87 // Returns the value of the specified response header. |
| 88 std::string GetHeader(const std::string& name) const; | 88 std::string GetHeader(const std::string& name) const; |
| 89 | 89 |
| 90 // Gets all headers. |
| 91 bool GetFullRequestHeaders(net::HttpRequestHeaders* headers) const; |
| 92 |
| 90 // Returns the overall number of bytes read. | 93 // Returns the overall number of bytes read. |
| 91 size_t bytes_read() const { return bytes_read_; } | 94 size_t bytes_read() const { return bytes_read_; } |
| 92 | 95 |
| 93 // Returns a pointer to the downloaded data. | 96 // Returns a pointer to the downloaded data. |
| 94 unsigned char* Data() const; | 97 unsigned char* Data() const; |
| 95 | 98 |
| 96 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 99 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
| 97 | 100 |
| 98 virtual void OnReadCompleted(net::URLRequest* request, | 101 virtual void OnReadCompleted(net::URLRequest* request, |
| 99 int bytes_read) OVERRIDE; | 102 int bytes_read) OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 129 void OnAppendChunk(const char* bytes, int bytes_len, bool is_last_chunk); | 132 void OnAppendChunk(const char* bytes, int bytes_len, bool is_last_chunk); |
| 130 | 133 |
| 131 void Read(); | 134 void Read(); |
| 132 | 135 |
| 133 DISALLOW_COPY_AND_ASSIGN(URLRequestPeer); | 136 DISALLOW_COPY_AND_ASSIGN(URLRequestPeer); |
| 134 }; | 137 }; |
| 135 | 138 |
| 136 } // namespace cronet | 139 } // namespace cronet |
| 137 | 140 |
| 138 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ | 141 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ |
| OLD | NEW |