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" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "content/browser/android/content_view_statics.h" | 14 #include "content/browser/android/content_view_statics.h" |
15 #include "content/common/android/address_parser.h" | 15 #include "content/common/android/address_parser.h" |
16 #include "content/common/view_messages.h" | 16 #include "content/common/view_messages.h" |
17 #include "content/public/browser/render_process_host.h" | 17 #include "content/public/browser/render_process_host.h" |
18 #include "jni/ContentViewStatics_jni.h" | 18 #include "jni/ContentViewStatics_jni.h" |
19 | 19 |
20 using base::android::ConvertJavaStringToUTF16; | 20 using base::android::ConvertJavaStringToUTF16; |
21 using base::android::ConvertUTF16ToJavaString; | 21 using base::android::ConvertUTF16ToJavaString; |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 // TODO(pliard): http://crbug.com/235909. Move WebKit shared timer toggling | 25 // TODO(pliard): http://crbug.com/235909. Move WebKit shared timer toggling |
26 // functionality out of ContentViewStatistics and not be build on top of | 26 // functionality out of ContentViewStatistics and not be build on top of |
27 // WebKit::Platform::SuspendSharedTimer. | 27 // blink::Platform::SuspendSharedTimer. |
28 // TODO(pliard): http://crbug.com/235912. Add unit tests for WebKit shared timer | 28 // TODO(pliard): http://crbug.com/235912. Add unit tests for WebKit shared timer |
29 // toggling. | 29 // toggling. |
30 | 30 |
31 // This tracks the renderer processes that received a suspend request. It's | 31 // This tracks the renderer processes that received a suspend request. It's |
32 // important on resume to only resume the renderer processes that were actually | 32 // important on resume to only resume the renderer processes that were actually |
33 // suspended as opposed to all the current renderer processes because the | 33 // suspended as opposed to all the current renderer processes because the |
34 // suspend calls are refcounted within WebKitPlatformSupport and it expects a | 34 // suspend calls are refcounted within WebKitPlatformSupport and it expects a |
35 // perfectly matched number of resume calls. | 35 // perfectly matched number of resume calls. |
36 // Note that this vector is only accessed from the UI thread. | 36 // Note that this vector is only accessed from the UI thread. |
37 base::LazyInstance<std::vector<int /* process id */> > g_suspended_processes = | 37 base::LazyInstance<std::vector<int /* process id */> > g_suspended_processes = |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 namespace content { | 85 namespace content { |
86 | 86 |
87 bool RegisterWebViewStatics(JNIEnv* env) { | 87 bool RegisterWebViewStatics(JNIEnv* env) { |
88 return RegisterNativesImpl(env) >= 0; | 88 return RegisterNativesImpl(env) >= 0; |
89 } | 89 } |
90 | 90 |
91 } // namespace content | 91 } // namespace content |
OLD | NEW |