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

Side by Side Diff: Source/core/dom/SpaceSplitString.cpp

Issue 1035573005: Change a bool type to an enum type in constructor argument of SpaceSplitString. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move enum struct to SpaceSplitString and rename. Created 5 years, 9 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/dom/SpaceSplitString.h ('k') | Source/core/html/ClassList.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) 2007 David Smith (catfish.man@gmail.com) 2 * Copyright (C) 2007 David Smith (catfish.man@gmail.com)
3 * Copyright (C) 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008, 2011, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 return changed; 145 return changed;
146 } 146 }
147 147
148 SpaceSplitString::DataMap& SpaceSplitString::sharedDataMap() 148 SpaceSplitString::DataMap& SpaceSplitString::sharedDataMap()
149 { 149 {
150 DEFINE_STATIC_LOCAL(DataMap, map, ()); 150 DEFINE_STATIC_LOCAL(DataMap, map, ());
151 return map; 151 return map;
152 } 152 }
153 153
154 void SpaceSplitString::set(const AtomicString& inputString, bool shouldFoldCase) 154 void SpaceSplitString::set(const AtomicString& inputString, CaseFolding caseFold ing)
155 { 155 {
156 if (inputString.isNull()) { 156 if (inputString.isNull()) {
157 clear(); 157 clear();
158 return; 158 return;
159 } 159 }
160 160
161 String string(inputString.string()); 161 String string(inputString.string());
162 if (shouldFoldCase && hasNonASCIIOrUpper(string)) 162 if (caseFolding == ShouldFoldCase && hasNonASCIIOrUpper(string))
163 string = string.foldCase(); 163 string = string.foldCase();
164 164
165 m_data = Data::create(AtomicString(string)); 165 m_data = Data::create(AtomicString(string));
166 } 166 }
167 167
168 SpaceSplitString::Data::~Data() 168 SpaceSplitString::Data::~Data()
169 { 169 {
170 if (!m_keyString.isNull()) 170 if (!m_keyString.isNull())
171 sharedDataMap().remove(m_keyString); 171 sharedDataMap().remove(m_keyString);
172 } 172 }
(...skipping 22 matching lines...) Expand all
195 195
196 SpaceSplitString::Data::Data(const SpaceSplitString::Data& other) 196 SpaceSplitString::Data::Data(const SpaceSplitString::Data& other)
197 : RefCounted<Data>() 197 : RefCounted<Data>()
198 , m_vector(other.m_vector) 198 , m_vector(other.m_vector)
199 { 199 {
200 // Note that we don't copy m_keyString to indicate to the destructor that th ere's nothing 200 // Note that we don't copy m_keyString to indicate to the destructor that th ere's nothing
201 // to be removed from the sharedDataMap(). 201 // to be removed from the sharedDataMap().
202 } 202 }
203 203
204 } // namespace blink 204 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/SpaceSplitString.h ('k') | Source/core/html/ClassList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698