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 2635033002: Avoid infinite recursion in StringImpl::asciiForDebugging (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | 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
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 // will try to remove them from the wrong AtomicStringTable. 328 // will try to remove them from the wrong AtomicStringTable.
329 if (isAtomic()) 329 if (isAtomic())
330 return false; 330 return false;
331 if (hasOneRef()) 331 if (hasOneRef())
332 return true; 332 return true;
333 return false; 333 return false;
334 } 334 }
335 335
336 #if DCHECK_IS_ON() 336 #if DCHECK_IS_ON()
337 std::string StringImpl::asciiForDebugging() const { 337 std::string StringImpl::asciiForDebugging() const {
338 CString ascii = String(substring(0, 128)).ascii(); 338 CString ascii = String(isolatedCopy()->substring(0, 128)).ascii();
339 return std::string(ascii.data(), ascii.length()); 339 return std::string(ascii.data(), ascii.length());
340 } 340 }
341 #endif 341 #endif
342 342
343 PassRefPtr<StringImpl> StringImpl::createUninitialized(unsigned length, 343 PassRefPtr<StringImpl> StringImpl::createUninitialized(unsigned length,
344 LChar*& data) { 344 LChar*& data) {
345 if (!length) { 345 if (!length) {
346 data = 0; 346 data = 0;
347 return empty(); 347 return empty();
348 } 348 }
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 } else if (localeIdMatchesLang(localeIdentifier, "lt")) { 2196 } else if (localeIdMatchesLang(localeIdentifier, "lt")) {
2197 // TODO(rob.buis) implement upper-casing rules for lt 2197 // TODO(rob.buis) implement upper-casing rules for lt
2198 // like in StringImpl::upper(locale). 2198 // like in StringImpl::upper(locale).
2199 } 2199 }
2200 } 2200 }
2201 2201
2202 return toUpper(c); 2202 return toUpper(c);
2203 } 2203 }
2204 2204
2205 } // namespace WTF 2205 } // namespace WTF
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698