OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/jni_android.h" | 5 #include "base/android/jni_android.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/atomicops.h" | 9 #include "base/atomicops.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 return true; | 33 return true; |
34 } else if (r > 0) { | 34 } else if (r > 0) { |
35 return false; | 35 return false; |
36 } | 36 } |
37 | 37 |
38 return strcmp(jni_signature, other.jni_signature) < 0; | 38 return strcmp(jni_signature, other.jni_signature) < 0; |
39 } | 39 } |
40 }; | 40 }; |
41 | 41 |
42 typedef std::map<MethodIdentifier, jmethodID> MethodIDMap; | 42 typedef std::map<MethodIdentifier, jmethodID> MethodIDMap; |
43 base::LazyInstance<MethodIDMap, base::LeakyLazyInstanceTraits<MethodIDMap> > | 43 base::LazyInstance<MethodIDMap>::Leaky |
44 g_method_id_map = LAZY_INSTANCE_INITIALIZER; | 44 g_method_id_map = LAZY_INSTANCE_INITIALIZER; |
45 const base::subtle::AtomicWord kUnlocked = 0; | 45 const base::subtle::AtomicWord kUnlocked = 0; |
46 const base::subtle::AtomicWord kLocked = 1; | 46 const base::subtle::AtomicWord kLocked = 1; |
47 base::subtle::AtomicWord g_method_id_map_lock = kUnlocked; | 47 base::subtle::AtomicWord g_method_id_map_lock = kUnlocked; |
48 | 48 |
49 } | 49 } |
50 | 50 |
51 namespace base { | 51 namespace base { |
52 namespace android { | 52 namespace android { |
53 | 53 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 bool CheckException(JNIEnv* env) { | 160 bool CheckException(JNIEnv* env) { |
161 if (env->ExceptionCheck() == JNI_FALSE) | 161 if (env->ExceptionCheck() == JNI_FALSE) |
162 return false; | 162 return false; |
163 env->ExceptionDescribe(); | 163 env->ExceptionDescribe(); |
164 env->ExceptionClear(); | 164 env->ExceptionClear(); |
165 return true; | 165 return true; |
166 } | 166 } |
167 | 167 |
168 } // namespace android | 168 } // namespace android |
169 } // namespace base | 169 } // namespace base |
OLD | NEW |