WebCore/generated/JSMessageChannel.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2     This file is part of the WebKit open source project.
       
     3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
       
     4 
       
     5     This library is free software; you can redistribute it and/or
       
     6     modify it under the terms of the GNU Library General Public
       
     7     License as published by the Free Software Foundation; either
       
     8     version 2 of the License, or (at your option) any later version.
       
     9 
       
    10     This library is distributed in the hope that it will be useful,
       
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13     Library General Public License for more details.
       
    14 
       
    15     You should have received a copy of the GNU Library General Public License
       
    16     along with this library; see the file COPYING.LIB.  If not, write to
       
    17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    18     Boston, MA 02110-1301, USA.
       
    19 */
       
    20 
       
    21 #include "config.h"
       
    22 #include "JSMessageChannel.h"
       
    23 
       
    24 #include "JSMessagePort.h"
       
    25 #include "MessageChannel.h"
       
    26 #include "MessagePort.h"
       
    27 #include <wtf/GetPtr.h>
       
    28 
       
    29 using namespace JSC;
       
    30 
       
    31 namespace WebCore {
       
    32 
       
    33 ASSERT_CLASS_FITS_IN_CELL(JSMessageChannel);
       
    34 
       
    35 /* Hash table */
       
    36 #if ENABLE(JIT)
       
    37 #define THUNK_GENERATOR(generator) , generator
       
    38 #else
       
    39 #define THUNK_GENERATOR(generator)
       
    40 #endif
       
    41 
       
    42 static const HashTableValue JSMessageChannelTableValues[4] =
       
    43 {
       
    44     { "port1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMessageChannelPort1), (intptr_t)0 THUNK_GENERATOR(0) },
       
    45     { "port2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMessageChannelPort2), (intptr_t)0 THUNK_GENERATOR(0) },
       
    46     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMessageChannelConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    48 };
       
    49 
       
    50 #undef THUNK_GENERATOR
       
    51 static JSC_CONST_HASHTABLE HashTable JSMessageChannelTable = { 8, 7, JSMessageChannelTableValues, 0 };
       
    52 /* Hash table for constructor */
       
    53 #if ENABLE(JIT)
       
    54 #define THUNK_GENERATOR(generator) , generator
       
    55 #else
       
    56 #define THUNK_GENERATOR(generator)
       
    57 #endif
       
    58 
       
    59 static const HashTableValue JSMessageChannelConstructorTableValues[1] =
       
    60 {
       
    61     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    62 };
       
    63 
       
    64 #undef THUNK_GENERATOR
       
    65 static JSC_CONST_HASHTABLE HashTable JSMessageChannelConstructorTable = { 1, 0, JSMessageChannelConstructorTableValues, 0 };
       
    66 const ClassInfo JSMessageChannelConstructor::s_info = { "MessageChannelConstructor", 0, &JSMessageChannelConstructorTable, 0 };
       
    67 
       
    68 JSMessageChannelConstructor::JSMessageChannelConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    69     : DOMConstructorObject(JSMessageChannelConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    70 {
       
    71     putDirect(exec->propertyNames().prototype, JSMessageChannelPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    72 }
       
    73 
       
    74 bool JSMessageChannelConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    75 {
       
    76     return getStaticValueSlot<JSMessageChannelConstructor, DOMObject>(exec, &JSMessageChannelConstructorTable, this, propertyName, slot);
       
    77 }
       
    78 
       
    79 bool JSMessageChannelConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    80 {
       
    81     return getStaticValueDescriptor<JSMessageChannelConstructor, DOMObject>(exec, &JSMessageChannelConstructorTable, this, propertyName, descriptor);
       
    82 }
       
    83 
       
    84 ConstructType JSMessageChannelConstructor::getConstructData(ConstructData& constructData)
       
    85 {
       
    86     constructData.native.function = constructJSMessageChannel;
       
    87     return ConstructTypeHost;
       
    88 }
       
    89 
       
    90 /* Hash table for prototype */
       
    91 #if ENABLE(JIT)
       
    92 #define THUNK_GENERATOR(generator) , generator
       
    93 #else
       
    94 #define THUNK_GENERATOR(generator)
       
    95 #endif
       
    96 
       
    97 static const HashTableValue JSMessageChannelPrototypeTableValues[1] =
       
    98 {
       
    99     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   100 };
       
   101 
       
   102 #undef THUNK_GENERATOR
       
   103 static JSC_CONST_HASHTABLE HashTable JSMessageChannelPrototypeTable = { 1, 0, JSMessageChannelPrototypeTableValues, 0 };
       
   104 static const HashTable* getJSMessageChannelPrototypeTable(ExecState* exec)
       
   105 {
       
   106     return getHashTableForGlobalData(exec->globalData(), &JSMessageChannelPrototypeTable);
       
   107 }
       
   108 const ClassInfo JSMessageChannelPrototype::s_info = { "MessageChannelPrototype", 0, 0, getJSMessageChannelPrototypeTable };
       
   109 
       
   110 JSObject* JSMessageChannelPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   111 {
       
   112     return getDOMPrototype<JSMessageChannel>(exec, globalObject);
       
   113 }
       
   114 
       
   115 static const HashTable* getJSMessageChannelTable(ExecState* exec)
       
   116 {
       
   117     return getHashTableForGlobalData(exec->globalData(), &JSMessageChannelTable);
       
   118 }
       
   119 const ClassInfo JSMessageChannel::s_info = { "MessageChannel", 0, 0, getJSMessageChannelTable };
       
   120 
       
   121 JSMessageChannel::JSMessageChannel(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<MessageChannel> impl)
       
   122     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   123     , m_impl(impl)
       
   124 {
       
   125 }
       
   126 
       
   127 JSMessageChannel::~JSMessageChannel()
       
   128 {
       
   129     forgetDOMObject(this, impl());
       
   130 }
       
   131 
       
   132 JSObject* JSMessageChannel::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   133 {
       
   134     return new (exec) JSMessageChannelPrototype(globalObject, JSMessageChannelPrototype::createStructure(globalObject->objectPrototype()));
       
   135 }
       
   136 
       
   137 bool JSMessageChannel::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   138 {
       
   139     return getStaticValueSlot<JSMessageChannel, Base>(exec, getJSMessageChannelTable(exec), this, propertyName, slot);
       
   140 }
       
   141 
       
   142 bool JSMessageChannel::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   143 {
       
   144     return getStaticValueDescriptor<JSMessageChannel, Base>(exec, getJSMessageChannelTable(exec), this, propertyName, descriptor);
       
   145 }
       
   146 
       
   147 JSValue jsMessageChannelPort1(ExecState* exec, JSValue slotBase, const Identifier&)
       
   148 {
       
   149     JSMessageChannel* castedThis = static_cast<JSMessageChannel*>(asObject(slotBase));
       
   150     UNUSED_PARAM(exec);
       
   151     MessageChannel* imp = static_cast<MessageChannel*>(castedThis->impl());
       
   152     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->port1()));
       
   153     return result;
       
   154 }
       
   155 
       
   156 JSValue jsMessageChannelPort2(ExecState* exec, JSValue slotBase, const Identifier&)
       
   157 {
       
   158     JSMessageChannel* castedThis = static_cast<JSMessageChannel*>(asObject(slotBase));
       
   159     UNUSED_PARAM(exec);
       
   160     MessageChannel* imp = static_cast<MessageChannel*>(castedThis->impl());
       
   161     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->port2()));
       
   162     return result;
       
   163 }
       
   164 
       
   165 JSValue jsMessageChannelConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   166 {
       
   167     JSMessageChannel* domObject = static_cast<JSMessageChannel*>(asObject(slotBase));
       
   168     return JSMessageChannel::getConstructor(exec, domObject->globalObject());
       
   169 }
       
   170 JSValue JSMessageChannel::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   171 {
       
   172     return getDOMConstructor<JSMessageChannelConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   173 }
       
   174 
       
   175 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, MessageChannel* object)
       
   176 {
       
   177     return getDOMObjectWrapper<JSMessageChannel>(exec, globalObject, object);
       
   178 }
       
   179 MessageChannel* toMessageChannel(JSC::JSValue value)
       
   180 {
       
   181     return value.inherits(&JSMessageChannel::s_info) ? static_cast<JSMessageChannel*>(asObject(value))->impl() : 0;
       
   182 }
       
   183 
       
   184 }