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

Unified Diff: Source/bindings/core/v8/PostMessage.h

Issue 1149623004: [bindings] Implment postMessageImpl and replace the usage of postMessageMethodCommon. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | « no previous file | Source/bindings/core/v8/v8.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/PostMessage.h
diff --git a/Source/bindings/core/v8/PostMessage.h b/Source/bindings/core/v8/PostMessage.h
deleted file mode 100644
index 756a259f6fec9ec4197b09e45721bbd4f6042cf8..0000000000000000000000000000000000000000
--- a/Source/bindings/core/v8/PostMessage.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PostMessage_h
-#define PostMessage_h
-
-#include "bindings/core/v8/ExceptionState.h"
-#include "bindings/core/v8/SerializedScriptValue.h"
-#include "bindings/core/v8/SerializedScriptValueFactory.h"
-#include "bindings/core/v8/V8Binding.h"
-#include "bindings/core/v8/V8BindingMacros.h"
-#include "core/dom/DOMArrayBuffer.h"
-#include "core/dom/MessagePort.h"
-#include <v8.h>
-
-namespace blink {
-
-class ExecutionContext;
-
-// FIXME: This should be auto-generated by a code generator template.
-template <class Type>
-void postMessageMethodCommon(const char* interfaceName, Type* instance, const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", interfaceName, info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
- return;
- }
- OwnPtrWillBeRawPtr<MessagePortArray> ports = adoptPtrWillBeNoop(new MessagePortArray);
- ArrayBufferArray arrayBuffers;
- if (info.Length() > 1) {
- const int transferablesArgIndex = 1;
- if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info[transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, exceptionState)) {
- exceptionState.throwIfNeeded();
- return;
- }
- }
- RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instance().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, exceptionState);
- if (exceptionState.throwIfNeeded())
- return;
- // FIXME: Only pass context/exceptionState if instance really requires it.
- ExecutionContext* context = currentExecutionContext(info.GetIsolate());
- instance->postMessage(context, message.release(), ports.get(), exceptionState);
- exceptionState.throwIfNeeded();
-}
-
-} // namespace blink
-
-#endif // PostMessage_h
« no previous file with comments | « no previous file | Source/bindings/core/v8/v8.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698