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 NET_CRONET_ANDROID_URL_REQUEST_PEER_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ |
6 #define NET_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" |
| 11 #include "components/cronet/android/url_request_context_peer.h" |
11 #include "net/base/request_priority.h" | 12 #include "net/base/request_priority.h" |
12 #include "net/base/upload_data_stream.h" | 13 #include "net/base/upload_data_stream.h" |
13 #include "net/cronet/android/url_request_context_peer.h" | |
14 #include "net/http/http_request_headers.h" | 14 #include "net/http/http_request_headers.h" |
15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
16 | 16 |
17 // An adapter from the JNI |UrlRequest| object and the Chromium |URLRequest| | 17 // An adapter from the JNI |UrlRequest| object and the Chromium |URLRequest| |
18 // object. | 18 // object. |
19 class URLRequestPeer : public net::URLRequest::Delegate { | 19 class URLRequestPeer : public net::URLRequest::Delegate { |
20 public: | 20 public: |
21 // The delegate which is called when the request finishes. | 21 // The delegate which is called when the request finishes. |
22 class URLRequestPeerDelegate | 22 class URLRequestPeerDelegate |
23 : public base::RefCountedThreadSafe<URLRequestPeerDelegate> { | 23 : public base::RefCountedThreadSafe<URLRequestPeerDelegate> { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void OnRequestCompleted(); | 127 void OnRequestCompleted(); |
128 void OnRequestCanceled(); | 128 void OnRequestCanceled(); |
129 void OnBytesRead(int bytes_read); | 129 void OnBytesRead(int bytes_read); |
130 void OnAppendChunk(const char* bytes, int bytes_len, bool is_last_chunk); | 130 void OnAppendChunk(const char* bytes, int bytes_len, bool is_last_chunk); |
131 | 131 |
132 void Read(); | 132 void Read(); |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(URLRequestPeer); | 134 DISALLOW_COPY_AND_ASSIGN(URLRequestPeer); |
135 }; | 135 }; |
136 | 136 |
137 #endif // NET_CRONET_ANDROID_URL_REQUEST_PEER_H_ | 137 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_PEER_H_ |
OLD | NEW |