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

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

Issue 2335573003: Move String::isSafeToSendToAnotherThread to StringImpl. (Closed)
Patch Set: Created 4 years, 3 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 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 size_t charactersSizeInBytes() const 217 size_t charactersSizeInBytes() const
218 { 218 {
219 return length() * (is8Bit() ? sizeof(LChar) : sizeof(UChar)); 219 return length() * (is8Bit() ? sizeof(LChar) : sizeof(UChar));
220 } 220 }
221 221
222 bool isAtomic() const { return m_isAtomic; } 222 bool isAtomic() const { return m_isAtomic; }
223 void setIsAtomic(bool isAtomic) { m_isAtomic = isAtomic; } 223 void setIsAtomic(bool isAtomic) { m_isAtomic = isAtomic; }
224 224
225 bool isStatic() const { return m_isStatic; } 225 bool isStatic() const { return m_isStatic; }
226 226
227 bool isSafeToSendToAnotherThread() const;
228
227 // The high bits of 'hash' are always empty, but we prefer to store our 229 // The high bits of 'hash' are always empty, but we prefer to store our
228 // flags in the low bits because it makes them slightly more efficient to 230 // flags in the low bits because it makes them slightly more efficient to
229 // access. So, we shift left and right when setting and getting our hash 231 // access. So, we shift left and right when setting and getting our hash
230 // code. 232 // code.
231 void setHash(unsigned hash) const 233 void setHash(unsigned hash) const
232 { 234 {
233 DCHECK(!hasHash()); 235 DCHECK(!hasHash());
234 // Multiple clients assume that StringHasher is the canonical string 236 // Multiple clients assume that StringHasher is the canonical string
235 // hash function. 237 // hash function.
236 DCHECK(hash == (is8Bit() ? StringHasher::computeHashAndMaskTop8Bits(char acters8(), m_length) : StringHasher::computeHashAndMaskTop8Bits(characters16(), m_length))); 238 DCHECK(hash == (is8Bit() ? StringHasher::computeHashAndMaskTop8Bits(char acters8(), m_length) : StringHasher::computeHashAndMaskTop8Bits(characters16(), m_length)));
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 using WTF::TextCaseASCIIInsensitive; 697 using WTF::TextCaseASCIIInsensitive;
696 using WTF::TextCaseInsensitive; 698 using WTF::TextCaseInsensitive;
697 using WTF::TextCaseSensitive; 699 using WTF::TextCaseSensitive;
698 using WTF::TextCaseSensitivity; 700 using WTF::TextCaseSensitivity;
699 using WTF::equal; 701 using WTF::equal;
700 using WTF::equalNonNull; 702 using WTF::equalNonNull;
701 using WTF::lengthOfNullTerminatedString; 703 using WTF::lengthOfNullTerminatedString;
702 using WTF::reverseFind; 704 using WTF::reverseFind;
703 705
704 #endif 706 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.h ('k') | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698