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

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

Issue 2966283002: Remove the file thread dependency from FileNetLogObserver. (Closed)
Patch Set: init TaskScheduler on cronet Created 3 years, 5 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 b7aa07aaee65805142793d308678223118a50447..5c94e9f655ddcb3e34b252becca182a0a89ee67b 100644
--- a/components/cronet/android/cronet_library_loader.cc
+++ b/components/cronet/android/cronet_library_loader.cc
@@ -18,6 +18,7 @@
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/statistics_recorder.h"
+#include "base/task_scheduler/task_scheduler.h"
#include "components/cronet/android/cronet_bidirectional_stream_adapter.h"
#include "components/cronet/android/cronet_jni_registration.h"
#include "components/cronet/android/cronet_upload_data_stream_adapter.h"
@@ -67,6 +68,8 @@ bool RegisterJNI(JNIEnv* env) {
bool NativeInit() {
if (!base::android::OnJNIOnLoadInit())
return false;
+ base::TaskScheduler::CreateAndStartWithDefaultParams("Cronet");
mmenke 2017/07/06 01:50:01 I don't think we want to create another thread in
mmenke 2017/07/06 15:22:26 I think we'll need to talk about the Cronet folks
mef 2017/07/06 19:53:01 Good point. I didn't realize that base::TaskSched
+
url::Initialize();
// Initializes the statistics recorder system. This needs to be done before
// emitting histograms to prevent memory leaks (crbug.com/707836).
@@ -97,6 +100,9 @@ jint CronetOnLoad(JavaVM* vm, void* reserved) {
}
void CronetOnUnLoad(JavaVM* jvm, void* reserved) {
+ if (base::TaskScheduler::GetInstance())
+ base::TaskScheduler::GetInstance()->Shutdown();
+
base::android::LibraryLoaderExitHook();
}
« 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