 Chromium Code Reviews
 Chromium Code Reviews Issue 2643483003:
  [Remoting Android] Refactor ClientTelemetryLogger  (Closed)
    
  
    Issue 2643483003:
  [Remoting Android] Refactor ClientTelemetryLogger  (Closed) 
  | Index: remoting/client/jni/chromoting_jni_runtime.h | 
| diff --git a/remoting/client/jni/chromoting_jni_runtime.h b/remoting/client/jni/chromoting_jni_runtime.h | 
| index dca16318a6ef3abc1f02fb66923356a81dce174b..0a13b0df9378ce643e595b83a675cc3ffdc61c78 100644 | 
| --- a/remoting/client/jni/chromoting_jni_runtime.h | 
| +++ b/remoting/client/jni/chromoting_jni_runtime.h | 
| @@ -12,8 +12,8 @@ | 
| #include "base/macros.h" | 
| #include "net/url_request/url_request_context_getter.h" | 
| #include "remoting/base/auto_thread.h" | 
| +#include "remoting/base/telemetry_log_writer.h" | 
| #include "remoting/client/chromoting_client_runtime.h" | 
| -#include "remoting/client/client_telemetry_logger.h" | 
| #include "remoting/client/jni/chromoting_jni_instance.h" | 
| #include "remoting/protocol/connection_to_host.h" | 
| @@ -51,12 +51,11 @@ class ChromotingJniRuntime { | 
| return runtime_->url_requester(); | 
| } | 
| - // The runtime handles authentication and the caller should not call SetAuth*. | 
| // The runtime itself will not send out any logs. Used on the network thread. | 
| 
Sergey Ulanov
2017/01/19 00:50:38
Please explain in the comment how this is used.
 
Yuwei
2017/01/19 23:00:00
Done.
 | 
| - ClientTelemetryLogger* logger() { | 
| + base::WeakPtr<TelemetryLogWriter> log_writer() { | 
| 
Sergey Ulanov
2017/01/19 00:50:38
This should be called GetLogWriter(). Also please
 
Yuwei
2017/01/19 23:00:00
Done.
 | 
| DCHECK(runtime_->network_task_runner()->BelongsToCurrentThread()); | 
| - DCHECK(logger_); | 
| - return logger_.get(); | 
| + DCHECK(log_writer_); | 
| 
Sergey Ulanov
2017/01/19 00:50:38
don't need this DCHECK. operartor->() in unique_pt
 
Yuwei
2017/01/19 23:00:00
Done.
 | 
| + return log_writer_->GetWeakPtr(); | 
| } | 
| // Fetch OAuth token for the telemetry logger. Call on UI thread. | 
| @@ -87,7 +86,7 @@ class ChromotingJniRuntime { | 
| std::unique_ptr<ChromotingClientRuntime> runtime_; | 
| // For logging session stage changes and stats. | 
| - std::unique_ptr<ClientTelemetryLogger> logger_; | 
| + std::unique_ptr<TelemetryLogWriter> log_writer_; | 
| friend struct base::DefaultSingletonTraits<ChromotingJniRuntime>; |