OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/android/process_utils.h" | 5 #include "chrome/browser/android/process_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "chrome/common/render_messages.h" | 11 #include "chrome/common/render_messages.h" |
12 #include "content/public/browser/render_process_host.h" | 12 #include "content/public/browser/render_process_host.h" |
13 #include "jni/process_utils_jni.h" | 13 #include "jni/ProcessUtils_jni.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // Only accessed from the JNI thread by ToggleWebKitSharedTimers() which is | 17 // Only accessed from the JNI thread by ToggleWebKitSharedTimers() which is |
18 // implemented below. | 18 // implemented below. |
19 base::LazyInstance<std::vector<int /* process id */> > g_suspended_processes = | 19 base::LazyInstance<std::vector<int /* process id */> > g_suspended_processes = |
20 LAZY_INSTANCE_INITIALIZER; | 20 LAZY_INSTANCE_INITIALIZER; |
21 | 21 |
22 // Suspends timers in all current render processes. | 22 // Suspends timers in all current render processes. |
23 void SuspendWebKitSharedTimers(std::vector<int>* suspended_processes) { | 23 void SuspendWebKitSharedTimers(std::vector<int>* suspended_processes) { |
(...skipping 27 matching lines...) Expand all Loading... |
51 } else { | 51 } else { |
52 ResumeWebkitSharedTimers(*suspended_processes); | 52 ResumeWebkitSharedTimers(*suspended_processes); |
53 suspended_processes->clear(); | 53 suspended_processes->clear(); |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 // TODO(pliard): http://crbug.com/137674 | 57 // TODO(pliard): http://crbug.com/137674 |
58 bool RegisterProcessUtils(JNIEnv* env) { | 58 bool RegisterProcessUtils(JNIEnv* env) { |
59 return RegisterNativesImpl(env); | 59 return RegisterNativesImpl(env); |
60 } | 60 } |
OLD | NEW |