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

Unified Diff: Source/web/ViewportAnchor.h

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/RotationViewportAnchor.cpp ('k') | Source/web/ViewportAnchor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ViewportAnchor.h
diff --git a/Source/web/ViewportAnchor.h b/Source/web/ViewportAnchor.h
index 5aed552f0a16df9f86aca6392534bc8bb5663f68..6103d8d26f71ed7a8681675a5a48bd4da990382b 100644
--- a/Source/web/ViewportAnchor.h
+++ b/Source/web/ViewportAnchor.h
@@ -31,28 +31,30 @@
#ifndef ViewportAnchor_h
#define ViewportAnchor_h
+#include "platform/heap/Handle.h"
+
namespace blink {
class FrameView;
class PinchViewport;
-// Use this class to "anchor" the viewport to a location, perform some operation
-// that may move the viewport around, then restore the viewport to the original
-// location. We support two kinds of anchors, a rotation anchor and a resize
-// anchor.
+// Use derived ViewportAnchor classes to "anchor" the viewport to a location,
+// perform some operation that may move the viewport around, then restore
+// the viewport to the original location.
+// We support two kinds of anchors, a rotation anchor and a resize anchor.
class ViewportAnchor {
-public:
- ViewportAnchor(FrameView& rootFrameView, PinchViewport&);
- virtual ~ViewportAnchor() { }
-
- virtual void setAnchor() = 0;
- virtual void restoreToAnchor() = 0;
-
+ STACK_ALLOCATED();
protected:
- FrameView& m_rootFrameView;
- PinchViewport& m_pinchViewport;
+ ViewportAnchor(FrameView& rootFrameView, PinchViewport& pinchViewport)
+ : m_rootFrameView(&rootFrameView)
+ , m_pinchViewport(&pinchViewport)
+ {
+ }
+
+ RawPtrWillBeMember<FrameView> m_rootFrameView;
+ RawPtrWillBeMember<PinchViewport> m_pinchViewport;
};
} // namespace blink
-#endif
+#endif // ViewportAnchor_h
« no previous file with comments | « Source/web/RotationViewportAnchor.cpp ('k') | Source/web/ViewportAnchor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698