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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 353163002: [Android] Switch to Gin Java Bridge implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 340aba161ab810f999891cf06db99d25c8fc66af..1371898ae99ec338eb3d11673ee31d61e9b68bbc 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -29,8 +29,7 @@
#include "content/browser/renderer_host/input/motion_event_android.h"
#include "content/browser/renderer_host/input/web_input_event_builders_android.h"
#include "content/browser/renderer_host/input/web_input_event_util.h"
-#include "content/browser/renderer_host/java/java_bound_object.h"
-#include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h"
+#include "content/browser/renderer_host/java/gin_java_bridge_dispatcher_host.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_android.h"
@@ -54,7 +53,6 @@
#include "content/public/common/page_transition_types.h"
#include "content/public/common/user_agent.h"
#include "jni/ContentViewCore_jni.h"
-#include "third_party/WebKit/public/web/WebBindings.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/base/android/view_android.h"
#include "ui/base/android/window_android.h"
@@ -246,9 +244,9 @@ ContentViewCoreImpl::ContentViewCoreImpl(
BuildUserAgentFromOSAndProduct(kLinuxInfoStr, product);
web_contents->SetUserAgentOverride(spoofed_ua);
- java_bridge_dispatcher_host_manager_.reset(
- new JavaBridgeDispatcherHostManager(web_contents,
- java_bridge_retained_object_set));
+ java_bridge_dispatcher_host_.reset(
+ new GinJavaBridgeDispatcherHost(web_contents,
+ java_bridge_retained_object_set));
InitWebContents();
}
@@ -1230,7 +1228,7 @@ void ContentViewCoreImpl::SetAllowJavascriptInterfacesInspection(
JNIEnv* env,
jobject obj,
jboolean allow) {
- java_bridge_dispatcher_host_manager_->SetAllowObjectContentsInspection(allow);
+ java_bridge_dispatcher_host_->SetAllowObjectContentsInspection(allow);
}
void ContentViewCoreImpl::AddJavascriptInterface(
@@ -1241,24 +1239,15 @@ void ContentViewCoreImpl::AddJavascriptInterface(
jclass safe_annotation_clazz) {
ScopedJavaLocalRef<jobject> scoped_object(env, object);
ScopedJavaLocalRef<jclass> scoped_clazz(env, safe_annotation_clazz);
-
- // JavaBoundObject creates the NPObject with a ref count of 1, and
- // JavaBridgeDispatcherHostManager takes its own ref.
- NPObject* bound_object = JavaBoundObject::Create(
- scoped_object,
- scoped_clazz,
- java_bridge_dispatcher_host_manager_->AsWeakPtr(),
- java_bridge_dispatcher_host_manager_->GetAllowObjectContentsInspection());
- java_bridge_dispatcher_host_manager_->AddNamedObject(
- ConvertJavaStringToUTF16(env, name), bound_object);
- blink::WebBindings::releaseObject(bound_object);
+ java_bridge_dispatcher_host_->AddNamedObject(
+ ConvertJavaStringToUTF8(env, name), scoped_object, scoped_clazz);
}
void ContentViewCoreImpl::RemoveJavascriptInterface(JNIEnv* env,
jobject /* obj */,
jstring name) {
- java_bridge_dispatcher_host_manager_->RemoveNamedObject(
- ConvertJavaStringToUTF16(env, name));
+ java_bridge_dispatcher_host_->RemoveNamedObject(
+ ConvertJavaStringToUTF8(env, name));
}
void ContentViewCoreImpl::WasResized(JNIEnv* env, jobject obj) {

Powered by Google App Engine
This is Rietveld 408576698