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 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 player()->setPoster(posterImageURL()); | 119 player()->setPoster(posterImageURL()); |
| 120 } else | 120 } else |
| 121 HTMLMediaElement::parseAttribute(name, value); | 121 HTMLMediaElement::parseAttribute(name, value); |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool HTMLVideoElement::supportsFullscreen() const | 124 bool HTMLVideoElement::supportsFullscreen() const |
| 125 { | 125 { |
| 126 if (!document().page()) | 126 if (!document().page()) |
| 127 return false; | 127 return false; |
| 128 | 128 |
| 129 if (!player()) | 129 if (!webMediaPlayer()) |
| 130 return false; | 130 return false; |
| 131 | 131 |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 unsigned HTMLVideoElement::videoWidth() const | 135 unsigned HTMLVideoElement::videoWidth() const |
| 136 { | 136 { |
| 137 if (!player()) | 137 if (!webMediaPlayer()) |
| 138 return 0; | 138 return 0; |
| 139 return player()->naturalSize().width(); | 139 IntSize playerSize = webMediaPlayer()->naturalSize(); |
| 140 return playerSize.width(); | |
| 140 } | 141 } |
| 141 | 142 |
| 142 unsigned HTMLVideoElement::videoHeight() const | 143 unsigned HTMLVideoElement::videoHeight() const |
| 143 { | 144 { |
| 144 if (!player()) | 145 if (!webMediaPlayer()) |
| 145 return 0; | 146 return 0; |
| 146 return player()->naturalSize().height(); | 147 IntSize playerSize = webMediaPlayer()->naturalSize(); |
| 148 return playerSize.height(); | |
| 147 } | 149 } |
| 148 | 150 |
| 149 bool HTMLVideoElement::isURLAttribute(const Attribute& attribute) const | 151 bool HTMLVideoElement::isURLAttribute(const Attribute& attribute) const |
| 150 { | 152 { |
| 151 return attribute.name() == posterAttr || HTMLMediaElement::isURLAttribute(at tribute); | 153 return attribute.name() == posterAttr || HTMLMediaElement::isURLAttribute(at tribute); |
| 152 } | 154 } |
| 153 | 155 |
| 154 const AtomicString HTMLVideoElement::imageSourceURL() const | 156 const AtomicString HTMLVideoElement::imageSourceURL() const |
| 155 { | 157 { |
| 156 const AtomicString& url = getAttribute(posterAttr); | 158 const AtomicString& url = getAttribute(posterAttr); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 | 199 |
| 198 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(blink::WebGraphicsConte xt3D* context, Platform3DObject texture, GLint level, GLenum type, GLenum intern alFormat, bool premultiplyAlpha, bool flipY) | 200 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(blink::WebGraphicsConte xt3D* context, Platform3DObject texture, GLint level, GLenum type, GLenum intern alFormat, bool premultiplyAlpha, bool flipY) |
| 199 { | 201 { |
| 200 if (!player()) | 202 if (!player()) |
| 201 return false; | 203 return false; |
| 202 return player()->copyVideoTextureToPlatformTexture(context, texture, level, type, internalFormat, premultiplyAlpha, flipY); | 204 return player()->copyVideoTextureToPlatformTexture(context, texture, level, type, internalFormat, premultiplyAlpha, flipY); |
| 203 } | 205 } |
| 204 | 206 |
| 205 bool HTMLVideoElement::hasAvailableVideoFrame() const | 207 bool HTMLVideoElement::hasAvailableVideoFrame() const |
| 206 { | 208 { |
| 207 if (!player()) | 209 if (!webMediaPlayer()) |
| 208 return false; | 210 return false; |
| 209 | 211 |
| 210 return player()->hasVideo() && player()->readyState() >= MediaPlayer::HaveCu rrentData; | 212 return webMediaPlayer()->hasVideo() && static_cast<MediaPlayer::ReadyState>( webMediaPlayer()->readyState()) >= MediaPlayer::HaveCurrentData; |
|
acolwell GONE FROM CHROMIUM
2014/05/19 16:57:53
MediaPlayer is going away so this should be change
| |
| 211 } | 213 } |
| 212 | 214 |
| 213 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState) | 215 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState) |
| 214 { | 216 { |
| 215 if (isFullscreen()) | 217 if (isFullscreen()) |
| 216 return; | 218 return; |
| 217 | 219 |
| 218 if (!supportsFullscreen()) { | 220 if (!supportsFullscreen()) { |
| 219 exceptionState.throwDOMException(InvalidStateError, "This element does n ot support fullscreen mode."); | 221 exceptionState.throwDOMException(InvalidStateError, "This element does n ot support fullscreen mode."); |
| 220 return; | 222 return; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 241 | 243 |
| 242 void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument) | 244 void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument) |
| 243 { | 245 { |
| 244 if (m_imageLoader) | 246 if (m_imageLoader) |
| 245 m_imageLoader->elementDidMoveToNewDocument(); | 247 m_imageLoader->elementDidMoveToNewDocument(); |
| 246 HTMLMediaElement::didMoveToNewDocument(oldDocument); | 248 HTMLMediaElement::didMoveToNewDocument(oldDocument); |
| 247 } | 249 } |
| 248 | 250 |
| 249 unsigned HTMLVideoElement::webkitDecodedFrameCount() const | 251 unsigned HTMLVideoElement::webkitDecodedFrameCount() const |
| 250 { | 252 { |
| 251 if (!player()) | 253 if (!webMediaPlayer()) |
| 252 return 0; | 254 return 0; |
| 253 | 255 |
| 254 return player()->decodedFrameCount(); | 256 return webMediaPlayer()->decodedFrameCount(); |
| 255 } | 257 } |
| 256 | 258 |
| 257 unsigned HTMLVideoElement::webkitDroppedFrameCount() const | 259 unsigned HTMLVideoElement::webkitDroppedFrameCount() const |
| 258 { | 260 { |
| 259 if (!player()) | 261 if (!webMediaPlayer()) |
| 260 return 0; | 262 return 0; |
| 261 | 263 |
| 262 return player()->droppedFrameCount(); | 264 return webMediaPlayer()->droppedFrameCount(); |
| 263 } | 265 } |
| 264 | 266 |
| 265 KURL HTMLVideoElement::posterImageURL() const | 267 KURL HTMLVideoElement::posterImageURL() const |
| 266 { | 268 { |
| 267 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); | 269 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); |
| 268 if (url.isEmpty()) | 270 if (url.isEmpty()) |
| 269 return KURL(); | 271 return KURL(); |
| 270 return document().completeURL(url); | 272 return document().completeURL(url); |
| 271 } | 273 } |
| 272 | 274 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 290 } | 292 } |
| 291 | 293 |
| 292 paintCurrentFrameInContext(imageBuffer->context(), IntRect(IntPoint(0, 0), i ntrinsicSize)); | 294 paintCurrentFrameInContext(imageBuffer->context(), IntRect(IntPoint(0, 0), i ntrinsicSize)); |
| 293 | 295 |
| 294 *status = NormalSourceImageStatus; | 296 *status = NormalSourceImageStatus; |
| 295 return imageBuffer->copyImage(mode == CopySourceImageIfVolatile ? CopyBackin gStore : DontCopyBackingStore, Unscaled); | 297 return imageBuffer->copyImage(mode == CopySourceImageIfVolatile ? CopyBackin gStore : DontCopyBackingStore, Unscaled); |
| 296 } | 298 } |
| 297 | 299 |
| 298 bool HTMLVideoElement::wouldTaintOrigin(SecurityOrigin* destinationSecurityOrigi n) const | 300 bool HTMLVideoElement::wouldTaintOrigin(SecurityOrigin* destinationSecurityOrigi n) const |
| 299 { | 301 { |
| 300 return !hasSingleSecurityOrigin() || (!(player() && player()->didPassCORSAcc essCheck()) && destinationSecurityOrigin->taintsCanvas(currentSrc())); | 302 return !hasSingleSecurityOrigin() || (!(webMediaPlayer() && webMediaPlayer() ->didPassCORSAccessCheck()) && destinationSecurityOrigin->taintsCanvas(currentSr c())); |
| 301 } | 303 } |
| 302 | 304 |
| 303 FloatSize HTMLVideoElement::sourceSize() const | 305 FloatSize HTMLVideoElement::sourceSize() const |
| 304 { | 306 { |
| 305 return FloatSize(videoWidth(), videoHeight()); | 307 return FloatSize(videoWidth(), videoHeight()); |
| 306 } | 308 } |
| 307 | 309 |
| 308 } | 310 } |
| OLD | NEW |