Home | History | Annotate | Download | only in V8
      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., 59 Temple Place - Suite 330,
     18     Boston, MA 02111-1307, USA.
     19 */
     20 
     21 #include "config.h"
     22 #include "V8TestMediaQueryListListener.h"
     23 
     24 #include "ExceptionCode.h"
     25 #include "MediaQueryListListener.h"
     26 #include "RuntimeEnabledFeatures.h"
     27 #include "V8Binding.h"
     28 #include "V8BindingMacros.h"
     29 #include "V8BindingState.h"
     30 #include "V8DOMWrapper.h"
     31 #include "V8IsolatedContext.h"
     32 #include "V8Proxy.h"
     33 
     34 namespace WebCore {
     35 
     36 WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0, 0 };
     37 
     38 namespace TestMediaQueryListListenerInternal {
     39 
     40 template <typename T> void V8_USE(T) { }
     41 
     42 static v8::Handle<v8::Value> methodCallback(const v8::Arguments& args)
     43 {
     44     INC_STATS("DOM.TestMediaQueryListListener.method");
     45     TestMediaQueryListListener* imp = V8TestMediaQueryListListener::toNative(args.Holder());
     46     EXCEPTION_BLOCK(RefPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(args[0]));
     47     imp->method(listener);
     48     return v8::Handle<v8::Value>();
     49 }
     50 
     51 } // namespace TestMediaQueryListListenerInternal
     52 
     53 static const BatchedCallback TestMediaQueryListListenerCallbacks[] = {
     54     {"method", TestMediaQueryListListenerInternal::methodCallback},
     55 };
     56 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestMediaQueryListListenerTemplate(v8::Persistent<v8::FunctionTemplate> desc)
     57 {
     58     v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestMediaQueryListListener", v8::Persistent<v8::FunctionTemplate>(), V8TestMediaQueryListListener::internalFieldCount,
     59         0, 0,
     60         TestMediaQueryListListenerCallbacks, WTF_ARRAY_LENGTH(TestMediaQueryListListenerCallbacks));
     61     v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
     62     v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
     63 
     64 
     65     // Custom toString template
     66     desc->Set(getToStringName(), getToStringTemplate());
     67     return desc;
     68 }
     69 
     70 v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListener::GetRawTemplate()
     71 {
     72     static v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListenerRawCache = createRawTemplate();
     73     return V8TestMediaQueryListListenerRawCache;
     74 }
     75 
     76 v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListener::GetTemplate()
     77 {
     78     static v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListenerCache = ConfigureV8TestMediaQueryListListenerTemplate(GetRawTemplate());
     79     return V8TestMediaQueryListListenerCache;
     80 }
     81 
     82 bool V8TestMediaQueryListListener::HasInstance(v8::Handle<v8::Value> value)
     83 {
     84     return GetRawTemplate()->HasInstance(value);
     85 }
     86 
     87 
     88 v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(TestMediaQueryListListener* impl)
     89 {
     90     v8::Handle<v8::Object> wrapper;
     91     V8Proxy* proxy = 0;
     92     wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
     93     if (wrapper.IsEmpty())
     94         return wrapper;
     95 
     96     impl->ref();
     97     v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);
     98     getDOMObjectMap().set(impl, wrapperHandle);
     99     return wrapper;
    100 }
    101 
    102 void V8TestMediaQueryListListener::derefObject(void* object)
    103 {
    104     static_cast<TestMediaQueryListListener*>(object)->deref();
    105 }
    106 
    107 } // namespace WebCore
    108