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

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

Issue 423163007: Add method getAllHeaders to HttpUrlRequest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 6 years, 4 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 <jni.h> 8 #include <jni.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "net/base/request_priority.h" 15 #include "net/base/request_priority.h"
16 #include "net/http/http_request_headers.h" 16 #include "net/http/http_request_headers.h"
17 #include "net/url_request/url_request.h" 17 #include "net/url_request/url_request.h"
18 18
19 namespace net { 19 namespace net {
20 class GrowableIOBuffer; 20 class GrowableIOBuffer;
21 class HttpResponseHeaders;
21 class UploadDataStream; 22 class UploadDataStream;
22 } // namespace net 23 } // namespace net
23 24
24 namespace cronet { 25 namespace cronet {
25 26
26 class URLRequestContextPeer; 27 class URLRequestContextPeer;
27 28
28 // An adapter from the JNI |UrlRequest| object and the Chromium |URLRequest| 29 // An adapter from the JNI |UrlRequest| object and the Chromium |URLRequest|
29 // object. 30 // object.
30 class URLRequestPeer : public net::URLRequest::Delegate { 31 class URLRequestPeer : public net::URLRequest::Delegate {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 84
84 // Returns the value of the content-length response header. 85 // Returns the value of the content-length response header.
85 int64 content_length() const { return expected_size_; } 86 int64 content_length() const { return expected_size_; }
86 87
87 // Returns the value of the content-type response header. 88 // Returns the value of the content-type response header.
88 std::string content_type() const { return content_type_; } 89 std::string content_type() const { return content_type_; }
89 90
90 // Returns the value of the specified response header. 91 // Returns the value of the specified response header.
91 std::string GetHeader(const std::string& name) const; 92 std::string GetHeader(const std::string& name) const;
92 93
94 // Get all response headers, as a HttpResponseHeaders object.
95 net::HttpResponseHeaders* GetResponseHeaders() const;
96
93 // Returns the overall number of bytes read. 97 // Returns the overall number of bytes read.
94 size_t bytes_read() const { return bytes_read_; } 98 size_t bytes_read() const { return bytes_read_; }
95 99
96 // Returns a pointer to the downloaded data. 100 // Returns a pointer to the downloaded data.
97 unsigned char* Data() const; 101 unsigned char* Data() const;
98 102
99 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; 103 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE;
100 104
101 virtual void OnReadCompleted(net::URLRequest* request, 105 virtual void OnReadCompleted(net::URLRequest* request,
102 int bytes_read) OVERRIDE; 106 int bytes_read) OVERRIDE;
(...skipping 28 matching lines...) Expand all
131 std::string content_type_; 135 std::string content_type_;
132 bool canceled_; 136 bool canceled_;
133 int64 expected_size_; 137 int64 expected_size_;
134 138
135 DISALLOW_COPY_AND_ASSIGN(URLRequestPeer); 139 DISALLOW_COPY_AND_ASSIGN(URLRequestPeer);
136 }; 140 };
137 141
138 } // namespace cronet 142 } // namespace cronet
139 143
140 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ 144 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698