| 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_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 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 jobject jcaller) const; | 100 jobject jcaller) const; |
| 101 | 101 |
| 102 // Gets NPN or ALPN Negotiated Protocol (if any) from HttpResponseInfo. | 102 // Gets NPN or ALPN Negotiated Protocol (if any) from HttpResponseInfo. |
| 103 base::android::ScopedJavaLocalRef<jstring> GetNegotiatedProtocol( | 103 base::android::ScopedJavaLocalRef<jstring> GetNegotiatedProtocol( |
| 104 JNIEnv* env, | 104 JNIEnv* env, |
| 105 jobject jcaller) const; | 105 jobject jcaller) const; |
| 106 | 106 |
| 107 // Returns true if response is coming from the cache. | 107 // Returns true if response is coming from the cache. |
| 108 jboolean GetWasCached(JNIEnv* env, jobject jcaller) const; | 108 jboolean GetWasCached(JNIEnv* env, jobject jcaller) const; |
| 109 | 109 |
| 110 // Gets the total amount of body data received from network after | |
| 111 // SSL/SPDY/QUIC decoding and proxy handling. Basically the size of the body | |
| 112 // prior to decompression. | |
| 113 int64 GetTotalReceivedBytes(JNIEnv* env, jobject jcaller) const; | |
| 114 | |
| 115 // net::URLRequest::Delegate implementations: | 110 // net::URLRequest::Delegate implementations: |
| 116 | 111 |
| 117 void OnReceivedRedirect(net::URLRequest* request, | 112 void OnReceivedRedirect(net::URLRequest* request, |
| 118 const net::RedirectInfo& redirect_info, | 113 const net::RedirectInfo& redirect_info, |
| 119 bool* defer_redirect) override; | 114 bool* defer_redirect) override; |
| 120 void OnResponseStarted(net::URLRequest* request) override; | 115 void OnResponseStarted(net::URLRequest* request) override; |
| 121 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; | 116 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; |
| 122 | 117 |
| 123 private: | 118 private: |
| 124 class IOBufferWithByteBuffer; | 119 class IOBufferWithByteBuffer; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 148 | 143 |
| 149 scoped_refptr<IOBufferWithByteBuffer> read_buffer_; | 144 scoped_refptr<IOBufferWithByteBuffer> read_buffer_; |
| 150 scoped_ptr<net::URLRequest> url_request_; | 145 scoped_ptr<net::URLRequest> url_request_; |
| 151 | 146 |
| 152 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestAdapter); | 147 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestAdapter); |
| 153 }; | 148 }; |
| 154 | 149 |
| 155 } // namespace cronet | 150 } // namespace cronet |
| 156 | 151 |
| 157 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ | 152 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ |
| OLD | NEW |