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

Side by Side Diff: base/android/application_status_listener.cc

Issue 1473753002: Re-land "Add stats to distinguish android renderer crashes." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix per review. Created 5 years 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 "base/android/application_status_listener.h" 5 #include "base/android/application_status_listener.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/observer_list_threadsafe.h" 10 #include "base/observer_list_threadsafe.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return RegisterNativesImpl(env); 58 return RegisterNativesImpl(env);
59 } 59 }
60 60
61 // static 61 // static
62 void ApplicationStatusListener::NotifyApplicationStateChange( 62 void ApplicationStatusListener::NotifyApplicationStateChange(
63 ApplicationState state) { 63 ApplicationState state) {
64 g_observers.Get().Notify(FROM_HERE, &ApplicationStatusListener::Notify, 64 g_observers.Get().Notify(FROM_HERE, &ApplicationStatusListener::Notify,
65 state); 65 state);
66 } 66 }
67 67
68 // static
69 ApplicationState ApplicationStatusListener::GetState() {
70 return static_cast<ApplicationState>(
71 Java_ApplicationStatus_getStateForApplication(AttachCurrentThread()));
72 }
73
68 static void OnApplicationStateChange(JNIEnv* env, 74 static void OnApplicationStateChange(JNIEnv* env,
69 const JavaParamRef<jclass>& clazz, 75 const JavaParamRef<jclass>& clazz,
70 jint new_state) { 76 jint new_state) {
71 ApplicationState application_state = static_cast<ApplicationState>(new_state); 77 ApplicationState application_state = static_cast<ApplicationState>(new_state);
72 ApplicationStatusListener::NotifyApplicationStateChange(application_state); 78 ApplicationStatusListener::NotifyApplicationStateChange(application_state);
73 } 79 }
74 80
75 } // namespace android 81 } // namespace android
76 } // namespace base 82 } // namespace base
OLDNEW
« no previous file with comments | « base/android/application_status_listener.h ('k') | base/android/java/src/org/chromium/base/ApplicationStatus.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698