| Index: Source/bindings/core/v8/custom/V8HTMLMediaElementCustom.cpp
|
| diff --git a/Source/bindings/core/v8/custom/V8HTMLMediaElementCustom.cpp b/Source/bindings/core/v8/custom/V8HTMLMediaElementCustom.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..85c2a27f5ceac5cc64e625516e3f1ed1af27f804
|
| --- /dev/null
|
| +++ b/Source/bindings/core/v8/custom/V8HTMLMediaElementCustom.cpp
|
| @@ -0,0 +1,35 @@
|
| +// 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.
|
| +
|
| +#include "config.h"
|
| +#include "bindings/core/v8/V8HTMLMediaElement.h"
|
| +
|
| +#include "bindings/core/v8/ScriptState.h"
|
| +#include "bindings/core/v8/ScriptValue.h"
|
| +#include "core/html/MediaProvider.h"
|
| +
|
| +namespace blink {
|
| +
|
| +static v8::Handle<v8::Value> toV8Object(MediaProvider* provider, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
| +{
|
| + if (provider && provider->eventTarget())
|
| + return toV8(provider->eventTarget(), creationContext, isolate);
|
| +
|
| + return v8Undefined();
|
| +}
|
| +
|
| +void blink::V8HTMLMediaElement::srcObjectAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +{
|
| + HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(info.Holder());
|
| + v8SetReturnValue(info, toV8Object(impl->srcObject(), info.Holder(), info.GetIsolate()));
|
| +}
|
| +
|
| +void blink::V8HTMLMediaElement::srcObjectAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
|
| +{
|
| + HTMLMediaElement* impl = V8HTMLMediaElement::toImpl(info.Holder());
|
| + ScriptValue scriptValue(ScriptState::current(info.GetIsolate()), value);
|
| + impl->setSrcObject(MediaProvider::convert(scriptValue));
|
| +}
|
| +
|
| +} // namespace blink
|
|
|