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

Unified Diff: Source/core/events/MessageEvent.cpp

Issue 478243002: bindings: Adds virtual ScriptWrappable::wrap method. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 3 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
« no previous file with comments | « Source/core/events/MessageEvent.h ('k') | Source/core/events/MouseEvent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/MessageEvent.cpp
diff --git a/Source/core/events/MessageEvent.cpp b/Source/core/events/MessageEvent.cpp
index def032f48e2f749979411420a4c7da8a7464ab21..1eb630a05bcf6fe2b549eb3c8f0518ec05ff2880 100644
--- a/Source/core/events/MessageEvent.cpp
+++ b/Source/core/events/MessageEvent.cpp
@@ -30,6 +30,7 @@
#include "bindings/core/v8/ExceptionMessages.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/custom/V8ArrayBufferCustom.h"
namespace blink {
@@ -194,4 +195,25 @@ void MessageEvent::trace(Visitor* visitor)
Event::trace(visitor);
}
+v8::Handle<v8::Object> MessageEvent::wrap(v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ v8::Handle<v8::Object> wrapper = Event::wrap(creationContext, isolate);
+
+ switch (dataType()) {
+ case MessageEvent::DataTypeScriptValue:
+ case MessageEvent::DataTypeSerializedScriptValue:
+ break;
+ case MessageEvent::DataTypeString:
+ V8HiddenValue::setHiddenValue(isolate, wrapper, V8HiddenValue::stringData(isolate), v8String(isolate, dataAsString()));
+ break;
+ case MessageEvent::DataTypeBlob:
+ break;
+ case MessageEvent::DataTypeArrayBuffer:
+ V8HiddenValue::setHiddenValue(isolate, wrapper, V8HiddenValue::arrayBufferData(isolate), toV8(dataAsArrayBuffer(), wrapper, isolate));
+ break;
+ }
+
+ return wrapper;
+}
+
} // namespace blink
« no previous file with comments | « Source/core/events/MessageEvent.h ('k') | Source/core/events/MouseEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698