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

Unified Diff: Source/web/ResizeViewportAnchor.cpp

Issue 1003323004: Turn ViewportAnchors into stack allocated objects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/web/ResizeViewportAnchor.h ('k') | Source/web/RotationViewportAnchor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ResizeViewportAnchor.cpp
diff --git a/Source/web/ResizeViewportAnchor.cpp b/Source/web/ResizeViewportAnchor.cpp
index 756bdc6605a4ed4324926085ef846086939e566d..41bd9c66a412374f2c446c3b2addc90b80b4a729 100644
--- a/Source/web/ResizeViewportAnchor.cpp
+++ b/Source/web/ResizeViewportAnchor.cpp
@@ -14,23 +14,20 @@
namespace blink {
ResizeViewportAnchor::ResizeViewportAnchor(FrameView& rootFrameView, PinchViewport& pinchViewport)
- : ViewportAnchor(rootFrameView, pinchViewport) { }
-
-
-void ResizeViewportAnchor::setAnchor()
+ : ViewportAnchor(rootFrameView, pinchViewport)
+ , m_pinchViewportInDocument(m_pinchViewport->visibleRectInDocument().location())
{
- m_pinchViewportInDocument = m_pinchViewport.visibleRectInDocument().location();
}
-void ResizeViewportAnchor::restoreToAnchor()
+ResizeViewportAnchor::~ResizeViewportAnchor()
{
- FloatSize delta = m_pinchViewportInDocument - m_pinchViewport.visibleRectInDocument().location();
+ FloatSize delta = m_pinchViewportInDocument - m_pinchViewport->visibleRectInDocument().location();
- DoublePoint targetFrameViewPosition = m_rootFrameView.scrollPositionDouble() + DoubleSize(delta);
- m_rootFrameView.setScrollPosition(targetFrameViewPosition);
+ DoublePoint targetFrameViewPosition = m_rootFrameView->scrollPositionDouble() + DoubleSize(delta);
+ m_rootFrameView->setScrollPosition(targetFrameViewPosition);
- DoubleSize remainder = targetFrameViewPosition - m_rootFrameView.scrollPositionDouble();
- m_pinchViewport.move(toFloatSize(remainder));
+ DoubleSize remainder = targetFrameViewPosition - m_rootFrameView->scrollPositionDouble();
+ m_pinchViewport->move(toFloatSize(remainder));
}
} // namespace blink
« no previous file with comments | « Source/web/ResizeViewportAnchor.h ('k') | Source/web/RotationViewportAnchor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698