text: // 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.
  
  // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
  
  #include "config.h"
  #include "V8HTMLMediaElement.h"
  
  #include "bindings/core/v8/ExceptionState.h"
  #include "bindings/core/v8/ScriptState.h"
  #include "bindings/core/v8/V8AudioTrackList.h"
  #include "bindings/core/v8/V8DOMConfiguration.h"
  #include "bindings/core/v8/V8MediaController.h"
  #include "bindings/core/v8/V8MediaError.h"
  #include "bindings/core/v8/V8ObjectConstructor.h"
  #include "bindings/core/v8/V8TextTrack.h"
  #include "bindings/core/v8/V8TextTrackList.h"
  #include "bindings/core/v8/V8TimeRanges.h"
  #include "bindings/core/v8/V8VideoTrackList.h"
  #include "core/HTMLNames.h"
  #include "core/dom/ContextFeatures.h"
  #include "core/dom/Document.h"
  #include "core/dom/custom/CustomElementProcessingStack.h"
  #include "core/frame/UseCounter.h"
  #include "platform/RuntimeEnabledFeatures.h"
  #include "platform/TraceEvent.h"
  #include "wtf/GetPtr.h"
  #include "wtf/RefPtr.h"
  
  namespace blink {
  
  // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
  // and does not depend on another global objects.
  #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wglobal-constructors"
  #endif
  WrapperTypeInfo V8HTMLMediaElement::wrapperTypeInfo = { gin::kEmbedderBlink, V8HTMLMediaElement::domTemplate, V8HTMLMediaElement::refObject, V8HTMLMediaElement::derefObject, V8HTMLMediaElement::trace, V8HTMLMediaElement::toActiveDOMObject, 0, V8HTMLMediaElement::preparePrototypeObject, V8HTMLMediaElement::installConditionallyEnabledProperties, "HTMLMediaElement", &V8HTMLElement::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTypeInfo::InheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTypeInfo::WillBeGarbageCollectedObject };
  #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
  #pragma clang diagnostic pop
  #endif
  
  // This static member must be declared by DEFINE_WRAPPERTYPEINFO in HTMLMediaElement.h.
  // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
  // bindings/core/v8/ScriptWrappable.h.
  const WrapperTypeInfo& HTMLMediaElement::s_wrapperTypeInfo = V8HTMLMediaElement::wrapperTypeInfo;
  
  namespace HTMLMediaElementV8Internal {
  
  static void errorAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueFast(info, WTF::getPtr(impl->error()), impl);
  }
  
  static void errorAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::errorAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void srcAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::srcAttr), info.GetIsolate());
  }
  
  static void srcAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::srcAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void srcAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      Element* impl = V8Element::toImpl(holder);
      V8StringResource<> cppValue = v8Value;
      if (!cppValue.prepare())
          return;
      impl->setAttribute(HTMLNames::srcAttr, cppValue);
  }
  
  static void srcAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      HTMLMediaElementV8Internal::srcAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void currentSrcAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueString(info, impl->currentSrc(), info.GetIsolate());
  }
  
  static void currentSrcAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::currentSrcAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void crossOriginAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      Element* impl = V8Element::toImpl(holder);
      String cppValue(impl->fastGetAttribute(HTMLNames::crossoriginAttr));
      if (cppValue.isNull()) {
          ;
      } else if (cppValue.isEmpty()) {
          cppValue = "anonymous";
      } else if (equalIgnoringCase(cppValue, "anonymous")) {
          cppValue = "anonymous";
      } else if (equalIgnoringCase(cppValue, "use-credentials")) {
          cppValue = "use-credentials";
      } else {
          cppValue = "anonymous";
      }
      v8SetReturnValueStringOrNull(info, cppValue, info.GetIsolate());
  }
  
  static void crossOriginAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::crossOriginAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void crossOriginAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      Element* impl = V8Element::toImpl(holder);
      V8StringResource<TreatNullAsNullString> cppValue = v8Value;
      if (!cppValue.prepare())
          return;
      impl->setAttribute(HTMLNames::crossoriginAttr, cppValue);
  }
  
  static void crossOriginAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      HTMLMediaElementV8Internal::crossOriginAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void networkStateAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueUnsigned(info, impl->networkState());
  }
  
  static void networkStateAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::networkStateAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void preloadAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueString(info, impl->preload(), info.GetIsolate());
  }
  
  static void preloadAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::preloadAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void preloadAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      V8StringResource<> cppValue = v8Value;
      if (!cppValue.prepare())
          return;
      impl->setPreload(cppValue);
  }
  
  static void preloadAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      HTMLMediaElementV8Internal::preloadAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void bufferedAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueFast(info, WTF::getPtr(impl->buffered()), impl);
  }
  
  static void bufferedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::bufferedAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void readyStateAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueUnsigned(info, impl->readyState());
  }
  
  static void readyStateAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::readyStateAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void seekingAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueBool(info, impl->seeking());
  }
  
  static void seekingAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::seekingAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void currentTimeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValue(info, impl->currentTime());
  }
  
  static void currentTimeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::currentTimeAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void currentTimeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "currentTime", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      impl->setCurrentTime(cppValue, exceptionState);
      exceptionState.throwIfNeeded();
  }
  
  static void currentTimeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      HTMLMediaElementV8Internal::currentTimeAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void durationAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValue(info, impl->duration());
  }
  
  static void durationAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::durationAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void pausedAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueBool(info, impl->paused());
  }
  
  static void pausedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::pausedAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void defaultPlaybackRateAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValue(info, impl->defaultPlaybackRate());
  }
  
  static void defaultPlaybackRateAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::defaultPlaybackRateAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void defaultPlaybackRateAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "defaultPlaybackRate", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      impl->setDefaultPlaybackRate(cppValue);
  }
  
  static void defaultPlaybackRateAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      HTMLMediaElementV8Internal::defaultPlaybackRateAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void playbackRateAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValue(info, impl->playbackRate());
  }
  
  static void playbackRateAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::playbackRateAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void playbackRateAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "playbackRate", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      impl->setPlaybackRate(cppValue);
  }
  
  static void playbackRateAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      HTMLMediaElementV8Internal::playbackRateAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void playedAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueFast(info, WTF::getPtr(impl->played()), impl);
  }
  
  static void playedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::playedAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void seekableAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueFast(info, WTF::getPtr(impl->seekable()), impl);
  }
  
  static void seekableAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::seekableAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void endedAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueBool(info, impl->ended());
  }
  
  static void endedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::endedAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void autoplayAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::autoplayAttr));
  }
  
  static void autoplayAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::autoplayAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void autoplayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "autoplay", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      impl->setBooleanAttribute(HTMLNames::autoplayAttr, cppValue);
  }
  
  static void autoplayAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      HTMLMediaElementV8Internal::autoplayAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void loopAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::loopAttr));
  }
  
  static void loopAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::loopAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void loopAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "loop", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      impl->setBooleanAttribute(HTMLNames::loopAttr, cppValue);
  }
  
  static void loopAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      HTMLMediaElementV8Internal::loopAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void mediaGroupAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      Element* impl = V8Element::toImpl(holder);
      v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::mediagroupAttr), info.GetIsolate());
  }
  
  static void mediaGroupAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::mediaGroupAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void mediaGroupAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      Element* impl = V8Element::toImpl(holder);
      V8StringResource<> cppValue = v8Value;
      if (!cppValue.prepare())
          return;
      impl->setAttribute(HTMLNames::mediagroupAttr, cppValue);
  }
  
  static void mediaGroupAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      HTMLMediaElementV8Internal::mediaGroupAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void controllerAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueFast(info, WTF::getPtr(impl->controller()), impl);
  }
  
  static void controllerAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::controllerAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void controllerAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "controller", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      MediaController* cppValue = V8MediaController::toImplWithTypeCheck(info.GetIsolate(), v8Value);
      if (!cppValue && !isUndefinedOrNull(v8Value)) {
          exceptionState.throwTypeError("The provided value is not of type 'MediaController'.");
          exceptionState.throwIfNeeded();
          return;
      }
      impl->setController(WTF::getPtr(cppValue));
  }
  
  static void controllerAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      HTMLMediaElementV8Internal::controllerAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void controlsAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::controlsAttr));
  }
  
  static void controlsAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::controlsAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void controlsAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "controls", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      impl->setBooleanAttribute(HTMLNames::controlsAttr, cppValue);
  }
  
  static void controlsAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      HTMLMediaElementV8Internal::controlsAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void volumeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValue(info, impl->volume());
  }
  
  static void volumeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::volumeAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void volumeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "volume", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      impl->setVolume(cppValue, exceptionState);
      exceptionState.throwIfNeeded();
  }
  
  static void volumeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      HTMLMediaElementV8Internal::volumeAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void mutedAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueBool(info, impl->muted());
  }
  
  static void mutedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::mutedAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void mutedAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "muted", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      impl->setMuted(cppValue);
  }
  
  static void mutedAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      HTMLMediaElementV8Internal::mutedAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void defaultMutedAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::mutedAttr));
  }
  
  static void defaultMutedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::defaultMutedAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void defaultMutedAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      ExceptionState exceptionState(ExceptionState::SetterContext, "defaultMuted", "HTMLMediaElement", holder, info.GetIsolate());
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
      if (exceptionState.throwIfNeeded())
          return;
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      impl->setBooleanAttribute(HTMLNames::mutedAttr, cppValue);
  }
  
  static void defaultMutedAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Value> v8Value = info[0];
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
      CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
      HTMLMediaElementV8Internal::defaultMutedAttributeSetter(v8Value, info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void audioTracksAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueFast(info, WTF::getPtr(impl->audioTracks()), impl);
  }
  
  static void audioTracksAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::audioTracksAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void videoTracksAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueFast(info, WTF::getPtr(impl->videoTracks()), impl);
  }
  
  static void videoTracksAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::videoTracksAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void textTracksAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueFast(info, WTF::getPtr(impl->textTracks()), impl);
  }
  
  static void textTracksAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      HTMLMediaElementV8Internal::textTracksAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void webkitAudioDecodedByteCountAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueUnsigned(info, impl->webkitAudioDecodedByteCount());
  }
  
  static void webkitAudioDecodedByteCountAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::PrefixedAudioDecodedByteCount);
      HTMLMediaElementV8Internal::webkitAudioDecodedByteCountAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void webkitVideoDecodedByteCountAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      v8::Local<v8::Object> holder = info.Holder();
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(holder);
      v8SetReturnValueUnsigned(info, impl->webkitVideoDecodedByteCount());
  }
  
  static void webkitVideoDecodedByteCountAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
      UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::PrefixedVideoDecodedByteCount);
      HTMLMediaElementV8Internal::webkitVideoDecodedByteCountAttributeGetter(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void loadMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(info.Holder());
      impl->load();
  }
  
  static void loadMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
      HTMLMediaElementV8Internal::loadMethod(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void canPlayType1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(info.Holder());
      V8StringResource<> type;
      {
          type = info[0];
          if (!type.prepare())
              return;
      }
      v8SetReturnValueString(info, impl->canPlayType(type), info.GetIsolate());
  }
  
  static void playMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(info.Holder());
      impl->play();
  }
  
  static void playMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
      HTMLMediaElementV8Internal::playMethod(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void pauseMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(info.Holder());
      impl->pause();
  }
  
  static void pauseMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
      HTMLMediaElementV8Internal::pauseMethod(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void addTextTrackMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      ExceptionState exceptionState(ExceptionState::ExecutionContext, "addTextTrack", "HTMLMediaElement", info.Holder(), info.GetIsolate());
      if (UNLIKELY(info.Length() < 1)) {
          setMinimumArityTypeError(exceptionState, 1, info.Length());
          exceptionState.throwIfNeeded();
          return;
      }
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(info.Holder());
      V8StringResource<> kind;
      V8StringResource<> label;
      V8StringResource<> language;
      {
          kind = info[0];
          if (!kind.prepare())
              return;
          static const char* validValues[] = {
              "subtitles",
              "captions",
              "descriptions",
              "chapters",
              "metadata",
          };
          if (!isValidEnum(kind, validValues, WTF_ARRAY_LENGTH(validValues), "TextTrackKind", exceptionState)) {
              exceptionState.throwIfNeeded();
              return;
          }
          if (!info[1]->IsUndefined()) {
              label = info[1];
              if (!label.prepare())
                  return;
          } else {
              label = String("");
          }
          if (!info[2]->IsUndefined()) {
              language = info[2];
              if (!language.prepare())
                  return;
          } else {
              language = String("");
          }
      }
      RefPtrWillBeRawPtr<TextTrack> result = impl->addTextTrack(kind, label, language, exceptionState);
      if (exceptionState.hadException()) {
          exceptionState.throwIfNeeded();
          return;
      }
      v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
  }
  
  static void addTextTrackMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
      HTMLMediaElementV8Internal::addTextTrackMethod(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  static void canPlayType2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(info.Holder());
      V8StringResource<> type;
      V8StringResource<TreatNullAndUndefinedAsNullString> keySystem;
      {
          type = info[0];
          if (!type.prepare())
              return;
          keySystem = info[1];
          if (!keySystem.prepare())
              return;
      }
      v8SetReturnValueString(info, impl->canPlayType(type, keySystem), info.GetIsolate());
  }
  
  static int canPlayTypeMethodMaxArg()
  {
      if (RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled()) {
          return 2;
      }
      return 1;
  }
  
  static void canPlayTypeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      ExceptionState exceptionState(ExceptionState::ExecutionContext, "canPlayType", "HTMLMediaElement", info.Holder(), info.GetIsolate());
      switch (std::min(HTMLMediaElementV8Internal::canPlayTypeMethodMaxArg(), info.Length())) {
      case 1:
          if (true) {
              canPlayType1Method(info);
              return;
          }
          break;
      case 2:
          if (RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled()) {
              if (true) {
                  UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::CanPlayTypeKeySystem);
                  canPlayType2Method(info);
                  return;
              }
          }
          break;
      default:
          break;
      }
      if (info.Length() < 1) {
          exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
          exceptionState.throwIfNeeded();
          return;
      }
      exceptionState.throwTypeError("No function was found that matched the signature provided.");
      exceptionState.throwIfNeeded();
      return;
  }
  
  static void canPlayTypeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
  {
      TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
      HTMLMediaElementV8Internal::canPlayTypeMethod(info);
      TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
  }
  
  } // namespace HTMLMediaElementV8Internal
  
  static const V8DOMConfiguration::AccessorConfiguration V8HTMLMediaElementAccessors[] = {
      {"error", HTMLMediaElementV8Internal::errorAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"src", HTMLMediaElementV8Internal::srcAttributeGetterCallback, HTMLMediaElementV8Internal::srcAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"currentSrc", HTMLMediaElementV8Internal::currentSrcAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"crossOrigin", HTMLMediaElementV8Internal::crossOriginAttributeGetterCallback, HTMLMediaElementV8Internal::crossOriginAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"networkState", HTMLMediaElementV8Internal::networkStateAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"preload", HTMLMediaElementV8Internal::preloadAttributeGetterCallback, HTMLMediaElementV8Internal::preloadAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"buffered", HTMLMediaElementV8Internal::bufferedAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"readyState", HTMLMediaElementV8Internal::readyStateAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"seeking", HTMLMediaElementV8Internal::seekingAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"currentTime", HTMLMediaElementV8Internal::currentTimeAttributeGetterCallback, HTMLMediaElementV8Internal::currentTimeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"duration", HTMLMediaElementV8Internal::durationAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"paused", HTMLMediaElementV8Internal::pausedAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"defaultPlaybackRate", HTMLMediaElementV8Internal::defaultPlaybackRateAttributeGetterCallback, HTMLMediaElementV8Internal::defaultPlaybackRateAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"playbackRate", HTMLMediaElementV8Internal::playbackRateAttributeGetterCallback, HTMLMediaElementV8Internal::playbackRateAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"played", HTMLMediaElementV8Internal::playedAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"seekable", HTMLMediaElementV8Internal::seekableAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"ended", HTMLMediaElementV8Internal::endedAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"autoplay", HTMLMediaElementV8Internal::autoplayAttributeGetterCallback, HTMLMediaElementV8Internal::autoplayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"loop", HTMLMediaElementV8Internal::loopAttributeGetterCallback, HTMLMediaElementV8Internal::loopAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"controls", HTMLMediaElementV8Internal::controlsAttributeGetterCallback, HTMLMediaElementV8Internal::controlsAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"volume", HTMLMediaElementV8Internal::volumeAttributeGetterCallback, HTMLMediaElementV8Internal::volumeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"muted", HTMLMediaElementV8Internal::mutedAttributeGetterCallback, HTMLMediaElementV8Internal::mutedAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"defaultMuted", HTMLMediaElementV8Internal::defaultMutedAttributeGetterCallback, HTMLMediaElementV8Internal::defaultMutedAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"textTracks", HTMLMediaElementV8Internal::textTracksAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"webkitAudioDecodedByteCount", HTMLMediaElementV8Internal::webkitAudioDecodedByteCountAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
      {"webkitVideoDecodedByteCount", HTMLMediaElementV8Internal::webkitVideoDecodedByteCountAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
  };
  
  static const V8DOMConfiguration::MethodConfiguration V8HTMLMediaElementMethods[] = {
      {"load", HTMLMediaElementV8Internal::loadMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
      {"play", HTMLMediaElementV8Internal::playMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
      {"pause", HTMLMediaElementV8Internal::pauseMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
      {"addTextTrack", HTMLMediaElementV8Internal::addTextTrackMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
      {"canPlayType", HTMLMediaElementV8Internal::canPlayTypeMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
  };
  
  void V8HTMLMediaElement::installV8HTMLMediaElementTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
  {
      functionTemplate->ReadOnlyPrototype();
  
      v8::Local<v8::Signature> defaultSignature;
      if (!RuntimeEnabledFeatures::mediaEnabled())
          defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "HTMLMediaElement", V8HTMLElement::domTemplate(isolate), V8HTMLMediaElement::internalFieldCount, 0, 0, 0, 0, 0, 0);
      else
          defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "HTMLMediaElement", V8HTMLElement::domTemplate(isolate), V8HTMLMediaElement::internalFieldCount,
              0, 0,
              V8HTMLMediaElementAccessors, WTF_ARRAY_LENGTH(V8HTMLMediaElementAccessors),
              V8HTMLMediaElementMethods, WTF_ARRAY_LENGTH(V8HTMLMediaElementMethods));
      v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
      ALLOW_UNUSED_LOCAL(instanceTemplate);
      v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
      ALLOW_UNUSED_LOCAL(prototypeTemplate);
      if (RuntimeEnabledFeatures::mediaControllerEnabled()) {
          static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =\
          {"mediaGroup", HTMLMediaElementV8Internal::mediaGroupAttributeGetterCallback, HTMLMediaElementV8Internal::mediaGroupAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder};
          V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorConfiguration);
      }
      if (RuntimeEnabledFeatures::mediaControllerEnabled()) {
          static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =\
          {"controller", HTMLMediaElementV8Internal::controllerAttributeGetterCallback, HTMLMediaElementV8Internal::controllerAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder};
          V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorConfiguration);
      }
      if (RuntimeEnabledFeatures::audioVideoTracksEnabled()) {
          static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =\
          {"audioTracks", HTMLMediaElementV8Internal::audioTracksAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder};
          V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorConfiguration);
      }
      if (RuntimeEnabledFeatures::audioVideoTracksEnabled()) {
          static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =\
          {"videoTracks", HTMLMediaElementV8Internal::videoTracksAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder};
          V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorConfiguration);
      }
      static const V8DOMConfiguration::ConstantConfiguration V8HTMLMediaElementConstants[] = {
          {"NETWORK_EMPTY", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
          {"NETWORK_IDLE", 1, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
          {"NETWORK_LOADING", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
          {"NETWORK_NO_SOURCE", 3, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
          {"HAVE_NOTHING", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
          {"HAVE_METADATA", 1, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
          {"HAVE_CURRENT_DATA", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
          {"HAVE_FUTURE_DATA", 3, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
          {"HAVE_ENOUGH_DATA", 4, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
      };
      V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTemplate, V8HTMLMediaElementConstants, WTF_ARRAY_LENGTH(V8HTMLMediaElementConstants));
      static_assert(0 == HTMLMediaElement::NETWORK_EMPTY, "the value of HTMLMediaElement_NETWORK_EMPTY does not match with implementation");
      static_assert(1 == HTMLMediaElement::NETWORK_IDLE, "the value of HTMLMediaElement_NETWORK_IDLE does not match with implementation");
      static_assert(2 == HTMLMediaElement::NETWORK_LOADING, "the value of HTMLMediaElement_NETWORK_LOADING does not match with implementation");
      static_assert(3 == HTMLMediaElement::NETWORK_NO_SOURCE, "the value of HTMLMediaElement_NETWORK_NO_SOURCE does not match with implementation");
      static_assert(0 == HTMLMediaElement::HAVE_NOTHING, "the value of HTMLMediaElement_HAVE_NOTHING does not match with implementation");
      static_assert(1 == HTMLMediaElement::HAVE_METADATA, "the value of HTMLMediaElement_HAVE_METADATA does not match with implementation");
      static_assert(2 == HTMLMediaElement::HAVE_CURRENT_DATA, "the value of HTMLMediaElement_HAVE_CURRENT_DATA does not match with implementation");
      static_assert(3 == HTMLMediaElement::HAVE_FUTURE_DATA, "the value of HTMLMediaElement_HAVE_FUTURE_DATA does not match with implementation");
      static_assert(4 == HTMLMediaElement::HAVE_ENOUGH_DATA, "the value of HTMLMediaElement_HAVE_ENOUGH_DATA does not match with implementation");
  
      // Custom toString template
      functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
  }
  
  v8::Local<v8::FunctionTemplate> V8HTMLMediaElement::domTemplate(v8::Isolate* isolate)
  {
      ASSERT(V8HTMLMediaElement::installV8HTMLMediaElementTemplateFunction != V8HTMLMediaElement::installV8HTMLMediaElementTemplate);
      return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), V8HTMLMediaElement::installV8HTMLMediaElementTemplateFunction);
  }
  
  bool V8HTMLMediaElement::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
  {
      return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
  }
  
  v8::Local<v8::Object> V8HTMLMediaElement::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
  {
      return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
  }
  
  HTMLMediaElement* V8HTMLMediaElement::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
  {
      return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0;
  }
  
  ActiveDOMObject* V8HTMLMediaElement::toActiveDOMObject(v8::Local<v8::Object> wrapper)
  {
      return toImpl(wrapper);
  }
  
  void V8HTMLMediaElement::refObject(ScriptWrappable* scriptWrappable)
  {
  #if !ENABLE(OILPAN)
      scriptWrappable->toImpl<HTMLMediaElement>()->ref();
  #endif
  }
  
  void V8HTMLMediaElement::derefObject(ScriptWrappable* scriptWrappable)
  {
  #if !ENABLE(OILPAN)
      scriptWrappable->toImpl<HTMLMediaElement>()->deref();
  #endif
  }
  
  InstallTemplateFunction V8HTMLMediaElement::installV8HTMLMediaElementTemplateFunction = (InstallTemplateFunction)&V8HTMLMediaElement::installV8HTMLMediaElementTemplate;
  
  void V8HTMLMediaElement::updateWrapperTypeInfo(InstallTemplateFunction installTemplateFunction, PreparePrototypeObjectFunction preparePrototypeObjectFunction)
  {
      V8HTMLMediaElement::installV8HTMLMediaElementTemplateFunction = installTemplateFunction;
      if (preparePrototypeObjectFunction)
          V8HTMLMediaElement::wrapperTypeInfo.preparePrototypeObjectFunction = preparePrototypeObjectFunction;
  }
  
  } // namespace blink
  