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

Side by Side Diff: chrome/browser/metrics/thread_watcher_android.cc

Issue 188003002: [Android] Fix compilation error: unused variable 'kAllowedToAccessOnNonjoinableThread' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | content/child/child_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/metrics/thread_watcher_android.h" 5 #include "chrome/browser/metrics/thread_watcher_android.h"
6 6
7 #include "base/android/application_status_listener.h" 7 #include "base/android/application_status_listener.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "chrome/browser/metrics/thread_watcher.h" 10 #include "chrome/browser/metrics/thread_watcher.h"
(...skipping 21 matching lines...) Expand all
32 } else if (application_state == 32 } else if (application_state ==
33 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES && 33 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES &&
34 g_application_has_stopped) { 34 g_application_has_stopped) {
35 g_application_has_stopped = false; 35 g_application_has_stopped = false;
36 ThreadWatcherList::StartWatchingAll(*CommandLine::ForCurrentProcess()); 36 ThreadWatcherList::StartWatchingAll(*CommandLine::ForCurrentProcess());
37 } 37 }
38 } 38 }
39 39
40 struct LeakyApplicationStatusListenerTraits { 40 struct LeakyApplicationStatusListenerTraits {
41 static const bool kRegisterOnExit = false; 41 static const bool kRegisterOnExit = false;
42 #ifndef NDEBUG
42 static const bool kAllowedToAccessOnNonjoinableThread = true; 43 static const bool kAllowedToAccessOnNonjoinableThread = true;
44 #endif
43 45
44 static base::android::ApplicationStatusListener* New(void* instance) { 46 static base::android::ApplicationStatusListener* New(void* instance) {
45 ANNOTATE_SCOPED_MEMORY_LEAK; 47 ANNOTATE_SCOPED_MEMORY_LEAK;
46 return new (instance) base::android::ApplicationStatusListener( 48 return new (instance) base::android::ApplicationStatusListener(
47 base::Bind(&OnApplicationStateChange)); 49 base::Bind(&OnApplicationStateChange));
48 } 50 }
49 51
50 static void Delete(base::android::ApplicationStatusListener* instance) { 52 static void Delete(base::android::ApplicationStatusListener* instance) {
51 } 53 }
52 }; 54 };
53 55
54 base::LazyInstance<base::android::ApplicationStatusListener, 56 base::LazyInstance<base::android::ApplicationStatusListener,
55 LeakyApplicationStatusListenerTraits> 57 LeakyApplicationStatusListenerTraits>
56 g_application_status_listener = LAZY_INSTANCE_INITIALIZER; 58 g_application_status_listener = LAZY_INSTANCE_INITIALIZER;
57 59
58 } // namespace 60 } // namespace
59 61
60 void ThreadWatcherAndroid::RegisterApplicationStatusListener() { 62 void ThreadWatcherAndroid::RegisterApplicationStatusListener() {
61 // Leaky. 63 // Leaky.
62 g_application_status_listener.Get(); 64 g_application_status_listener.Get();
63 } 65 }
OLDNEW
« no previous file with comments | « no previous file | content/child/child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698