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

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

Issue 2558633003: Track intersection of HTMLMediaElement with root frame. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | 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 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 4015 matching lines...) Expand 10 before | Expand all | Expand 10 after
4026 } 4026 }
4027 4027
4028 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) { 4028 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) {
4029 visitor->trace(m_client); 4029 visitor->trace(m_client);
4030 } 4030 }
4031 4031
4032 void HTMLMediaElement::checkViewportIntersectionChanged() { 4032 void HTMLMediaElement::checkViewportIntersectionChanged() {
4033 // TODO(xjz): Early return if we not in tab mirroring. 4033 // TODO(xjz): Early return if we not in tab mirroring.
4034 4034
4035 IntersectionGeometry geometry( 4035 IntersectionGeometry geometry(
4036 &document(), this, Vector<Length>(), 4036 document().frame()->localFrameRoot()->document(), this, Vector<Length>(),
4037 IntersectionGeometry::ReportRootBounds::kShouldReportRootBounds); 4037 IntersectionGeometry::ReportRootBounds::kShouldReportRootBounds);
4038 geometry.computeGeometry(); 4038 geometry.computeGeometry();
4039 IntRect intersectRect = geometry.intersectionIntRect(); 4039 IntRect intersectRect = geometry.intersectionIntRect();
4040 if (m_currentIntersectRect == intersectRect) 4040 if (m_currentIntersectRect == intersectRect)
4041 return; 4041 return;
4042 4042
4043 m_currentIntersectRect = intersectRect; 4043 m_currentIntersectRect = intersectRect;
4044 // Reset on any intersection change, since this indicates the user is 4044 // Reset on any intersection change, since this indicates the user is
4045 // scrolling around in the document, the document is changing layout, etc. 4045 // scrolling around in the document, the document is changing layout, etc.
4046 m_viewportFillDebouncerTimer.stop(); 4046 m_viewportFillDebouncerTimer.stop();
(...skipping 14 matching lines...) Expand all
4061 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4061 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4062 } 4062 }
4063 4063
4064 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { 4064 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) {
4065 m_mostlyFillingViewport = true; 4065 m_mostlyFillingViewport = true;
4066 if (m_webMediaPlayer) 4066 if (m_webMediaPlayer)
4067 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); 4067 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport);
4068 } 4068 }
4069 4069
4070 } // namespace blink 4070 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698