Title: [179219] branches/safari-600.1.4.15-branch/Source/WebCore
- Revision
- 179219
- Author
- [email protected]
- Date
- 2015-01-27 14:31:02 -0800 (Tue, 27 Jan 2015)
Log Message
Merged r177591. rdar://problem/19445895
Modified Paths
Diff
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (179218 => 179219)
--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog 2015-01-27 22:29:33 UTC (rev 179218)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog 2015-01-27 22:31:02 UTC (rev 179219)
@@ -1,5 +1,38 @@
2015-01-27 Lucas Forschler <[email protected]>
+ Merge r177591
+
+ 2014-12-19 Chris Dumez <[email protected]>
+
+ [iOS] Log how often media element playback happens using FeatureCounter
+ https://bugs.webkit.org/show_bug.cgi?id=139819
+ <rdar://problem/19309988>
+
+ Reviewed by Eric Carlson.
+
+ Log using FeatureCounter how often we start loading for audio / video
+ elements, and how often they end up being played.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::HTMLMediaElement):
+ Add flag to identify when a media element starts playing for the first
+ time.
+
+ (WebCore::HTMLMediaElement::loadResource):
+ Log when a media element starts loading.
+
+ (WebCore::HTMLMediaElement::updatePlayState):
+ Log when a media element starts playing for the first time.
+
+ * html/HTMLMediaElement.h:
+ Add flag to identify when a media element starts playing for the first
+ time.
+
+ * platform/FeatureCounterKeys.h:
+ Add FeatureCounter keys for HTMLMediaElement loading / playback.
+
+2015-01-27 Lucas Forschler <[email protected]>
+
Merge r177581
2014-12-19 Chris Dumez <[email protected]>
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/html/HTMLMediaElement.cpp (179218 => 179219)
--- branches/safari-600.1.4.15-branch/Source/WebCore/html/HTMLMediaElement.cpp 2015-01-27 22:29:33 UTC (rev 179218)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/html/HTMLMediaElement.cpp 2015-01-27 22:31:02 UTC (rev 179219)
@@ -44,6 +44,7 @@
#include "ElementIterator.h"
#include "EventNames.h"
#include "ExceptionCodePlaceholder.h"
+#include "FeatureCounter.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "FrameView.h"
@@ -291,6 +292,7 @@
, m_actionAfterScan(Nothing)
, m_scanType(Scan)
, m_scanDirection(Forward)
+ , m_firstTimePlaying(true)
, m_playing(false)
, m_isWaitingUntilMediaCanStart(false)
, m_shouldDelayLoadEvent(false)
@@ -1199,6 +1201,10 @@
}
}
+ // Log that we started loading a media element.
+ FEATURE_COUNTER_INCREMENT_KEY(document().page(), isVideo() ? FeatureCounterMediaVideoElementLoadingKey : FeatureCounterMediaAudioElementLoadingKey);
+ m_firstTimePlaying = true;
+
// Set m_currentSrc *before* changing to the cache url, the fact that we are loading from the app
// cache is an internal detail not exposed through the media element API.
m_currentSrc = url;
@@ -4544,6 +4550,12 @@
m_player->setRate(effectivePlaybackRate());
m_player->setMuted(muted());
+ if (m_firstTimePlaying) {
+ // Log that a media element was played.
+ FEATURE_COUNTER_INCREMENT_KEY(document().page(), isVideo() ? FeatureCounterMediaVideoElementPlayedKey : FeatureCounterMediaAudioElementPlayedKey);
+ m_firstTimePlaying = false;
+ }
+
m_player->play();
}
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/html/HTMLMediaElement.h (179218 => 179219)
--- branches/safari-600.1.4.15-branch/Source/WebCore/html/HTMLMediaElement.h 2015-01-27 22:29:33 UTC (rev 179218)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/html/HTMLMediaElement.h 2015-01-27 22:31:02 UTC (rev 179219)
@@ -795,6 +795,7 @@
ScanType m_scanType;
ScanDirection m_scanDirection;
+ bool m_firstTimePlaying : 1;
bool m_playing : 1;
bool m_isWaitingUntilMediaCanStart : 1;
bool m_shouldDelayLoadEvent : 1;
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h (179218 => 179219)
--- branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h 2015-01-27 22:29:33 UTC (rev 179218)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h 2015-01-27 22:31:02 UTC (rev 179219)
@@ -70,6 +70,12 @@
static const char FeatureCounterCachedResourceRevalidationReasonMustRevalidateIsExpiredKey[] = "com.apple.WebKit.cachedResourceRevalidation.reason.mustRevalidateIsExpired";
static const char FeatureCounterCachedResourceRevalidationReasonIsExpiredKey[] = "com.apple.WebKit.cachedResourceRevalidation.reason.isExpired";
+// Media playback.
+static const char FeatureCounterMediaVideoElementLoadingKey[] = "com.apple.WebKit.media.video.loading";
+static const char FeatureCounterMediaAudioElementLoadingKey[] = "com.apple.WebKit.media.audio.loading";
+static const char FeatureCounterMediaVideoElementPlayedKey[] = "com.apple.WebKit.media.video.played";
+static const char FeatureCounterMediaAudioElementPlayedKey[] = "com.apple.WebKit.media.audio.played";
+
// Navigation types.
static const char FeatureCounterNavigationStandard[] = "com.apple.WebKit.navigation.standard";
static const char FeatureCounterNavigationBack[] = "com.apple.WebKit.navigation.back";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes