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

Side by Side Diff: Source/web/ViewportAnchor.h

Issue 395843002: Oilpan: make ViewportAnchor fully stack allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 namespace blink { 47 namespace blink {
48 48
49 // ViewportAnchor provides a way to anchor a viewport origin to a DOM node. 49 // ViewportAnchor provides a way to anchor a viewport origin to a DOM node.
50 // In particular, the user supplies the current viewport (in CSS coordinates) 50 // In particular, the user supplies the current viewport (in CSS coordinates)
51 // and an anchor point (in view coordinates, e.g., (0, 0) == viewport origin, 51 // and an anchor point (in view coordinates, e.g., (0, 0) == viewport origin,
52 // (0.5, 0) == viewport top center). The anchor point tracks the underlying DOM 52 // (0.5, 0) == viewport top center). The anchor point tracks the underlying DOM
53 // node; as the node moves or the view is resized, the viewport anchor maintains 53 // node; as the node moves or the view is resized, the viewport anchor maintains
54 // its orientation relative to the node, and the viewport origin maintains its 54 // its orientation relative to the node, and the viewport origin maintains its
55 // orientation relative to the anchor. 55 // orientation relative to the anchor.
56 class ViewportAnchor { 56 class ViewportAnchor {
57 WTF_MAKE_NONCOPYABLE(ViewportAnchor); 57 STACK_ALLOCATED();
58 public: 58 public:
59 explicit ViewportAnchor(WebCore::EventHandler* eventHandler); 59 explicit ViewportAnchor(WebCore::EventHandler* eventHandler);
60 60
61 void setAnchor(const WebCore::IntRect& viewRect, const WebCore::FloatSize& a nchorInViewCoords); 61 void setAnchor(const WebCore::IntRect& viewRect, const WebCore::FloatSize& a nchorInViewCoords);
62 62
63 WebCore::IntPoint computeOrigin(const WebCore::IntSize& currentViewSize) con st; 63 WebCore::IntPoint computeOrigin(const WebCore::IntSize& currentViewSize) con st;
64 64
65 private: 65 private:
66 WebCore::EventHandler* m_eventHandler; 66 RawPtrWillBeMember<WebCore::EventHandler> m_eventHandler;
67 67
68 WebCore::IntRect m_viewRect; 68 WebCore::IntRect m_viewRect;
69 69
70 RefPtrWillBePersistent<WebCore::Node> m_anchorNode; 70 RefPtrWillBeMember<WebCore::Node> m_anchorNode;
71 WebCore::LayoutRect m_anchorNodeBounds; 71 WebCore::LayoutRect m_anchorNodeBounds;
72 72
73 WebCore::FloatSize m_anchorInViewCoords; 73 WebCore::FloatSize m_anchorInViewCoords;
74 WebCore::FloatSize m_anchorInNodeCoords; 74 WebCore::FloatSize m_anchorInNodeCoords;
75 }; 75 };
76 76
77 } // namespace blink 77 } // namespace blink
78 78
79 #endif 79 #endif
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