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

Unified Diff: content/browser/android/java/gin_java_method_invocation_helper.h

Issue 772123002: [Android] Java Bridge: handle requests from Java Script on the background thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed more Sami's comments Created 6 years 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/java/gin_java_method_invocation_helper.h
diff --git a/content/browser/android/java/gin_java_method_invocation_helper.h b/content/browser/android/java/gin_java_method_invocation_helper.h
index 014e3113194867c127a3caf7c51434e5dee5f41e..f7bdd57747ffe1e496f65f6b7835c1960bde8363 100644
--- a/content/browser/android/java/gin_java_method_invocation_helper.h
+++ b/content/browser/android/java/gin_java_method_invocation_helper.h
@@ -20,13 +20,10 @@ namespace content {
class JavaMethod;
-// Instances of this class are created and initialized on the UI thread, do
-// their work on the background thread, and then again examined on the UI
-// thread. They don't work on both threads simultaneously, though.
+// Instances of this class are created and used on the background thread.
class CONTENT_EXPORT GinJavaMethodInvocationHelper
: public base::RefCountedThreadSafe<GinJavaMethodInvocationHelper> {
public:
- // DispatcherDelegate is used on the UI thread
class DispatcherDelegate {
public:
DispatcherDelegate() {}
@@ -38,7 +35,6 @@ class CONTENT_EXPORT GinJavaMethodInvocationHelper
DISALLOW_COPY_AND_ASSIGN(DispatcherDelegate);
};
- // ObjectDelegate is used in the background thread
class ObjectDelegate {
public:
ObjectDelegate() {}
@@ -61,10 +57,8 @@ class CONTENT_EXPORT GinJavaMethodInvocationHelper
const base::ListValue& arguments);
void Init(DispatcherDelegate* dispatcher);
- // Called on the background thread
void Invoke();
- // Called on the UI thread
bool HoldsPrimitiveResult();
const base::ListValue& GetPrimitiveResult();
const base::android::JavaRef<jobject>& GetObjectResult();
@@ -75,7 +69,6 @@ class CONTENT_EXPORT GinJavaMethodInvocationHelper
friend class base::RefCountedThreadSafe<GinJavaMethodInvocationHelper>;
~GinJavaMethodInvocationHelper();
- // Called on the UI thread
void BuildObjectRefsFromListValue(DispatcherDelegate* dispatcher,
const base::Value* list_value);
void BuildObjectRefsFromDictionaryValue(DispatcherDelegate* dispatcher,
@@ -84,7 +77,6 @@ class CONTENT_EXPORT GinJavaMethodInvocationHelper
bool AppendObjectRef(DispatcherDelegate* dispatcher,
const base::Value* raw_value);
- // Called on the background thread.
void InvokeMethod(jobject object,
jclass clazz,
const JavaType& return_type,

Powered by Google App Engine
This is Rietveld 408576698