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

Side by Side Diff: ui/gfx/rect_base.h

Issue 10203004: no virtual destructor for point/size/rect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added comment Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/rect.h ('k') | ui/gfx/rect_f.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // A template for a simple rectangle class. The containment semantics 5 // A template for a simple rectangle class. The containment semantics
6 // are array-like; that is, the coordinate (x, y) is considered to be 6 // are array-like; that is, the coordinate (x, y) is considered to be
7 // contained by the rectangle, but the coordinate (x + width, y) is not. 7 // contained by the rectangle, but the coordinate (x + width, y) is not.
8 // The class will happily let you create malformed rectangles (that is, 8 // The class will happily let you create malformed rectangles (that is,
9 // rectangles with negative width and/or height), but there will be assertions 9 // rectangles with negative width and/or height), but there will be assertions
10 // in the operations (such as Contains()) to complain in this case. 10 // in the operations (such as Contains()) to complain in this case.
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void SplitVertically(Class* left_half, Class* right_half) const; 133 void SplitVertically(Class* left_half, Class* right_half) const;
134 134
135 // Returns true if this rectangle shares an entire edge (i.e., same width or 135 // Returns true if this rectangle shares an entire edge (i.e., same width or
136 // same height) with the given rectangle, and the rectangles do not overlap. 136 // same height) with the given rectangle, and the rectangles do not overlap.
137 bool SharesEdgeWith(const Class& rect) const; 137 bool SharesEdgeWith(const Class& rect) const;
138 138
139 protected: 139 protected:
140 RectBase(const PointClass& origin, const SizeClass& size); 140 RectBase(const PointClass& origin, const SizeClass& size);
141 explicit RectBase(const SizeClass& size); 141 explicit RectBase(const SizeClass& size);
142 explicit RectBase(const PointClass& origin); 142 explicit RectBase(const PointClass& origin);
143 virtual ~RectBase(); 143 // Destructor is intentionally made non virtual and protected.
144 // Do not make this public.
145 ~RectBase();
144 146
145 private: 147 private:
146 PointClass origin_; 148 PointClass origin_;
147 SizeClass size_; 149 SizeClass size_;
148 }; 150 };
149 151
150 } // namespace gfx 152 } // namespace gfx
151 153
152 #endif // UI_GFX_RECT_BASE_H_ 154 #endif // UI_GFX_RECT_BASE_H_
OLDNEW
« no previous file with comments | « ui/gfx/rect.h ('k') | ui/gfx/rect_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698