Chromium Code Reviews| Index: third_party/WebKit/Source/wtf/text/AtomicString.h |
| diff --git a/third_party/WebKit/Source/wtf/text/AtomicString.h b/third_party/WebKit/Source/wtf/text/AtomicString.h |
| index 9fc2eb654dd113d4e645d2047b90b72d19d190b4..ce39d2259bbd477054a9534372aaf15b3288f9d7 100644 |
| --- a/third_party/WebKit/Source/wtf/text/AtomicString.h |
| +++ b/third_party/WebKit/Source/wtf/text/AtomicString.h |
| @@ -34,10 +34,24 @@ namespace WTF { |
| struct AtomicStringHash; |
| +// An AtomicString instance represents a string, and multiple AtomicString |
| +// instances can shares their string storage if the strings are |
|
kochi
2016/12/01 07:16:56
nit: can share (without s)
tkent
2016/12/01 08:24:30
oops. Done.
|
| +// identical. Comparing two AtomicString instances is much faster than comparing |
| +// two String instances because we just check string storage identity. |
| +// |
| +// AtomicString instances are not thread-safe. An AtomicString instance created |
| +// in a thread must be used only in the creator thread. If multiple threads |
| +// access a single AtomicString instance, we have race condition of a reference |
| +// count in StringImpl, and would hit a runtime CHECK in |
| +// AtomicStringTable::remove(). |
| +// |
| +// Exception: nullAtom and emptyAtom, are shared in multiple threads, and are |
| +// never stored in AtomicStringTable. |
| class WTF_EXPORT AtomicString { |
| USING_FAST_MALLOC(AtomicString); |
| public: |
| + // The function is defined in StringStatics.cpp. |
| static void init(); |
| AtomicString() {} |