| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 host->Send(new ViewMsg_SetWebKitSharedTimersSuspended(false)); | 76 host->Send(new ViewMsg_SetWebKitSharedTimersSuspended(false)); |
| 77 } | 77 } |
| 78 suspended_processes_.clear(); | 78 suspended_processes_.clear(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 void StopWatching(content::RenderProcessHost* host) { | 82 void StopWatching(content::RenderProcessHost* host) { |
| 83 std::vector<int>::iterator pos = std::find(suspended_processes_.begin(), | 83 std::vector<int>::iterator pos = std::find(suspended_processes_.begin(), |
| 84 suspended_processes_.end(), | 84 suspended_processes_.end(), |
| 85 host->GetID()); | 85 host->GetID()); |
| 86 DCHECK_NE(pos, suspended_processes_.end()); | 86 DCHECK(pos != suspended_processes_.end()); |
| 87 host->RemoveObserver(this); | 87 host->RemoveObserver(this); |
| 88 suspended_processes_.erase(pos); | 88 suspended_processes_.erase(pos); |
| 89 } | 89 } |
| 90 | 90 |
| 91 std::vector<int /* RenderProcessHost id */> suspended_processes_; | 91 std::vector<int /* RenderProcessHost id */> suspended_processes_; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 base::LazyInstance<SuspendedProcessWatcher> g_suspended_processes_watcher = | 94 base::LazyInstance<SuspendedProcessWatcher> g_suspended_processes_watcher = |
| 95 LAZY_INSTANCE_INITIALIZER; | 95 LAZY_INSTANCE_INITIALIZER; |
| 96 | 96 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 namespace content { | 118 namespace content { |
| 119 | 119 |
| 120 bool RegisterWebViewStatics(JNIEnv* env) { | 120 bool RegisterWebViewStatics(JNIEnv* env) { |
| 121 return RegisterNativesImpl(env); | 121 return RegisterNativesImpl(env); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace content | 124 } // namespace content |
| OLD | NEW |