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

Unified Diff: third_party/WebKit/Source/wtf/text/AtomicString.cpp

Issue 2111653004: Simplify AtomicStringTable and remove lots of dead code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
Index: third_party/WebKit/Source/wtf/text/AtomicString.cpp
diff --git a/third_party/WebKit/Source/wtf/text/AtomicString.cpp b/third_party/WebKit/Source/wtf/text/AtomicString.cpp
index 26982ad405173c72883bed54a387653049c71539..e787fd67236e5a89960dd08813a0dd594f9c2343 100644
--- a/third_party/WebKit/Source/wtf/text/AtomicString.cpp
+++ b/third_party/WebKit/Source/wtf/text/AtomicString.cpp
@@ -25,6 +25,7 @@
#include "wtf/dtoa.h"
#include "wtf/text/AtomicStringTable.h"
#include "wtf/text/IntegerToStringConversion.h"
+#include "wtf/text/StringImpl.h"
namespace WTF {
@@ -36,19 +37,13 @@ AtomicString::AtomicString(const LChar* chars, unsigned length)
AtomicString::AtomicString(const UChar* chars, unsigned length)
: m_string(AtomicStringTable::instance().add(chars, length)) {}
-AtomicString::AtomicString(const UChar* chars, unsigned length, unsigned existingHash)
- : m_string(AtomicStringTable::instance().add(chars, length, existingHash)) {}
-
AtomicString::AtomicString(const UChar* chars)
- : m_string(AtomicStringTable::instance().add(chars)) {}
-
-AtomicString::AtomicString(StringImpl* string, unsigned offset, unsigned length)
- : m_string(AtomicStringTable::instance().add(string, offset, length)) {}
+ : m_string(AtomicStringTable::instance().add(chars, chars ? lengthOfNullTerminatedString(chars) : 0)) {}
-PassRefPtr<StringImpl> AtomicString::addSlowCase(StringImpl* chars)
+PassRefPtr<StringImpl> AtomicString::addSlowCase(StringImpl* string)
{
- DCHECK(!chars->isAtomic());
- return AtomicStringTable::instance().add(chars);
+ DCHECK(!string->isAtomic());
+ return AtomicStringTable::instance().add(string);
}
AtomicString AtomicString::fromUTF8(const char* chars, size_t length)
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.h ('k') | third_party/WebKit/Source/wtf/text/AtomicStringTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698