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

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

Issue 877993003: Pass FROM_HERE to ObserverListThreadSafe::Notify to improve profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | base/memory/memory_pressure_listener.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 "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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 // static 55 // static
56 bool ApplicationStatusListener::RegisterBindings(JNIEnv* env) { 56 bool ApplicationStatusListener::RegisterBindings(JNIEnv* env) {
57 return RegisterNativesImpl(env); 57 return RegisterNativesImpl(env);
58 } 58 }
59 59
60 // static 60 // static
61 void ApplicationStatusListener::NotifyApplicationStateChange( 61 void ApplicationStatusListener::NotifyApplicationStateChange(
62 ApplicationState state) { 62 ApplicationState state) {
63 g_observers.Get().Notify(&ApplicationStatusListener::Notify, state); 63 g_observers.Get().Notify(FROM_HERE, &ApplicationStatusListener::Notify,
64 state);
64 } 65 }
65 66
66 static void OnApplicationStateChange(JNIEnv* env, 67 static void OnApplicationStateChange(JNIEnv* env,
67 jclass clazz, 68 jclass clazz,
68 jint new_state) { 69 jint new_state) {
69 ApplicationState application_state = static_cast<ApplicationState>(new_state); 70 ApplicationState application_state = static_cast<ApplicationState>(new_state);
70 ApplicationStatusListener::NotifyApplicationStateChange(application_state); 71 ApplicationStatusListener::NotifyApplicationStateChange(application_state);
71 } 72 }
72 73
73 } // namespace android 74 } // namespace android
74 } // namespace base 75 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/memory/memory_pressure_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698