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

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

Issue 7828084: Refactor ScopedJavaRef (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: operator= docs Created 9 years, 3 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) 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 "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace { 9 namespace {
10 JavaVM* g_jvm = 0; 10 JavaVM* g_jvm = 0;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 jmethodID GetMethodID(JNIEnv* env, 49 jmethodID GetMethodID(JNIEnv* env,
50 jclass clazz, 50 jclass clazz,
51 const char* const method, 51 const char* const method,
52 const char* const jni_signature) { 52 const char* const jni_signature) {
53 jmethodID id = env->GetMethodID(clazz, method, jni_signature); 53 jmethodID id = env->GetMethodID(clazz, method, jni_signature);
54 DCHECK(id) << method; 54 DCHECK(id) << method;
55 CheckException(env); 55 CheckException(env);
56 return id; 56 return id;
57 } 57 }
58 58
59 jmethodID GetStaticMethodID(JNIEnv* env,
60 jclass clazz,
61 const char* const method,
62 const char* const jni_signature) {
63 jmethodID id = env->GetStaticMethodID(clazz, method, jni_signature);
64 DCHECK(id) << method;
65 CheckException(env);
66 return id;
67 }
68
59 bool CheckException(JNIEnv* env) { 69 bool CheckException(JNIEnv* env) {
60 if (env->ExceptionCheck() == JNI_FALSE) 70 if (env->ExceptionCheck() == JNI_FALSE)
61 return false; 71 return false;
62 env->ExceptionDescribe(); 72 env->ExceptionDescribe();
63 env->ExceptionClear(); 73 env->ExceptionClear();
64 return true; 74 return true;
65 } 75 }
66 76
67 } // namespace android 77 } // namespace android
68 } // namespace base 78 } // namespace base
OLDNEW
« no previous file with comments | « base/android/jni_android.h ('k') | base/android/jni_array.h » ('j') | base/android/jni_array.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698