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

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

Issue 2623273007: Fast path for ThreadSpecific for main thread on TLS-slow platforms (Closed)
Patch Set: [WIP] Fast path for currentThread() for main thread on TLS-slow platforms 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) 2004, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 30 matching lines...) Expand all
41 namespace WTF { 41 namespace WTF {
42 42
43 const size_t ConversionBufferSize = 16384; 43 const size_t ConversionBufferSize = 16384;
44 44
45 ICUConverterWrapper::~ICUConverterWrapper() { 45 ICUConverterWrapper::~ICUConverterWrapper() {
46 if (converter) 46 if (converter)
47 ucnv_close(converter); 47 ucnv_close(converter);
48 } 48 }
49 49
50 static UConverter*& cachedConverterICU() { 50 static UConverter*& cachedConverterICU() {
51 return wtfThreadData().cachedConverterICU().converter; 51 return WTFThreadData::current().cachedConverterICU().converter;
52 } 52 }
53 53
54 std::unique_ptr<TextCodec> TextCodecICU::create(const TextEncoding& encoding, 54 std::unique_ptr<TextCodec> TextCodecICU::create(const TextEncoding& encoding,
55 const void*) { 55 const void*) {
56 return WTF::wrapUnique(new TextCodecICU(encoding)); 56 return WTF::wrapUnique(new TextCodecICU(encoding));
57 } 57 }
58 58
59 void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) { 59 void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) {
60 // We register Hebrew with logical ordering using a separate name. 60 // We register Hebrew with logical ordering using a separate name.
61 // Otherwise, this would share the same canonical name as the 61 // Otherwise, this would share the same canonical name as the
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 return encodeCommon(characters, length, handling); 702 return encodeCommon(characters, length, handling);
703 } 703 }
704 704
705 CString TextCodecICU::encode(const LChar* characters, 705 CString TextCodecICU::encode(const LChar* characters,
706 size_t length, 706 size_t length,
707 UnencodableHandling handling) { 707 UnencodableHandling handling) {
708 return encodeCommon(characters, length, handling); 708 return encodeCommon(characters, length, handling);
709 } 709 }
710 710
711 } // namespace WTF 711 } // namespace WTF
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698