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

Unified Diff: content/browser/android/jni_helper.h

Issue 10035034: Implement the skeleton of an android content shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove tabs from content.xml Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/jni_helper.h
diff --git a/content/browser/android/jni_helper.h b/content/browser/android/jni_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..3533dc6dda8cbcafe00544d37e3335bd46e28283
--- /dev/null
+++ b/content/browser/android/jni_helper.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
jam 2012/04/19 21:56:26 I'm not familiar with android or jni, but it's not
Ted C 2012/04/20 01:14:14 Done...for now it better belongs in base. If we w
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_ANDROID_JNI_HELPER_H_
+#define CONTENT_BROWSER_ANDROID_JNI_HELPER_H_
+
+#include <jni.h>
+
+#include "base/android/scoped_java_ref.h"
+
+struct RegistrationMethod {
+ const char* name;
+ bool (*func)(JNIEnv* env);
+};
+
+// Manages WeakGlobalRef lifecycle.
+class JavaObjectWeakGlobalRef {
+ public:
+ JavaObjectWeakGlobalRef(JNIEnv* env, jobject obj);
+ virtual ~JavaObjectWeakGlobalRef();
+
+ base::android::ScopedJavaLocalRef<jobject> get(JNIEnv* env) const;
+
+ private:
+ jweak obj_;
+
+ DISALLOW_COPY_AND_ASSIGN(JavaObjectWeakGlobalRef);
+};
+
+// Get the real object stored in the weak reference returned as a
+// ScopedJavaLocalRef.
+base::android::ScopedJavaLocalRef<jobject> GetRealObject(
+ JNIEnv* env, jobject obj);
+
+#endif // CONTENT_BROWSER_ANDROID_JNI_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698