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

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

Issue 2125003002: Move CrossThreadCopier from platform/ to wtf/ Base URL: https://chromium.googlesource.com/chromium/src.git@TRV_RemoveTupleInBind
Patch Set: Rebase Created 4 years, 5 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 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 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,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 * 19 *
20 */ 20 */
21 21
22 #ifndef WTFString_h 22 #ifndef WTFString_h
23 #define WTFString_h 23 #define WTFString_h
24 24
25 // This file would be called String.h, but that conflicts with <string.h> 25 // This file would be called String.h, but that conflicts with <string.h>
26 // on systems without case-sensitive file systems. 26 // on systems without case-sensitive file systems.
27 27
28 #include "wtf/Allocator.h" 28 #include "wtf/Allocator.h"
29 #include "wtf/CrossThreadCopier.h"
29 #include "wtf/HashTableDeletedValueType.h" 30 #include "wtf/HashTableDeletedValueType.h"
30 #include "wtf/WTFExport.h" 31 #include "wtf/WTFExport.h"
31 #include "wtf/text/ASCIIFastPath.h" 32 #include "wtf/text/ASCIIFastPath.h"
32 #include "wtf/text/StringImpl.h" 33 #include "wtf/text/StringImpl.h"
33 #include <algorithm> 34 #include <algorithm>
34 #include <iosfwd> 35 #include <iosfwd>
35 36
36 #ifdef __OBJC__ 37 #ifdef __OBJC__
37 #include <objc/objc.h> 38 #include <objc/objc.h>
38 #endif 39 #endif
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 422
422 template <typename CharacterType> 423 template <typename CharacterType>
423 void removeInternal(const CharacterType*, unsigned, int); 424 void removeInternal(const CharacterType*, unsigned, int);
424 425
425 template <typename CharacterType> 426 template <typename CharacterType>
426 void appendInternal(CharacterType); 427 void appendInternal(CharacterType);
427 428
428 RefPtr<StringImpl> m_impl; 429 RefPtr<StringImpl> m_impl;
429 }; 430 };
430 431
432 template <>
433 struct CrossThreadCopier<String> {
434 STATIC_ONLY(CrossThreadCopier);
435 typedef String Type;
436 WTF_EXPORT static Type copy(const String&);
437 };
438
431 #undef DISPATCH_CASE_OP 439 #undef DISPATCH_CASE_OP
432 440
433 inline bool operator==(const String& a, const String& b) { return equal(a.impl() , b.impl()); } 441 inline bool operator==(const String& a, const String& b) { return equal(a.impl() , b.impl()); }
434 inline bool operator==(const String& a, const LChar* b) { return equal(a.impl(), b); } 442 inline bool operator==(const String& a, const LChar* b) { return equal(a.impl(), b); }
435 inline bool operator==(const String& a, const char* b) { return equal(a.impl(), reinterpret_cast<const LChar*>(b)); } 443 inline bool operator==(const String& a, const char* b) { return equal(a.impl(), reinterpret_cast<const LChar*>(b)); }
436 inline bool operator==(const LChar* a, const String& b) { return equal(a, b.impl ()); } 444 inline bool operator==(const LChar* a, const String& b) { return equal(a, b.impl ()); }
437 inline bool operator==(const char* a, const String& b) { return equal(reinterpre t_cast<const LChar*>(a), b.impl()); } 445 inline bool operator==(const char* a, const String& b) { return equal(reinterpre t_cast<const LChar*>(a), b.impl()); }
438 template<size_t inlineCapacity> 446 template<size_t inlineCapacity>
439 inline bool operator==(const Vector<char, inlineCapacity>& a, const String& b) { return equal(b.impl(), a.data(), a.size()); } 447 inline bool operator==(const Vector<char, inlineCapacity>& a, const String& b) { return equal(b.impl(), a.data(), a.size()); }
440 template<size_t inlineCapacity> 448 template<size_t inlineCapacity>
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 using WTF::charactersAreAllASCII; 662 using WTF::charactersAreAllASCII;
655 using WTF::equal; 663 using WTF::equal;
656 using WTF::equalIgnoringCase; 664 using WTF::equalIgnoringCase;
657 using WTF::find; 665 using WTF::find;
658 using WTF::isAllSpecialCharacters; 666 using WTF::isAllSpecialCharacters;
659 using WTF::isSpaceOrNewline; 667 using WTF::isSpaceOrNewline;
660 using WTF::reverseFind; 668 using WTF::reverseFind;
661 669
662 #include "wtf/text/AtomicString.h" 670 #include "wtf/text/AtomicString.h"
663 #endif // WTFString_h 671 #endif // WTFString_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698