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

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

Issue 2844803002: [Cronet] Make metrics reporting happen after terminal callbacks. (Closed)
Patch Set: address comments Created 3 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
« no previous file with comments | « no previous file | components/cronet/android/cronet_url_request_adapter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void GetStatusOnNetworkThread( 125 void GetStatusOnNetworkThread(
126 const base::android::ScopedJavaGlobalRef<jobject>& jstatus_listener_ref) 126 const base::android::ScopedJavaGlobalRef<jobject>& jstatus_listener_ref)
127 const; 127 const;
128 // Gets response headers on network thread. 128 // Gets response headers on network thread.
129 base::android::ScopedJavaLocalRef<jobjectArray> GetResponseHeaders( 129 base::android::ScopedJavaLocalRef<jobjectArray> GetResponseHeaders(
130 JNIEnv* env); 130 JNIEnv* env);
131 void FollowDeferredRedirectOnNetworkThread(); 131 void FollowDeferredRedirectOnNetworkThread();
132 void ReadDataOnNetworkThread( 132 void ReadDataOnNetworkThread(
133 scoped_refptr<IOBufferWithByteBuffer> read_buffer, 133 scoped_refptr<IOBufferWithByteBuffer> read_buffer,
134 int buffer_size); 134 int buffer_size);
135 void DestroyOnNetworkThread(bool send_on_canceled); 135 void DestroyOnNetworkThread(bool jsend_on_canceled);
136 136
137 // Report error and cancel request_adapter. 137 // Report error and cancel request_adapter.
138 void ReportError(net::URLRequest* request, int net_error); 138 void ReportError(net::URLRequest* request, int net_error);
139 // Reports metrics collected to the Java layer 139 // Reports metrics collected to the Java layer
140 void MaybeReportMetrics(JNIEnv* env) const; 140 void MaybeReportMetrics(JNIEnv* env);
141 141
142 CronetURLRequestContextAdapter* context_; 142 CronetURLRequestContextAdapter* context_;
143 143
144 // Java object that owns this CronetURLRequestContextAdapter. 144 // Java object that owns this CronetURLRequestContextAdapter.
145 base::android::ScopedJavaGlobalRef<jobject> owner_; 145 base::android::ScopedJavaGlobalRef<jobject> owner_;
146 146
147 const GURL initial_url_; 147 const GURL initial_url_;
148 const net::RequestPriority initial_priority_; 148 const net::RequestPriority initial_priority_;
149 std::string initial_method_; 149 std::string initial_method_;
150 int load_flags_; 150 int load_flags_;
151 net::HttpRequestHeaders initial_request_headers_; 151 net::HttpRequestHeaders initial_request_headers_;
152 std::unique_ptr<net::UploadDataStream> upload_; 152 std::unique_ptr<net::UploadDataStream> upload_;
153 153
154 scoped_refptr<IOBufferWithByteBuffer> read_buffer_; 154 scoped_refptr<IOBufferWithByteBuffer> read_buffer_;
155 std::unique_ptr<net::URLRequest> url_request_; 155 std::unique_ptr<net::URLRequest> url_request_;
156 156
157 // Whether detailed metrics should be collected and reported to Java for this 157 // Whether detailed metrics should be collected and reported to Java.
158 // request.
159 const bool enable_metrics_; 158 const bool enable_metrics_;
159 // Whether metrics have been reported to Java.
160 bool metrics_reported_;
160 161
161 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestAdapter); 162 DISALLOW_COPY_AND_ASSIGN(CronetURLRequestAdapter);
162 }; 163 };
163 164
164 } // namespace cronet 165 } // namespace cronet
165 166
166 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_ 167 #endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_ADAPTER_H_
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/cronet_url_request_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698