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

Side by Side Diff: chromecast/base/chromecast_config_android.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/base/chromecast_config_android.h" 5 #include "chromecast/base/chromecast_config_android.h"
6 6
7 #include "base/android/context_utils.h" 7 #include "base/android/context_utils.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "jni/ChromecastConfigAndroid_jni.h" 10 #include "jni/ChromecastConfigAndroid_jni.h"
11 11
12 using base::android::JavaParamRef; 12 using base::android::JavaParamRef;
13 13
14 namespace chromecast { 14 namespace chromecast {
15 namespace android { 15 namespace android {
16 16
17 namespace { 17 namespace {
18 base::LazyInstance<ChromecastConfigAndroid> g_instance = 18 base::LazyInstance<ChromecastConfigAndroid>::DestructorAtExit g_instance =
19 LAZY_INSTANCE_INITIALIZER; 19 LAZY_INSTANCE_INITIALIZER;
20 } // namespace 20 } // namespace
21 21
22 // static 22 // static
23 ChromecastConfigAndroid* ChromecastConfigAndroid::GetInstance() { 23 ChromecastConfigAndroid* ChromecastConfigAndroid::GetInstance() {
24 return g_instance.Pointer(); 24 return g_instance.Pointer();
25 } 25 }
26 26
27 // static 27 // static
28 bool ChromecastConfigAndroid::RegisterJni(JNIEnv* env) { 28 bool ChromecastConfigAndroid::RegisterJni(JNIEnv* env) {
(...skipping 23 matching lines...) Expand all
52 // Called from Java. 52 // Called from Java.
53 void SetSendUsageStatsEnabled(JNIEnv* env, 53 void SetSendUsageStatsEnabled(JNIEnv* env,
54 const JavaParamRef<jclass>& caller, 54 const JavaParamRef<jclass>& caller,
55 jboolean enabled) { 55 jboolean enabled) {
56 ChromecastConfigAndroid::GetInstance()-> 56 ChromecastConfigAndroid::GetInstance()->
57 send_usage_stats_changed_callback().Run(enabled); 57 send_usage_stats_changed_callback().Run(enabled);
58 } 58 }
59 59
60 } // namespace android 60 } // namespace android
61 } // namespace chromecast 61 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/base/chromecast_config_android.h ('k') | chromecast/base/metrics/grouped_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698