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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringImpl.cpp

Issue 2585063002: Cache contains only ascii in StringImpl (Closed)
Patch Set: DCHECK + static_Cast Created 3 years, 11 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, 2009, 2013 Apple Inc. All 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 7 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 if (isAtomic()) 299 if (isAtomic())
300 AtomicStringTable::instance().remove(this); 300 AtomicStringTable::instance().remove(this);
301 } 301 }
302 302
303 void StringImpl::destroyIfNotStatic() { 303 void StringImpl::destroyIfNotStatic() {
304 if (!isStatic()) 304 if (!isStatic())
305 delete this; 305 delete this;
306 } 306 }
307 307
308 void StringImpl::updateContainsOnlyASCII() const {
309 m_containsOnlyASCII = is8Bit()
310 ? charactersAreAllASCII(characters8(), length())
311 : charactersAreAllASCII(characters16(), length());
312 m_needsASCIICheck = false;
313 }
314
308 bool StringImpl::isSafeToSendToAnotherThread() const { 315 bool StringImpl::isSafeToSendToAnotherThread() const {
309 if (isStatic()) 316 if (isStatic())
310 return true; 317 return true;
311 // AtomicStrings are not safe to send between threads as ~StringImpl() 318 // AtomicStrings are not safe to send between threads as ~StringImpl()
312 // will try to remove them from the wrong AtomicStringTable. 319 // will try to remove them from the wrong AtomicStringTable.
313 if (isAtomic()) 320 if (isAtomic())
314 return false; 321 return false;
315 if (hasOneRef()) 322 if (hasOneRef())
316 return true; 323 return true;
317 return false; 324 return false;
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 } else if (localeIdMatchesLang(localeIdentifier, "lt")) { 2177 } else if (localeIdMatchesLang(localeIdentifier, "lt")) {
2171 // TODO(rob.buis) implement upper-casing rules for lt 2178 // TODO(rob.buis) implement upper-casing rules for lt
2172 // like in StringImpl::upper(locale). 2179 // like in StringImpl::upper(locale).
2173 } 2180 }
2174 } 2181 }
2175 2182
2176 return toUpper(c); 2183 return toUpper(c);
2177 } 2184 }
2178 2185
2179 } // namespace WTF 2186 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.h ('k') | third_party/WebKit/Source/wtf/text/WTFString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698