Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: Source/core/html/HTMLVideoElement.cpp

Issue 32103002: Use MeasureAs and ImplementedAs in media IDL (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: accidentally dropped two UseCounters Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/HTMLVideoElement.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 213
214 bool HTMLVideoElement::hasAvailableVideoFrame() const 214 bool HTMLVideoElement::hasAvailableVideoFrame() const
215 { 215 {
216 if (!player()) 216 if (!player())
217 return false; 217 return false;
218 218
219 return player()->hasVideo() && player()->readyState() >= MediaPlayer::HaveCu rrentData; 219 return player()->hasVideo() && player()->readyState() >= MediaPlayer::HaveCu rrentData;
220 } 220 }
221 221
222 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& es, UseCounter::Fea ture feature) 222 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& es)
223 { 223 {
224 UseCounter::count(document(), feature);
225
226 if (isFullscreen()) 224 if (isFullscreen())
227 return; 225 return;
228 226
229 // Generate an exception if this isn't called in response to a user gesture, or if the 227 // Generate an exception if this isn't called in response to a user gesture, or if the
230 // element does not support fullscreen. 228 // element does not support fullscreen.
231 if ((userGestureRequiredForFullscreen() && !UserGestureIndicator::processing UserGesture()) || !supportsFullscreen()) { 229 if ((userGestureRequiredForFullscreen() && !UserGestureIndicator::processing UserGesture()) || !supportsFullscreen()) {
232 es.throwUninformativeAndGenericDOMException(InvalidStateError); 230 es.throwUninformativeAndGenericDOMException(InvalidStateError);
233 return; 231 return;
234 } 232 }
235 233
236 enterFullscreen(); 234 enterFullscreen();
237 } 235 }
238 236
239 void HTMLVideoElement::webkitExitFullscreen(UseCounter::Feature feature) 237 void HTMLVideoElement::webkitExitFullscreen()
240 { 238 {
241 UseCounter::count(document(), feature);
242 if (isFullscreen()) 239 if (isFullscreen())
243 exitFullscreen(); 240 exitFullscreen();
244 } 241 }
245 242
246 bool HTMLVideoElement::webkitSupportsFullscreen() 243 bool HTMLVideoElement::webkitSupportsFullscreen()
247 { 244 {
248 UseCounter::count(document(), UseCounter::PrefixedVideoSupportsFullscreen);
249 return supportsFullscreen(); 245 return supportsFullscreen();
250 } 246 }
251 247
252 bool HTMLVideoElement::webkitDisplayingFullscreen() 248 bool HTMLVideoElement::webkitDisplayingFullscreen()
253 { 249 {
254 UseCounter::count(document(), UseCounter::PrefixedVideoDisplayingFullscreen) ;
255 return isFullscreen(); 250 return isFullscreen();
256 } 251 }
257 252
258 void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument) 253 void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument)
259 { 254 {
260 if (m_imageLoader) 255 if (m_imageLoader)
261 m_imageLoader->elementDidMoveToNewDocument(); 256 m_imageLoader->elementDidMoveToNewDocument();
262 HTMLMediaElement::didMoveToNewDocument(oldDocument); 257 HTMLMediaElement::didMoveToNewDocument(oldDocument);
263 } 258 }
264 259
265 unsigned HTMLVideoElement::webkitDecodedFrameCount() const 260 unsigned HTMLVideoElement::webkitDecodedFrameCount() const
266 { 261 {
267 UseCounter::count(document(), UseCounter::PrefixedVideoDecodedFrameCount);
268
269 if (!player()) 262 if (!player())
270 return 0; 263 return 0;
271 264
272 return player()->decodedFrameCount(); 265 return player()->decodedFrameCount();
273 } 266 }
274 267
275 unsigned HTMLVideoElement::webkitDroppedFrameCount() const 268 unsigned HTMLVideoElement::webkitDroppedFrameCount() const
276 { 269 {
277 UseCounter::count(document(), UseCounter::PrefixedVideoDroppedFrameCount);
278
279 if (!player()) 270 if (!player())
280 return 0; 271 return 0;
281 272
282 return player()->droppedFrameCount(); 273 return player()->droppedFrameCount();
283 } 274 }
284 275
285 KURL HTMLVideoElement::posterImageURL() const 276 KURL HTMLVideoElement::posterImageURL() const
286 { 277 {
287 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); 278 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL());
288 if (url.isEmpty()) 279 if (url.isEmpty())
289 return KURL(); 280 return KURL();
290 return document().completeURL(url); 281 return document().completeURL(url);
291 } 282 }
292 283
293 } 284 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/HTMLVideoElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698