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

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

Issue 2341783002: Fix an AutoplayUmaHelper crash (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/core/html/AutoplayUmaHelper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
diff --git a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
index 4f3887add4e659264c3b878f32ebc3748599f5ff..a8d92a7d18681fc07ddcf3edcdde20d4deff637c 100644
--- a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
+++ b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
@@ -98,7 +98,7 @@ void AutoplayUmaHelper::didMoveToNewDocument(Document& oldDocument)
if (oldDocument.domWindow())
oldDocument.domWindow()->removeEventListener(EventTypeNames::unload, this, false);
- if (m_element && m_element->document().domWindow())
+ if (m_element->document().domWindow())
m_element->document().domWindow()->addEventListener(EventTypeNames::unload, this, false);
}
@@ -220,7 +220,7 @@ void AutoplayUmaHelper::maybeStopRecordingMutedVideoOffscreenDuration()
void AutoplayUmaHelper::maybeUnregisterUnloadListener()
{
- if (!shouldListenToUnloadEvent() && m_element && m_element->document().domWindow())
+ if (!shouldListenToUnloadEvent() && m_element->document().domWindow())
m_element->document().domWindow()->removeEventListener(EventTypeNames::unload, this, false);
}
« no previous file with comments | « third_party/WebKit/Source/core/html/AutoplayUmaHelper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698