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

Unified Diff: Source/bindings/v8/custom/V8MessageEventCustom.cpp

Issue 15862004: Remove custom code for MessageEvent.ports getter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase patch Created 7 years, 7 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/bindings/v8/V8Binding.h ('k') | Source/core/dom/MessageEvent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8MessageEventCustom.cpp
diff --git a/Source/bindings/v8/custom/V8MessageEventCustom.cpp b/Source/bindings/v8/custom/V8MessageEventCustom.cpp
index feb82dd2029c125ea496f298ace34a77b4759988..e034d1ba184e83244f02de8d939e1cbd97f60566 100644
--- a/Source/bindings/v8/custom/V8MessageEventCustom.cpp
+++ b/Source/bindings/v8/custom/V8MessageEventCustom.cpp
@@ -58,9 +58,10 @@ v8::Handle<v8::Value> V8MessageEvent::dataAttrGetterCustom(v8::Local<v8::String>
}
case MessageEvent::DataTypeSerializedScriptValue:
- if (RefPtr<SerializedScriptValue> serializedValue = event->dataAsSerializedScriptValue())
- result = serializedValue->deserialize(info.GetIsolate(), event->ports());
- else
+ if (RefPtr<SerializedScriptValue> serializedValue = event->dataAsSerializedScriptValue()) {
+ MessagePortArray ports = event->ports();
+ result = serializedValue->deserialize(info.GetIsolate(), &ports);
+ } else
result = v8Null(info.GetIsolate());
break;
@@ -86,23 +87,6 @@ v8::Handle<v8::Value> V8MessageEvent::dataAttrGetterCustom(v8::Local<v8::String>
return result;
}
-v8::Handle<v8::Value> V8MessageEvent::portsAttrGetterCustom(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- MessageEvent* event = V8MessageEvent::toNative(info.Holder());
-
- MessagePortArray* ports = event->ports();
- if (!ports)
- return v8::Array::New(0);
-
- MessagePortArray portsCopy(*ports);
-
- v8::Local<v8::Array> portArray = v8::Array::New(portsCopy.size());
- for (size_t i = 0; i < portsCopy.size(); ++i)
- portArray->Set(v8Integer(i, info.GetIsolate()), toV8Fast(portsCopy[i].get(), info, event));
-
- return portArray;
-}
-
v8::Handle<v8::Value> V8MessageEvent::initMessageEventMethodCustom(const v8::Arguments& args)
{
MessageEvent* event = V8MessageEvent::toNative(args.Holder());
« no previous file with comments | « Source/bindings/v8/V8Binding.h ('k') | Source/core/dom/MessageEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698