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

Unified Diff: gin/converter.cc

Issue 83143002: [Mojo] Improve JavaScript API for MojoReadMessage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixup Created 7 years, 1 month 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
« no previous file with comments | « gin/converter.h ('k') | gin/modules/module_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/converter.cc
diff --git a/gin/converter.cc b/gin/converter.cc
index 5fda6732fa8f2353a8ec1ea882c439e10c6c1f38..e60e3a0d288064ac76114f56f869a6f1e32966ee 100644
--- a/gin/converter.cc
+++ b/gin/converter.cc
@@ -6,6 +6,7 @@
#include "v8/include/v8.h"
+using v8::ArrayBuffer;
using v8::Boolean;
using v8::External;
using v8::Function;
@@ -125,6 +126,19 @@ bool Converter<Handle<Object> >::FromV8(Handle<Value> val,
return true;
}
+Handle<Value> Converter<Handle<ArrayBuffer> >::ToV8(v8::Isolate* isolate,
+ Handle<ArrayBuffer> val) {
+ return val.As<Value>();
+}
+
+bool Converter<Handle<ArrayBuffer> >::FromV8(Handle<Value> val,
+ Handle<ArrayBuffer>* out) {
+ if (!val->IsArrayBuffer())
+ return false;
+ *out = Handle<ArrayBuffer>::Cast(val);
+ return true;
+}
+
Handle<Value> Converter<Handle<External> >::ToV8(v8::Isolate* isolate,
Handle<External> val) {
return val.As<Value>();
« no previous file with comments | « gin/converter.h ('k') | gin/modules/module_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698