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

Unified Diff: components/cronet/android/cronet_bidirectional_stream_adapter.h

Issue 2360813003: [Cronet] Pass metrics information from C++ BidirectionalStream to Java (Closed)
Patch Set: Rebased Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/cronet_bidirectional_stream_adapter.h
diff --git a/components/cronet/android/cronet_bidirectional_stream_adapter.h b/components/cronet/android/cronet_bidirectional_stream_adapter.h
index 5a98a4a40c6c35bd38adae22d5335d05667a8501..53ce0c9d5d2a19fc161715239421a748f2763fa9 100644
--- a/components/cronet/android/cronet_bidirectional_stream_adapter.h
+++ b/components/cronet/android/cronet_bidirectional_stream_adapter.h
@@ -71,7 +71,8 @@ class CronetBidirectionalStreamAdapter
CronetURLRequestContextAdapter* context,
JNIEnv* env,
const base::android::JavaParamRef<jobject>& jbidi_stream,
- bool jsend_request_headers_automatically);
+ bool jsend_request_headers_automatically,
+ bool enable_metrics);
~CronetBidirectionalStreamAdapter() override;
// Validates method and headers, initializes and starts the request. If
@@ -154,12 +155,15 @@ class CronetBidirectionalStreamAdapter
base::android::ScopedJavaLocalRef<jobjectArray> GetHeadersArray(
JNIEnv* env,
const net::SpdyHeaderBlock& header_block);
-
+ // Helper method to report metrics to the Java layer.
+ void MaybeReportMetrics();
CronetURLRequestContextAdapter* const context_;
// Java object that owns this CronetBidirectionalStreamAdapter.
base::android::ScopedJavaGlobalRef<jobject> owner_;
const bool send_request_headers_automatically_;
+ // Whether metrics collection is enabled when |this| is created.
+ const bool enable_metrics_;
scoped_refptr<IOBufferWithByteBuffer> read_buffer_;
std::unique_ptr<PendingWriteData> pending_write_data_;
« no previous file with comments | « components/cronet/android/BUILD.gn ('k') | components/cronet/android/cronet_bidirectional_stream_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698