summaryrefslogtreecommitdiffstats
path: root/content/renderer/java/gin_java_bridge_object.cc
diff options
context:
space:
mode:
authormnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-27 10:47:30 +0000
committermnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-27 10:47:30 +0000
commit197e294b2219a52d2e01ab80b05bf610e0b13f1c (patch)
tree7120fd7bb7da4e5b0a5a3b89dee2807d3ba93700 /content/renderer/java/gin_java_bridge_object.cc
parent76dfe8860ddbfc23e727a0ebc14f714c35044808 (diff)
downloadchromium_src-197e294b2219a52d2e01ab80b05bf610e0b13f1c.zip
chromium_src-197e294b2219a52d2e01ab80b05bf610e0b13f1c.tar.gz
chromium_src-197e294b2219a52d2e01ab80b05bf610e0b13f1c.tar.bz2
[Android] Java Bridge with Gin: implement Java Bridge dispatcher
This patch adds implementation for GinJavaBridgeDispatcherHost class, which is responsible for serving JB requests from renderers, and fulfilling them with help of GinJavaBoundObject instances. This patch also enables passing a error message for method invocation errors back to renderers, so they can use it when raising JavaScript exceptions. BUG=355644 Review URL: https://codereview.chromium.org/345753003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/java/gin_java_bridge_object.cc')
-rw-r--r--content/renderer/java/gin_java_bridge_object.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/content/renderer/java/gin_java_bridge_object.cc b/content/renderer/java/gin_java_bridge_object.cc
index a153f2a..d2a2b60 100644
--- a/content/renderer/java/gin_java_bridge_object.cc
+++ b/content/renderer/java/gin_java_bridge_object.cc
@@ -5,6 +5,7 @@
#include "content/renderer/java/gin_java_bridge_object.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/common/android/gin_java_bridge_errors.h"
#include "content/common/android/gin_java_bridge_value.h"
#include "content/public/renderer/v8_value_converter.h"
#include "content/renderer/java/gin_java_bridge_value_converter.h"
@@ -125,11 +126,12 @@ v8::Handle<v8::Value> GinJavaBridgeObject::InvokeMethod(
}
}
- scoped_ptr<base::Value> result =
- dispatcher_->InvokeJavaMethod(object_id_, name, arguments);
+ GinJavaBridgeError error;
+ scoped_ptr<base::Value> result = dispatcher_->InvokeJavaMethod(
+ object_id_, name, arguments, &error);
if (!result.get()) {
args->isolate()->ThrowException(v8::Exception::Error(gin::StringToV8(
- args->isolate(), kMethodInvocationErrorMessage)));
+ args->isolate(), GinJavaBridgeErrorToString(error))));
return v8::Undefined(args->isolate());
}
if (!result->IsType(base::Value::TYPE_BINARY)) {