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

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

Issue 2856783002: Autoplay time metric (Closed)
Patch Set: comments addressed Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 << "), nothing to load"; 1021 << "), nothing to load";
1022 return; 1022 return;
1023 } 1023 }
1024 1024
1025 // 7 - Set the media element's networkState to NETWORK_LOADING. 1025 // 7 - Set the media element's networkState to NETWORK_LOADING.
1026 SetNetworkState(kNetworkLoading); 1026 SetNetworkState(kNetworkLoading);
1027 1027
1028 // 8 - Queue a task to fire a simple event named loadstart at the media 1028 // 8 - Queue a task to fire a simple event named loadstart at the media
1029 // element. 1029 // element.
1030 ScheduleEvent(EventTypeNames::loadstart); 1030 ScheduleEvent(EventTypeNames::loadstart);
1031 autoplay_policy_->OnLoadStarted(GetLoadType());
1031 1032
1032 // 9 - Run the appropriate steps... 1033 // 9 - Run the appropriate steps...
1033 switch (mode) { 1034 switch (mode) {
1034 case kObject: 1035 case kObject:
1035 LoadSourceFromObject(); 1036 LoadSourceFromObject();
1036 BLINK_MEDIA_LOG << "selectMediaResource(" << (void*)this 1037 BLINK_MEDIA_LOG << "selectMediaResource(" << (void*)this
1037 << ", using 'srcObject' attribute"; 1038 << ", using 'srcObject' attribute";
1038 break; 1039 break;
1039 case kAttribute: 1040 case kAttribute:
1040 LoadSourceFromAttribute(); 1041 LoadSourceFromAttribute();
(...skipping 3040 matching lines...) Expand 10 before | Expand all | Expand 10 after
4081 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4082 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4082 } 4083 }
4083 4084
4084 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) { 4085 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) {
4085 mostly_filling_viewport_ = true; 4086 mostly_filling_viewport_ = true;
4086 if (web_media_player_) 4087 if (web_media_player_)
4087 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_); 4088 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_);
4088 } 4089 }
4089 4090
4090 } // namespace blink 4091 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698