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

Side by Side Diff: Source/bindings/tests/results/core/V8TestObject.cpp

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 unified diff | Download patch
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
11 #include "bindings/core/v8/Dictionary.h" 11 #include "bindings/core/v8/Dictionary.h"
12 #include "bindings/core/v8/ExceptionState.h" 12 #include "bindings/core/v8/ExceptionState.h"
13 #include "bindings/core/v8/PostMessage.h"
14 #include "bindings/core/v8/PrivateScriptRunner.h" 13 #include "bindings/core/v8/PrivateScriptRunner.h"
15 #include "bindings/core/v8/ScriptCallStackFactory.h" 14 #include "bindings/core/v8/ScriptCallStackFactory.h"
16 #include "bindings/core/v8/ScriptPromise.h" 15 #include "bindings/core/v8/ScriptPromise.h"
17 #include "bindings/core/v8/ScriptState.h" 16 #include "bindings/core/v8/ScriptState.h"
18 #include "bindings/core/v8/ScriptValue.h" 17 #include "bindings/core/v8/ScriptValue.h"
19 #include "bindings/core/v8/SerializedScriptValue.h" 18 #include "bindings/core/v8/SerializedScriptValue.h"
20 #include "bindings/core/v8/SerializedScriptValueFactory.h" 19 #include "bindings/core/v8/SerializedScriptValueFactory.h"
21 #include "bindings/core/v8/UnionTypesCore.h" 20 #include "bindings/core/v8/UnionTypesCore.h"
22 #include "bindings/core/v8/V8AbstractEventListener.h" 21 #include "bindings/core/v8/V8AbstractEventListener.h"
23 #include "bindings/core/v8/V8ArrayBuffer.h" 22 #include "bindings/core/v8/V8ArrayBuffer.h"
(...skipping 25 matching lines...) Expand all
49 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h" 48 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h"
50 #include "bindings/core/v8/V8TestInterfaceWillBeGarbageCollected.h" 49 #include "bindings/core/v8/V8TestInterfaceWillBeGarbageCollected.h"
51 #include "bindings/core/v8/V8TestNode.h" 50 #include "bindings/core/v8/V8TestNode.h"
52 #include "bindings/core/v8/V8TestObject.h" 51 #include "bindings/core/v8/V8TestObject.h"
53 #include "bindings/core/v8/V8Uint8Array.h" 52 #include "bindings/core/v8/V8Uint8Array.h"
54 #include "bindings/core/v8/V8Window.h" 53 #include "bindings/core/v8/V8Window.h"
55 #include "bindings/core/v8/V8XPathNSResolver.h" 54 #include "bindings/core/v8/V8XPathNSResolver.h"
56 #include "core/HTMLNames.h" 55 #include "core/HTMLNames.h"
57 #include "core/dom/ClassCollection.h" 56 #include "core/dom/ClassCollection.h"
58 #include "core/dom/ContextFeatures.h" 57 #include "core/dom/ContextFeatures.h"
58 #include "core/dom/DOMArrayBuffer.h"
59 #include "core/dom/Document.h" 59 #include "core/dom/Document.h"
60 #include "core/dom/MessagePort.h"
60 #include "core/dom/TagCollection.h" 61 #include "core/dom/TagCollection.h"
61 #include "core/dom/custom/CustomElementProcessingStack.h" 62 #include "core/dom/custom/CustomElementProcessingStack.h"
62 #include "core/frame/LocalFrame.h" 63 #include "core/frame/LocalFrame.h"
63 #include "core/frame/UseCounter.h" 64 #include "core/frame/UseCounter.h"
64 #include "core/html/HTMLCollection.h" 65 #include "core/html/HTMLCollection.h"
65 #include "core/html/HTMLDataListOptionsCollection.h" 66 #include "core/html/HTMLDataListOptionsCollection.h"
66 #include "core/html/HTMLFormControlsCollection.h" 67 #include "core/html/HTMLFormControlsCollection.h"
67 #include "core/html/HTMLTableRowsCollection.h" 68 #include "core/html/HTMLTableRowsCollection.h"
68 #include "core/inspector/ConsoleMessage.h" 69 #include "core/inspector/ConsoleMessage.h"
69 #include "core/inspector/ScriptArguments.h" 70 #include "core/inspector/ScriptArguments.h"
(...skipping 10787 matching lines...) Expand 10 before | Expand all | Expand 10 after
10857 impl->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg) ; 10858 impl->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg) ;
10858 } 10859 }
10859 10860
10860 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMain World(const v8::FunctionCallbackInfo<v8::Value>& info) 10861 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMain World(const v8::FunctionCallbackInfo<v8::Value>& info)
10861 { 10862 {
10862 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 10863 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
10863 TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodF orMainWorld(info); 10864 TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodF orMainWorld(info);
10864 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 10865 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
10865 } 10866 }
10866 10867
10868 void postMessageImpl(const char* interfaceName, TestObject* instance, const v8:: FunctionCallbackInfo<v8::Value>& info)
10869 {
10870 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage ", interfaceName, info.Holder(), info.GetIsolate());
10871 if (UNLIKELY(info.Length() < 1)) {
10872 setMinimumArityTypeError(exceptionState, 1, info.Length());
10873 exceptionState.throwIfNeeded();
10874 return;
10875 }
10876 OwnPtrWillBeRawPtr<MessagePortArray> ports = adoptPtrWillBeNoop(new MessageP ortArray);
10877 ArrayBufferArray arrayBuffers;
10878 if (info.Length() > 1) {
10879 const int transferablesArgIndex = 1;
10880 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info [transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, exceptionS tate)) {
10881 exceptionState.throwIfNeeded();
10882 return;
10883 }
10884 }
10885 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan ce().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, exceptionSta te);
10886 if (exceptionState.throwIfNeeded())
10887 return;
10888 // FIXME: Only pass context/exceptionState if instance really requires it.
10889 ExecutionContext* context = currentExecutionContext(info.GetIsolate());
10890 instance->postMessage(context, message.release(), ports.get(), exceptionStat e);
10891 exceptionState.throwIfNeeded();
10892 }
10893
10867 static void postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 10894 static void postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
10868 { 10895 {
10869 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 10896 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
10870 postMessageMethodCommon("TestObject", V8TestObject::toImpl(info.Holder()), i nfo); 10897 postMessageImpl("TestObject", V8TestObject::toImpl(info.Holder()), info);
10871 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 10898 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
10872 } 10899 }
10873 10900
10874 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8 ::FunctionCallbackInfo<v8::Value>& info) 10901 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8 ::FunctionCallbackInfo<v8::Value>& info)
10875 { 10902 {
10876 TestObject* impl = V8TestObject::toImpl(info.Holder()); 10903 TestObject* impl = V8TestObject::toImpl(info.Holder());
10877 impl->activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); 10904 impl->activityLoggingForAllWorldsPerWorldBindingsVoidMethod();
10878 } 10905 }
10879 10906
10880 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback( const v8::FunctionCallbackInfo<v8::Value>& info) 10907 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback( const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after
13542 ScriptState::Scope scope(scriptState); 13569 ScriptState::Scope scope(scriptState);
13543 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13570 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13544 if (holder.IsEmpty()) 13571 if (holder.IsEmpty())
13545 return false; 13572 return false;
13546 13573
13547 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ; 13574 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ;
13548 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue)); 13575 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue));
13549 } 13576 }
13550 13577
13551 } // namespace blink 13578 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698