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

Side by Side Diff: third_party/WebKit/Source/platform/Length.cpp

Issue 2388303002: reflow comments in platform/ (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller ( mueller@kde.org ) 4 * (C) 2001 Dirk Mueller ( mueller@kde.org )
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
6 * reserved.
6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 7 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
7 * 8 *
8 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 11 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version. 12 * version 2 of the License, or (at your option) any later version.
12 * 13 *
13 * This library is distributed in the hope that it will be useful, 14 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
(...skipping 18 matching lines...) Expand all
34 class CalculationValueHandleMap { 35 class CalculationValueHandleMap {
35 USING_FAST_MALLOC(CalculationValueHandleMap); 36 USING_FAST_MALLOC(CalculationValueHandleMap);
36 WTF_MAKE_NONCOPYABLE(CalculationValueHandleMap); 37 WTF_MAKE_NONCOPYABLE(CalculationValueHandleMap);
37 38
38 public: 39 public:
39 CalculationValueHandleMap() : m_index(1) {} 40 CalculationValueHandleMap() : m_index(1) {}
40 41
41 int insert(PassRefPtr<CalculationValue> calcValue) { 42 int insert(PassRefPtr<CalculationValue> calcValue) {
42 ASSERT(m_index); 43 ASSERT(m_index);
43 // FIXME calc(): https://bugs.webkit.org/show_bug.cgi?id=80489 44 // FIXME calc(): https://bugs.webkit.org/show_bug.cgi?id=80489
44 // This monotonically increasing handle generation scheme is potentially was teful 45 // This monotonically increasing handle generation scheme is potentially
45 // of the handle space. Consider reusing empty handles. 46 // wasteful of the handle space. Consider reusing empty handles.
46 while (m_map.contains(m_index)) 47 while (m_map.contains(m_index))
47 m_index++; 48 m_index++;
48 49
49 m_map.set(m_index, std::move(calcValue)); 50 m_map.set(m_index, std::move(calcValue));
50 51
51 return m_index; 52 return m_index;
52 } 53 }
53 54
54 void remove(int index) { 55 void remove(int index) {
55 ASSERT(m_map.contains(index)); 56 ASSERT(m_map.contains(index));
56 m_map.remove(index); 57 m_map.remove(index);
57 } 58 }
58 59
59 CalculationValue& get(int index) { 60 CalculationValue& get(int index) {
60 ASSERT(m_map.contains(index)); 61 ASSERT(m_map.contains(index));
61 return *m_map.get(index); 62 return *m_map.get(index);
62 } 63 }
63 64
64 void decrementRef(int index) { 65 void decrementRef(int index) {
65 ASSERT(m_map.contains(index)); 66 ASSERT(m_map.contains(index));
66 CalculationValue* value = m_map.get(index); 67 CalculationValue* value = m_map.get(index);
67 if (value->hasOneRef()) { 68 if (value->hasOneRef()) {
68 // Force the CalculationValue destructor early to avoid a potential recurs ive call inside HashMap remove(). 69 // Force the CalculationValue destructor early to avoid a potential
70 // recursive call inside HashMap remove().
69 m_map.set(index, nullptr); 71 m_map.set(index, nullptr);
70 m_map.remove(index); 72 m_map.remove(index);
71 } else { 73 } else {
72 value->deref(); 74 value->deref();
73 } 75 }
74 } 76 }
75 77
76 private: 78 private:
77 int m_index; 79 int m_index;
78 HashMap<int, RefPtr<CalculationValue>> m_map; 80 HashMap<int, RefPtr<CalculationValue>> m_map;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 175 }
174 176
175 struct SameSizeAsLength { 177 struct SameSizeAsLength {
176 int32_t value; 178 int32_t value;
177 int32_t metaData; 179 int32_t metaData;
178 }; 180 };
179 static_assert(sizeof(Length) == sizeof(SameSizeAsLength), 181 static_assert(sizeof(Length) == sizeof(SameSizeAsLength),
180 "length should stay small"); 182 "length should stay small");
181 183
182 } // namespace blink 184 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/Length.h ('k') | third_party/WebKit/Source/platform/LengthFunctions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698