diff options
Diffstat (limited to 'WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp')
-rw-r--r-- | WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp index 28b0a99..06c6c1d 100644 --- a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp +++ b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp @@ -44,25 +44,7 @@ namespace WebCore { -v8::Persistent<v8::FunctionTemplate> V8HTMLAudioElementConstructor::GetTemplate() -{ - static v8::Persistent<v8::FunctionTemplate> cachedTemplate; - if (!cachedTemplate.IsEmpty()) - return cachedTemplate; - - v8::HandleScope scope; - v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(USE_CALLBACK(HTMLAudioElementConstructor)); - - v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate(); - instance->SetInternalFieldCount(V8HTMLAudioElement::internalFieldCount); - result->SetClassName(v8::String::New("HTMLAudioElement")); - result->Inherit(V8DOMWrapper::getTemplate(V8ClassIndex::HTMLAUDIOELEMENT)); - - cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result); - return cachedTemplate; -} - -v8::Handle<v8::Value> V8Custom::v8HTMLAudioElementConstructorCallback(const v8::Arguments& args) +static v8::Handle<v8::Value> v8HTMLAudioElementConstructorCallback(const v8::Arguments& args) { INC_STATS("DOM.HTMLAudioElement.Contructor"); @@ -88,10 +70,28 @@ v8::Handle<v8::Value> V8Custom::v8HTMLAudioElementConstructorCallback(const v8:: audio->scheduleLoad(); } - V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::NODE), audio.get()); + V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::AUDIO), audio.get()); audio->ref(); V8DOMWrapper::setJSWrapperForDOMNode(audio.get(), v8::Persistent<v8::Object>::New(args.Holder())); return args.Holder(); } +v8::Persistent<v8::FunctionTemplate> V8HTMLAudioElementConstructor::GetTemplate() +{ + static v8::Persistent<v8::FunctionTemplate> cachedTemplate; + if (!cachedTemplate.IsEmpty()) + return cachedTemplate; + + v8::HandleScope scope; + v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(v8HTMLAudioElementConstructorCallback); + + v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate(); + instance->SetInternalFieldCount(V8HTMLAudioElement::internalFieldCount); + result->SetClassName(v8::String::New("HTMLAudioElement")); + result->Inherit(V8HTMLAudioElement::GetTemplate()); + + cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result); + return cachedTemplate; +} + } // namespace WebCore |