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

Unified Diff: components/cronet/android/cronet_library_loader.cc

Issue 2790063004: [Cronet] Initialize StatisticsRecorder early (Closed)
Patch Set: Address pauljensen comment Created 3 years, 8 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
« no previous file with comments | « no previous file | components/cronet/android/cronet_url_request_context_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/android/cronet_library_loader.cc
diff --git a/components/cronet/android/cronet_library_loader.cc b/components/cronet/android/cronet_library_loader.cc
index 6d4d11730c8c0cd7adb5e4f8711007a5841d9e15..e4d6b1a2819618ce7fd89c465100e348d17a251a 100644
--- a/components/cronet/android/cronet_library_loader.cc
+++ b/components/cronet/android/cronet_library_loader.cc
@@ -18,6 +18,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/statistics_recorder.h"
#include "components/cronet/android/cronet_bidirectional_stream_adapter.h"
#include "components/cronet/android/cronet_upload_data_stream_adapter.h"
#include "components/cronet/android/cronet_url_request_adapter.h"
@@ -67,6 +68,9 @@ bool NativeInit() {
if (!base::android::OnJNIOnLoadInit())
return false;
url::Initialize();
+ // Initializes the statistics recorder system. This needs to be done before
+ // emitting histograms to prevent memory leaks (crbug.com/707836).
+ base::StatisticsRecorder::Initialize();
return true;
}
« no previous file with comments | « no previous file | components/cronet/android/cronet_url_request_context_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698