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

Unified Diff: Source/wtf/text/AtomicString.h

Issue 123503002: Mark the AtomicString(const String&) constructor as explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xml/XPathFunctions.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/AtomicString.h
diff --git a/Source/wtf/text/AtomicString.h b/Source/wtf/text/AtomicString.h
index e6befd7acb7b9c04ae0552f589870eeea8554c56..57e49f0c79a11f7de654383d9ddc45811098f867 100644
--- a/Source/wtf/text/AtomicString.h
+++ b/Source/wtf/text/AtomicString.h
@@ -26,14 +26,6 @@
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
-// Define 'NO_IMPLICIT_ATOMICSTRING' before including this header,
-// to disallow (expensive) implicit String-->AtomicString conversions.
-#ifdef NO_IMPLICIT_ATOMICSTRING
-#define ATOMICSTRING_CONVERSION explicit
-#else
-#define ATOMICSTRING_CONVERSION
-#endif
-
namespace WTF {
struct AtomicStringHash;
@@ -56,8 +48,11 @@ public:
{
}
+ // Constructing an AtomicString from a String / StringImpl can be expensive if
+ // the StringImpl is not already atomic.
explicit AtomicString(StringImpl* imp) : m_string(add(imp)) { }
- ATOMICSTRING_CONVERSION AtomicString(const String& s) : m_string(add(s.impl())) { }
+ explicit AtomicString(const String& s) : m_string(add(s.impl())) { }
+
AtomicString(StringImpl* baseString, unsigned start, unsigned length) : m_string(add(baseString, start, length)) { }
enum ConstructFromLiteralTag { ConstructFromLiteral };
« no previous file with comments | « Source/core/xml/XPathFunctions.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698