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

Side by Side Diff: Source/wtf/RefVector.h

Issue 272443002: Store and propagate a list of applied text decorations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Undo NeedsRebaseline. Created 6 years, 7 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 | « Source/core/rendering/style/StyleRareInheritedData.cpp ('k') | 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef RefVector_h
6 #define RefVector_h
7
8 #include "wtf/RefCounted.h"
9 #include "wtf/RefPtr.h"
10 #include "wtf/Vector.h"
11
12 namespace WebCore {
13
14 template <typename T>
15 class RefVector : public RefCounted<RefVector<T> > {
16 public:
17 static PassRefPtr<RefVector> create() { return adoptRef(new RefVector<T>); }
18 PassRefPtr<RefVector> copy() { return adoptRef(new RefVector<T>(*this)); }
19
20 const T& operator[](size_t i) const { return m_vector[i]; }
21 T& operator[](size_t i) { return m_vector[i]; }
22
23 bool operator==(const RefVector& o) const { return m_vector == o.m_vector; }
24 bool operator!=(const RefVector& o) const { return m_vector != o.m_vector; }
25
26 size_t size() const { return m_vector.size(); }
27 void append(const T& decoration) { m_vector.append(decoration); }
28 const Vector<T>& vector() const { return m_vector; }
29
30 private:
31 Vector<T> m_vector;
32 RefVector() { }
33 RefVector(const RefVector& o) : m_vector(o.m_vector) { }
34 };
35
36 } // namespace WebCore
37
38 #endif // RefVector_h
OLDNEW
« no previous file with comments | « Source/core/rendering/style/StyleRareInheritedData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698