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

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

Issue 2406273002: [Cronet] Test the libcronet that's shipped, not libcronet_test (Closed)
Patch Set: fix shutdown race Created 4 years, 1 month 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
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_CRONET_URL_REQUEST_ADAPTER_H_ 5 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_
6 #define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ 6 #define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 21 matching lines...) Expand all
32 class HttpResponseHeaders; 32 class HttpResponseHeaders;
33 class SSLCertRequestInfo; 33 class SSLCertRequestInfo;
34 class SSLInfo; 34 class SSLInfo;
35 class UploadDataStream; 35 class UploadDataStream;
36 } // namespace net 36 } // namespace net
37 37
38 namespace cronet { 38 namespace cronet {
39 39
40 class CronetURLRequestContextAdapter; 40 class CronetURLRequestContextAdapter;
41 class IOBufferWithByteBuffer; 41 class IOBufferWithByteBuffer;
42 class TestUtil;
42 43
43 bool CronetUrlRequestAdapterRegisterJni(JNIEnv* env); 44 bool CronetUrlRequestAdapterRegisterJni(JNIEnv* env);
44 45
45 // An adapter from Java CronetUrlRequest object to net::URLRequest. 46 // An adapter from Java CronetUrlRequest object to net::URLRequest.
46 // Created and configured from a Java thread. Start, ReadData, and Destroy are 47 // Created and configured from a Java thread. Start, ReadData, and Destroy are
47 // posted to network thread and all callbacks into the Java CronetUrlRequest are 48 // posted to network thread and all callbacks into the Java CronetUrlRequest are
48 // done on the network thread. Java CronetUrlRequest is expected to initiate the 49 // done on the network thread. Java CronetUrlRequest is expected to initiate the
49 // next step like FollowDeferredRedirect, ReadData or Destroy. Public methods 50 // next step like FollowDeferredRedirect, ReadData or Destroy. Public methods
50 // can be called on any thread. 51 // can be called on any thread.
51 class CronetURLRequestAdapter : public net::URLRequest::Delegate { 52 class CronetURLRequestAdapter : public net::URLRequest::Delegate {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 bool* defer_redirect) override; 116 bool* defer_redirect) override;
116 void OnCertificateRequested( 117 void OnCertificateRequested(
117 net::URLRequest* request, 118 net::URLRequest* request,
118 net::SSLCertRequestInfo* cert_request_info) override; 119 net::SSLCertRequestInfo* cert_request_info) override;
119 void OnSSLCertificateError(net::URLRequest* request, 120 void OnSSLCertificateError(net::URLRequest* request,
120 const net::SSLInfo& ssl_info, 121 const net::SSLInfo& ssl_info,
121 bool fatal) override; 122 bool fatal) override;
122 void OnResponseStarted(net::URLRequest* request, int net_error) override; 123 void OnResponseStarted(net::URLRequest* request, int net_error) override;
123 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; 124 void OnReadCompleted(net::URLRequest* request, int bytes_read) override;
124 125
125 net::URLRequest* GetURLRequestForTesting(); 126 private:
127 friend class TestUtil;
126 128
127 private:
128 void StartOnNetworkThread(); 129 void StartOnNetworkThread();
129 void GetStatusOnNetworkThread( 130 void GetStatusOnNetworkThread(
130 const base::android::ScopedJavaGlobalRef<jobject>& jstatus_listener_ref) 131 const base::android::ScopedJavaGlobalRef<jobject>& jstatus_listener_ref)
131 const; 132 const;
132 // Gets response headers on network thread. 133 // Gets response headers on network thread.
133 base::android::ScopedJavaLocalRef<jobjectArray> GetResponseHeaders( 134 base::android::ScopedJavaLocalRef<jobjectArray> GetResponseHeaders(
134 JNIEnv* env); 135 JNIEnv* env);
135 void FollowDeferredRedirectOnNetworkThread(); 136 void FollowDeferredRedirectOnNetworkThread();
136 void ReadDataOnNetworkThread( 137 void ReadDataOnNetworkThread(
137 scoped_refptr<IOBufferWithByteBuffer> read_buffer, 138 scoped_refptr<IOBufferWithByteBuffer> read_buffer,
(...skipping 23 matching lines...) Expand all
161 // Whether detailed metrics should be collected and reported to Java for this 162 // Whether detailed metrics should be collected and reported to Java for this
162 // request. 163 // request.
163 const bool enable_metrics_; 164 const bool enable_metrics_;
164 165
165 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestAdapter); 166 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestAdapter);
166 }; 167 };
167 168
168 } // namespace cronet 169 } // namespace cronet
169 170
170 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ 171 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_
OLDNEW
« no previous file with comments | « components/cronet/android/BUILD.gn ('k') | components/cronet/android/cronet_url_request_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698