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 <jni.h> | 5 #include <jni.h> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // perfectly matched number of resume calls. | 36 // perfectly matched number of resume calls. |
37 // Note that this class is only accessed from the UI thread. | 37 // Note that this class is only accessed from the UI thread. |
38 class SuspendedProcessWatcher : public content::RenderProcessHostObserver { | 38 class SuspendedProcessWatcher : public content::RenderProcessHostObserver { |
39 public: | 39 public: |
40 | 40 |
41 // If the process crashes, stop watching the corresponding RenderProcessHost | 41 // If the process crashes, stop watching the corresponding RenderProcessHost |
42 // and ensure it doesn't get over-resumed. | 42 // and ensure it doesn't get over-resumed. |
43 virtual void RenderProcessExited(content::RenderProcessHost* host, | 43 virtual void RenderProcessExited(content::RenderProcessHost* host, |
44 base::ProcessHandle handle, | 44 base::ProcessHandle handle, |
45 base::TerminationStatus status, | 45 base::TerminationStatus status, |
46 int exit_code) OVERRIDE { | 46 int exit_code) override { |
47 StopWatching(host); | 47 StopWatching(host); |
48 } | 48 } |
49 | 49 |
50 virtual void RenderProcessHostDestroyed( | 50 virtual void RenderProcessHostDestroyed( |
51 content::RenderProcessHost* host) OVERRIDE { | 51 content::RenderProcessHost* host) override { |
52 StopWatching(host); | 52 StopWatching(host); |
53 } | 53 } |
54 | 54 |
55 // Suspends timers in all current render processes. | 55 // Suspends timers in all current render processes. |
56 void SuspendWebKitSharedTimers() { | 56 void SuspendWebKitSharedTimers() { |
57 DCHECK(suspended_processes_.empty()); | 57 DCHECK(suspended_processes_.empty()); |
58 | 58 |
59 for (content::RenderProcessHost::iterator i( | 59 for (content::RenderProcessHost::iterator i( |
60 content::RenderProcessHost::AllHostsIterator()); | 60 content::RenderProcessHost::AllHostsIterator()); |
61 !i.IsAtEnd(); i.Advance()) { | 61 !i.IsAtEnd(); i.Advance()) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 namespace content { | 119 namespace content { |
120 | 120 |
121 bool RegisterWebViewStatics(JNIEnv* env) { | 121 bool RegisterWebViewStatics(JNIEnv* env) { |
122 return RegisterNativesImpl(env); | 122 return RegisterNativesImpl(env); |
123 } | 123 } |
124 | 124 |
125 } // namespace content | 125 } // namespace content |
OLD | NEW |