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

Unified Diff: third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp

Issue 1856793002: Revert of WTF::ThreadSpecific should use base::ThreadLocalStorage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Manual revert Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp
diff --git a/third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp b/third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp
index c014507a11a4f79f73cf29a3658b1cd06a389330..9691763b288d72ea081061fb9c23740dd4dbbef4 100644
--- a/third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp
+++ b/third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp
@@ -39,14 +39,14 @@ class LineBreakIteratorPool final {
USING_FAST_MALLOC(LineBreakIteratorPool);
WTF_MAKE_NONCOPYABLE(LineBreakIteratorPool);
public:
- LineBreakIteratorPool() { }
-
static LineBreakIteratorPool& sharedPool()
{
static WTF::ThreadSpecific<LineBreakIteratorPool>* pool = new WTF::ThreadSpecific<LineBreakIteratorPool>;
return **pool;
}
+ static PassOwnPtr<LineBreakIteratorPool> create() { return adoptPtr(new LineBreakIteratorPool); }
+
icu::BreakIterator* take(const AtomicString& locale)
{
icu::BreakIterator* iterator = 0;
@@ -93,12 +93,16 @@ public:
}
private:
+ LineBreakIteratorPool() { }
+
static const size_t capacity = 4;
typedef std::pair<AtomicString, icu::BreakIterator*> Entry;
typedef Vector<Entry, capacity> Pool;
Pool m_pool;
HashMap<icu::BreakIterator*, AtomicString> m_vendedIterators;
+
+ friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIteratorPool*();
};
enum TextContext { NoContext, PriorContext, PrimaryContext };
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698