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

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

Issue 9264014: Upstream the clipboard implementation for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another clean-up 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
OLDNEW
1 // Copyright (c) 2011 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 "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"
11 #include "base/logging.h" 11 #include "base/logging.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 jfieldID GetFieldID(JNIEnv* env, 150 jfieldID GetFieldID(JNIEnv* env,
151 jclass clazz, 151 jclass clazz,
152 const char* field, 152 const char* field,
153 const char* jni_signature) { 153 const char* jni_signature) {
154 jfieldID id = env->GetFieldID(clazz, field, jni_signature); 154 jfieldID id = env->GetFieldID(clazz, field, jni_signature);
155 DCHECK(id) << field; 155 DCHECK(id) << field;
156 CheckException(env); 156 CheckException(env);
157 return id; 157 return id;
158 } 158 }
159 159
160 bool CheckException(JNIEnv* env) { 160 bool HasException(JNIEnv* env) {
161 if (env->ExceptionCheck() == JNI_FALSE) 161 return env->ExceptionCheck() != JNI_FALSE;
162 }
163
164 bool ClearException(JNIEnv* env) {
165 if (!HasException(env))
162 return false; 166 return false;
163 env->ExceptionDescribe();
164 env->ExceptionClear(); 167 env->ExceptionClear();
165 return true; 168 return true;
166 } 169 }
167 170
171 void CheckException(JNIEnv* env) {
172 if (HasException(env)) {
173 env->ExceptionDescribe();
174 CHECK(false);
175 }
176 }
177
168 } // namespace android 178 } // namespace android
169 } // namespace base 179 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698