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

Side by Side Diff: remoting/client/jni/chromoting_jni_runtime.cc

Issue 2679293002: Fix TaskScheduler initialization in remoting processes. (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "remoting/client/jni/chromoting_jni_runtime.h" 5 #include "remoting/client/jni/chromoting_jni_runtime.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/library_loader/library_loader_hooks.h" 10 #include "base/android/library_loader/library_loader_hooks.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 base::WaitableEvent::ResetPolicy::AUTOMATIC, 104 base::WaitableEvent::ResetPolicy::AUTOMATIC,
105 base::WaitableEvent::InitialState::NOT_SIGNALED); 105 base::WaitableEvent::InitialState::NOT_SIGNALED);
106 network_task_runner()->PostTask( 106 network_task_runner()->PostTask(
107 FROM_HERE, base::Bind(&ChromotingJniRuntime::DetachFromVmAndSignal, 107 FROM_HERE, base::Bind(&ChromotingJniRuntime::DetachFromVmAndSignal,
108 base::Unretained(this), &done_event)); 108 base::Unretained(this), &done_event));
109 done_event.Wait(); 109 done_event.Wait();
110 display_task_runner()->PostTask( 110 display_task_runner()->PostTask(
111 FROM_HERE, base::Bind(&ChromotingJniRuntime::DetachFromVmAndSignal, 111 FROM_HERE, base::Bind(&ChromotingJniRuntime::DetachFromVmAndSignal,
112 base::Unretained(this), &done_event)); 112 base::Unretained(this), &done_event));
113 done_event.Wait(); 113 done_event.Wait();
114
115 // Block until tasks blocking shutdown have completed their execution.
fdoray 2017/02/08 13:22:44 See https://cs.chromium.org/chromium/src/base/task
116 base::TaskScheduler::GetInstance()->Shutdown();
117
114 base::android::LibraryLoaderExitHook(); 118 base::android::LibraryLoaderExitHook();
115 base::android::DetachFromVM(); 119 base::android::DetachFromVM();
116 } 120 }
117 121
118 TelemetryLogWriter* ChromotingJniRuntime::GetLogWriter() { 122 TelemetryLogWriter* ChromotingJniRuntime::GetLogWriter() {
119 DCHECK(runtime_->network_task_runner()->BelongsToCurrentThread()); 123 DCHECK(runtime_->network_task_runner()->BelongsToCurrentThread());
120 return log_writer_.get(); 124 return log_writer_.get();
121 } 125 }
122 126
123 void ChromotingJniRuntime::FetchAuthToken() { 127 void ChromotingJniRuntime::FetchAuthToken() {
(...skipping 17 matching lines...) Expand all
141 DCHECK(network_task_runner()->BelongsToCurrentThread()); 145 DCHECK(network_task_runner()->BelongsToCurrentThread());
142 log_writer_.reset(new TelemetryLogWriter( 146 log_writer_.reset(new TelemetryLogWriter(
143 kTelemetryBaseUrl, 147 kTelemetryBaseUrl,
144 base::MakeUnique<ChromiumUrlRequestFactory>(runtime_->url_requester()))); 148 base::MakeUnique<ChromiumUrlRequestFactory>(runtime_->url_requester())));
145 log_writer_->SetAuthClosure( 149 log_writer_->SetAuthClosure(
146 base::Bind(&ChromotingJniRuntime::FetchAuthToken, 150 base::Bind(&ChromotingJniRuntime::FetchAuthToken,
147 base::Unretained(this))); 151 base::Unretained(this)));
148 } 152 }
149 153
150 } // namespace remoting 154 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698