| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 int http_status_code() const { | 77 int http_status_code() const { |
| 78 return http_status_code_; | 78 return http_status_code_; |
| 79 }; | 79 }; |
| 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. |
| 88 std::string GetHeader(const std::string& name) const; |
| 89 |
| 87 // Returns the overall number of bytes read. | 90 // Returns the overall number of bytes read. |
| 88 size_t bytes_read() const { return bytes_read_; } | 91 size_t bytes_read() const { return bytes_read_; } |
| 89 | 92 |
| 90 // Returns a pointer to the downloaded data. | 93 // Returns a pointer to the downloaded data. |
| 91 unsigned char* Data() const; | 94 unsigned char* Data() const; |
| 92 | 95 |
| 93 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 96 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
| 94 | 97 |
| 95 virtual void OnReadCompleted(net::URLRequest* request, | 98 virtual void OnReadCompleted(net::URLRequest* request, |
| 96 int bytes_read) OVERRIDE; | 99 int bytes_read) OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 126 void OnAppendChunk(const char* bytes, int bytes_len, bool is_last_chunk); | 129 void OnAppendChunk(const char* bytes, int bytes_len, bool is_last_chunk); |
| 127 | 130 |
| 128 void Read(); | 131 void Read(); |
| 129 | 132 |
| 130 DISALLOW_COPY_AND_ASSIGN(URLRequestPeer); | 133 DISALLOW_COPY_AND_ASSIGN(URLRequestPeer); |
| 131 }; | 134 }; |
| 132 | 135 |
| 133 } // namespace cronet | 136 } // namespace cronet |
| 134 | 137 |
| 135 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ | 138 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ |
| OLD | NEW |