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

Side by Side Diff: third_party/WebKit/Source/core/style/NinePieceImage.h

Issue 2808703002: Make NinePieceImageData use RefCountedCopyable. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/NinePieceImage.cpp » ('j') | 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 25 matching lines...) Expand all
36 36
37 namespace blink { 37 namespace blink {
38 38
39 enum ENinePieceImageRule { 39 enum ENinePieceImageRule {
40 kStretchImageRule, 40 kStretchImageRule,
41 kRoundImageRule, 41 kRoundImageRule,
42 kSpaceImageRule, 42 kSpaceImageRule,
43 kRepeatImageRule 43 kRepeatImageRule
44 }; 44 };
45 45
46 class CORE_EXPORT NinePieceImageData : public RefCounted<NinePieceImageData> { 46 class CORE_EXPORT NinePieceImageData
47 : public RefCountedCopyable<NinePieceImageData> {
47 public: 48 public:
48 static PassRefPtr<NinePieceImageData> Create() { 49 static PassRefPtr<NinePieceImageData> Create() {
49 return AdoptRef(new NinePieceImageData); 50 return AdoptRef(new NinePieceImageData);
50 } 51 }
51 PassRefPtr<NinePieceImageData> Copy() const { 52 PassRefPtr<NinePieceImageData> Copy() const {
52 return AdoptRef(new NinePieceImageData(*this)); 53 return AdoptRef(new NinePieceImageData(*this));
53 } 54 }
54 55
55 bool operator==(const NinePieceImageData&) const; 56 bool operator==(const NinePieceImageData&) const;
56 bool operator!=(const NinePieceImageData& o) const { return !(*this == o); } 57 bool operator!=(const NinePieceImageData& o) const { return !(*this == o); }
57 58
58 unsigned fill : 1; 59 unsigned fill : 1;
59 unsigned horizontal_rule : 2; // ENinePieceImageRule 60 unsigned horizontal_rule : 2; // ENinePieceImageRule
60 unsigned vertical_rule : 2; // ENinePieceImageRule 61 unsigned vertical_rule : 2; // ENinePieceImageRule
61 Persistent<StyleImage> image; 62 Persistent<StyleImage> image;
62 LengthBox image_slices; 63 LengthBox image_slices;
63 BorderImageLengthBox border_slices; 64 BorderImageLengthBox border_slices;
64 BorderImageLengthBox outset; 65 BorderImageLengthBox outset;
65 66
66 private: 67 private:
67 NinePieceImageData(); 68 NinePieceImageData();
68 NinePieceImageData(const NinePieceImageData&); 69 NinePieceImageData(const NinePieceImageData&) = default;
69 }; 70 };
70 71
71 class CORE_EXPORT NinePieceImage { 72 class CORE_EXPORT NinePieceImage {
72 DISALLOW_NEW(); 73 DISALLOW_NEW();
73 74
74 public: 75 public:
75 NinePieceImage(); 76 NinePieceImage();
76 NinePieceImage(StyleImage*, 77 NinePieceImage(StyleImage*,
77 LengthBox image_slices, 78 LengthBox image_slices,
78 bool fill, 79 bool fill,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return LayoutUnit(outset_side.length().Value()); 158 return LayoutUnit(outset_side.length().Value());
158 } 159 }
159 160
160 private: 161 private:
161 DataRef<NinePieceImageData> data_; 162 DataRef<NinePieceImageData> data_;
162 }; 163 };
163 164
164 } // namespace blink 165 } // namespace blink
165 166
166 #endif // NinePieceImage_h 167 #endif // NinePieceImage_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/NinePieceImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698