Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/html/HTMLVideoElement.h" | 27 #include "core/html/HTMLVideoElement.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "bindings/core/v8/PrivateScriptRunner.h" | |
| 31 #include "bindings/core/v8/V8HTMLVideoElement.h" | |
| 30 #include "core/CSSPropertyNames.h" | 32 #include "core/CSSPropertyNames.h" |
| 31 #include "core/HTMLNames.h" | 33 #include "core/HTMLNames.h" |
| 34 #include "core/dom/ActiveDOMObject.h" | |
| 32 #include "core/dom/Attribute.h" | 35 #include "core/dom/Attribute.h" |
| 33 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 34 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
| 35 #include "core/dom/shadow/ShadowRoot.h" | 38 #include "core/dom/shadow/ShadowRoot.h" |
| 36 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
| 37 #include "core/html/HTMLImageLoader.h" | 40 #include "core/html/HTMLImageLoader.h" |
| 38 #include "core/html/canvas/CanvasRenderingContext.h" | 41 #include "core/html/canvas/CanvasRenderingContext.h" |
| 39 #include "core/html/parser/HTMLParserIdioms.h" | 42 #include "core/html/parser/HTMLParserIdioms.h" |
| 40 #include "core/rendering/RenderImage.h" | 43 #include "core/rendering/RenderImage.h" |
| 41 #include "core/rendering/RenderVideo.h" | 44 #include "core/rendering/RenderVideo.h" |
| 42 #include "platform/UserGestureIndicator.h" | 45 #include "platform/UserGestureIndicator.h" |
| 43 #include "platform/graphics/GraphicsContext.h" | 46 #include "platform/graphics/GraphicsContext.h" |
| 44 #include "platform/graphics/gpu/Extensions3DUtil.h" | 47 #include "platform/graphics/gpu/Extensions3DUtil.h" |
| 45 #include "public/platform/WebCanvas.h" | 48 #include "public/platform/WebCanvas.h" |
| 46 #include "public/platform/WebGraphicsContext3D.h" | 49 #include "public/platform/WebGraphicsContext3D.h" |
| 47 | 50 |
| 48 namespace blink { | 51 namespace blink { |
| 49 | 52 |
| 50 using namespace HTMLNames; | 53 using namespace HTMLNames; |
| 51 | 54 |
| 52 inline HTMLVideoElement::HTMLVideoElement(Document& document) | 55 inline HTMLVideoElement::HTMLVideoElement(Document& document) |
| 53 : HTMLMediaElement(videoTag, document) | 56 : HTMLMediaElement(videoTag, document) |
| 54 { | 57 { |
| 55 ScriptWrappable::init(this); | 58 ScriptWrappable::init(this); |
| 59 //v8::Handle<v8::Value> classObject = PrivateScriptRunner::installClassIfNee ded(document.frame(), "HTMLVideoElement"); | |
| 60 //RELEASE_ASSERT(!classObject.IsEmpty()); | |
|
haraken
2014/08/11 11:09:33
I guess this won't be needed.
| |
| 56 if (document.settings()) | 61 if (document.settings()) |
| 57 m_defaultPosterURL = AtomicString(document.settings()->defaultVideoPoste rURL()); | 62 m_defaultPosterURL = AtomicString(document.settings()->defaultVideoPoste rURL()); |
| 58 } | 63 } |
| 59 | 64 |
| 60 PassRefPtrWillBeRawPtr<HTMLVideoElement> HTMLVideoElement::create(Document& docu ment) | 65 PassRefPtrWillBeRawPtr<HTMLVideoElement> HTMLVideoElement::create(Document& docu ment) |
| 61 { | 66 { |
| 62 RefPtrWillBeRawPtr<HTMLVideoElement> video = adoptRefWillBeNoop(new HTMLVide oElement(document)); | 67 RefPtrWillBeRawPtr<HTMLVideoElement> video = adoptRefWillBeNoop(new HTMLVide oElement(document)); |
| 63 video->ensureUserAgentShadowRoot(); | 68 video->ensureUserAgentShadowRoot(); |
| 64 video->suspendIfNeeded(); | 69 video->suspendIfNeeded(); |
| 70 ScriptForbiddenScope::AllowUserAgentScript script; | |
|
haraken
2014/08/11 11:09:33
What is this for?
| |
| 65 return video.release(); | 71 return video.release(); |
| 66 } | 72 } |
| 67 | 73 |
| 68 void HTMLVideoElement::trace(Visitor* visitor) | 74 void HTMLVideoElement::trace(Visitor* visitor) |
| 69 { | 75 { |
| 70 visitor->trace(m_imageLoader); | 76 visitor->trace(m_imageLoader); |
| 71 HTMLMediaElement::trace(visitor); | 77 HTMLMediaElement::trace(visitor); |
| 72 } | 78 } |
| 73 | 79 |
| 74 bool HTMLVideoElement::rendererIsNeeded(const RenderStyle& style) | 80 bool HTMLVideoElement::rendererIsNeeded(const RenderStyle& style) |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 { | 323 { |
| 318 return !hasSingleSecurityOrigin() || (!(webMediaPlayer() && webMediaPlayer() ->didPassCORSAccessCheck()) && destinationSecurityOrigin->taintsCanvas(currentSr c())); | 324 return !hasSingleSecurityOrigin() || (!(webMediaPlayer() && webMediaPlayer() ->didPassCORSAccessCheck()) && destinationSecurityOrigin->taintsCanvas(currentSr c())); |
| 319 } | 325 } |
| 320 | 326 |
| 321 FloatSize HTMLVideoElement::sourceSize() const | 327 FloatSize HTMLVideoElement::sourceSize() const |
| 322 { | 328 { |
| 323 return FloatSize(videoWidth(), videoHeight()); | 329 return FloatSize(videoWidth(), videoHeight()); |
| 324 } | 330 } |
| 325 | 331 |
| 326 } | 332 } |
| OLD | NEW |