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

Unified Diff: third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp

Issue 2780403004: Create core/html/media/ and move auxiliary media files in it. (Closed)
Patch Set: actually add autoplay files Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
diff --git a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
similarity index 99%
rename from third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
rename to third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
index 8c936f50d2e747dd554c18f81614491bbf226a39..9f93f10fc5f2c3a0ebcc2eb4160f474bc5d0724f 100644
--- a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
+++ b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "core/html/AutoplayUmaHelper.h"
+#include "core/html/media/AutoplayUmaHelper.h"
#include "core/dom/Document.h"
#include "core/dom/ElementVisibilityObserver.h"
@@ -232,13 +232,14 @@ void AutoplayUmaHelper::onVisibilityChangedForMutedVideoOffscreenDuration(
if (isVisible == m_isVisible)
return;
- if (isVisible)
+ if (isVisible) {
m_mutedVideoAutoplayOffscreenDurationMS +=
static_cast<int64_t>(monotonicallyIncreasingTimeMS()) -
m_mutedVideoAutoplayOffscreenStartTimeMS;
- else
+ } else {
m_mutedVideoAutoplayOffscreenStartTimeMS =
static_cast<int64_t>(monotonicallyIncreasingTimeMS());
+ }
m_isVisible = isVisible;
}
@@ -326,10 +327,11 @@ void AutoplayUmaHelper::maybeStopRecordingMutedVideoOffscreenDuration() {
if (!m_mutedVideoOffscreenDurationVisibilityObserver)
return;
- if (!m_isVisible)
+ if (!m_isVisible) {
m_mutedVideoAutoplayOffscreenDurationMS +=
static_cast<int64_t>(monotonicallyIncreasingTimeMS()) -
m_mutedVideoAutoplayOffscreenStartTimeMS;
+ }
// Since histograms uses int32_t, the duration needs to be limited to
// std::numeric_limits<int32_t>::max().

Powered by Google App Engine
This is Rietveld 408576698