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

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

Issue 26270004: Element should not use confusingAndOftenMisusedAttached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/rendering/RenderVideo.cpp » ('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, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 , m_displayMode(Unknown) 265 , m_displayMode(Unknown)
266 , m_cachedTime(MediaPlayer::invalidTime()) 266 , m_cachedTime(MediaPlayer::invalidTime())
267 , m_cachedTimeWallClockUpdateTime(0) 267 , m_cachedTimeWallClockUpdateTime(0)
268 , m_minimumWallClockTimeToCacheMediaTime(0) 268 , m_minimumWallClockTimeToCacheMediaTime(0)
269 , m_fragmentStartTime(MediaPlayer::invalidTime()) 269 , m_fragmentStartTime(MediaPlayer::invalidTime())
270 , m_fragmentEndTime(MediaPlayer::invalidTime()) 270 , m_fragmentEndTime(MediaPlayer::invalidTime())
271 , m_pendingActionFlags(0) 271 , m_pendingActionFlags(0)
272 , m_playing(false) 272 , m_playing(false)
273 , m_shouldDelayLoadEvent(false) 273 , m_shouldDelayLoadEvent(false)
274 , m_haveFiredLoadedData(false) 274 , m_haveFiredLoadedData(false)
275 , m_inActiveDocument(true) 275 , m_active(true)
276 , m_autoplaying(true) 276 , m_autoplaying(true)
277 , m_muted(false) 277 , m_muted(false)
278 , m_paused(true) 278 , m_paused(true)
279 , m_seeking(false) 279 , m_seeking(false)
280 , m_sentStalledEvent(false) 280 , m_sentStalledEvent(false)
281 , m_sentEndEvent(false) 281 , m_sentEndEvent(false)
282 , m_pausedInternal(false) 282 , m_pausedInternal(false)
283 , m_sendProgressEvents(true) 283 , m_sendProgressEvents(true)
284 , m_closedCaptionsVisible(false) 284 , m_closedCaptionsVisible(false)
285 , m_loadInitiatedByUserGesture(false) 285 , m_loadInitiatedByUserGesture(false)
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 { 479 {
480 return hasMediaControls() && HTMLElement::childShouldCreateRenderer(child); 480 return hasMediaControls() && HTMLElement::childShouldCreateRenderer(child);
481 } 481 }
482 482
483 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode* insertionPoint) 483 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode* insertionPoint)
484 { 484 {
485 LOG(Media, "HTMLMediaElement::insertedInto"); 485 LOG(Media, "HTMLMediaElement::insertedInto");
486 486
487 HTMLElement::insertedInto(insertionPoint); 487 HTMLElement::insertedInto(insertionPoint);
488 if (insertionPoint->inDocument()) { 488 if (insertionPoint->inDocument()) {
489 m_inActiveDocument = true; 489 m_active = true;
490 490
491 if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY) 491 if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY)
492 scheduleDelayedAction(LoadMediaResource); 492 scheduleDelayedAction(LoadMediaResource);
493 } 493 }
494 494
495 configureMediaControls(); 495 configureMediaControls();
496 return InsertionDone; 496 return InsertionDone;
497 } 497 }
498 498
499 void HTMLMediaElement::removedFrom(ContainerNode* insertionPoint) 499 void HTMLMediaElement::removedFrom(ContainerNode* insertionPoint)
500 { 500 {
501 LOG(Media, "HTMLMediaElement::removedFrom"); 501 LOG(Media, "HTMLMediaElement::removedFrom");
502 502
503 m_inActiveDocument = false; 503 m_active = false;
504 if (insertionPoint->inDocument()) { 504 if (insertionPoint->inDocument()) {
505 configureMediaControls(); 505 configureMediaControls();
506 if (m_networkState > NETWORK_EMPTY) 506 if (m_networkState > NETWORK_EMPTY)
507 pause(); 507 pause();
508 } 508 }
509 509
510 HTMLElement::removedFrom(insertionPoint); 510 HTMLElement::removedFrom(insertionPoint);
511 } 511 }
512 512
513 void HTMLMediaElement::attach(const AttachContext& context) 513 void HTMLMediaElement::attach(const AttachContext& context)
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 1217
1218 void HTMLMediaElement::beginIgnoringTrackDisplayUpdateRequests() 1218 void HTMLMediaElement::beginIgnoringTrackDisplayUpdateRequests()
1219 { 1219 {
1220 ++m_ignoreTrackDisplayUpdate; 1220 ++m_ignoreTrackDisplayUpdate;
1221 } 1221 }
1222 1222
1223 void HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests() 1223 void HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests()
1224 { 1224 {
1225 ASSERT(m_ignoreTrackDisplayUpdate); 1225 ASSERT(m_ignoreTrackDisplayUpdate);
1226 --m_ignoreTrackDisplayUpdate; 1226 --m_ignoreTrackDisplayUpdate;
1227 if (!m_ignoreTrackDisplayUpdate && m_inActiveDocument) 1227 if (!m_ignoreTrackDisplayUpdate && m_active)
1228 updateActiveTextTrackCues(currentTime()); 1228 updateActiveTextTrackCues(currentTime());
1229 } 1229 }
1230 1230
1231 void HTMLMediaElement::textTrackAddCues(TextTrack* track, const TextTrackCueList * cues) 1231 void HTMLMediaElement::textTrackAddCues(TextTrack* track, const TextTrackCueList * cues)
1232 { 1232 {
1233 LOG(Media, "HTMLMediaElement::textTrackAddCues"); 1233 LOG(Media, "HTMLMediaElement::textTrackAddCues");
1234 if (track->mode() == TextTrack::disabledKeyword()) 1234 if (track->mode() == TextTrack::disabledKeyword())
1235 return; 1235 return;
1236 1236
1237 TrackDisplayUpdateScope scope(this); 1237 TrackDisplayUpdateScope scope(this);
(...skipping 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after
3404 m_loadState = WaitingForSource; 3404 m_loadState = WaitingForSource;
3405 3405
3406 if (m_textTracks) 3406 if (m_textTracks)
3407 configureTextTrackDisplay(AssumeNoVisibleChange); 3407 configureTextTrackDisplay(AssumeNoVisibleChange);
3408 } 3408 }
3409 3409
3410 void HTMLMediaElement::stop() 3410 void HTMLMediaElement::stop()
3411 { 3411 {
3412 LOG(Media, "HTMLMediaElement::stop"); 3412 LOG(Media, "HTMLMediaElement::stop");
3413 3413
3414 m_inActiveDocument = false; 3414 m_active = false;
3415 userCancelledLoad(); 3415 userCancelledLoad();
3416 3416
3417 // Stop the playback without generating events 3417 // Stop the playback without generating events
3418 m_playing = false; 3418 m_playing = false;
3419 setPausedInternal(true); 3419 setPausedInternal(true);
3420 3420
3421 if (renderer()) 3421 if (renderer())
3422 renderer()->updateFromElement(); 3422 renderer()->updateFromElement();
3423 3423
3424 stopPeriodicTimers(); 3424 stopPeriodicTimers();
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
3870 { 3870 {
3871 scheduleLayerUpdate(); 3871 scheduleLayerUpdate();
3872 } 3872 }
3873 3873
3874 bool HTMLMediaElement::isInteractiveContent() const 3874 bool HTMLMediaElement::isInteractiveContent() const
3875 { 3875 {
3876 return fastHasAttribute(controlsAttr); 3876 return fastHasAttribute(controlsAttr);
3877 } 3877 }
3878 3878
3879 } 3879 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/rendering/RenderVideo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698