Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: components/cronet/android/url_request_peer.h

Issue 268353013: Upstream changes to HttpUrlRequest for querying response headers and closing ReadableByteChannel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comment. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « components/cronet/android/org_chromium_net_UrlRequest.cc ('k') | components/cronet/android/url_request_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698