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

Unified Diff: remoting/client/jni/chromoting_jni_runtime.cc

Issue 2643483003: [Remoting Android] Refactor ClientTelemetryLogger (Closed)
Patch Set: PTAL Created 3 years, 11 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: remoting/client/jni/chromoting_jni_runtime.cc
diff --git a/remoting/client/jni/chromoting_jni_runtime.cc b/remoting/client/jni/chromoting_jni_runtime.cc
index 4ebbaf6dd3524fcaa9bc0d073674026ea157fb7c..ef97d4913f9677372b07ec439a7273446882ca73 100644
--- a/remoting/client/jni/chromoting_jni_runtime.cc
+++ b/remoting/client/jni/chromoting_jni_runtime.cc
@@ -49,7 +49,7 @@ static void LoadNative(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
static void HandleAuthTokenOnNetworkThread(const std::string& token) {
ChromotingJniRuntime* runtime = remoting::ChromotingJniRuntime::GetInstance();
DCHECK(runtime->network_task_runner()->BelongsToCurrentThread());
- runtime->logger()->SetAuthToken(token);
+ runtime->log_writer()->SetAuthToken(token);
}
static void OnAuthTokenFetched(JNIEnv* env,
@@ -129,11 +129,10 @@ void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) {
void ChromotingJniRuntime::StartLoggerOnNetworkThread() {
DCHECK(network_task_runner()->BelongsToCurrentThread());
- logger_.reset(new ClientTelemetryLogger(ChromotingEvent::Mode::ME2ME));
- logger_->Start(
- base::MakeUnique<ChromiumUrlRequestFactory>(runtime_->url_requester()),
- kTelemetryBaseUrl);
- logger_->SetAuthClosure(
+ log_writer_.reset(new TelemetryLogWriter(
+ kTelemetryBaseUrl,
+ base::MakeUnique<ChromiumUrlRequestFactory>(runtime_->url_requester())));
+ log_writer_->SetAuthClosure(
base::Bind(&ChromotingJniRuntime::FetchAuthToken,
base::Unretained(this)));
}

Powered by Google App Engine
This is Rietveld 408576698