Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: base/android/jni_android.cc

Issue 9192024: Add a convenience typedef LazyInstance<T>::Leaky to avoid repeating T. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/debug/trace_event.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | base/debug/trace_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698