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

Unified Diff: Source/core/dom/NamedFlowCollection.cpp

Issue 112843002: Make calls to AtomicString(const String&) explicit in dom/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added comments Created 7 years 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/dom/NamedFlowCollection.h ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NamedFlowCollection.cpp
diff --git a/Source/core/dom/NamedFlowCollection.cpp b/Source/core/dom/NamedFlowCollection.cpp
index 2b48c7be3d1b91f000f758d1d230de1cda3406c2..eeeaa5084962f3aaa7941d319ff971dbebe21b34 100644
--- a/Source/core/dom/NamedFlowCollection.cpp
+++ b/Source/core/dom/NamedFlowCollection.cpp
@@ -34,6 +34,7 @@
#include "core/dom/DOMNamedFlowCollection.h"
#include "core/dom/Document.h"
#include "core/inspector/InspectorInstrumentation.h"
+#include "wtf/text/AtomicString.h"
#include "wtf/text/StringHash.h"
#include "wtf/text/WTFString.h"
@@ -59,7 +60,8 @@ Vector<RefPtr<NamedFlow> > NamedFlowCollection::namedFlows()
return namedFlows;
}
-NamedFlow* NamedFlowCollection::flowByName(const String& flowName)
+// Takes an AtomicString in argument because RenderStyle::flowThread() returns an AtomicString.
+NamedFlow* NamedFlowCollection::flowByName(const AtomicString& flowName)
{
NamedFlowSet::iterator it = m_namedFlows.find<NamedFlowHashTranslator>(flowName);
if (it == m_namedFlows.end() || (*it)->flowState() == NamedFlow::FlowStateNull)
@@ -68,7 +70,8 @@ NamedFlow* NamedFlowCollection::flowByName(const String& flowName)
return *it;
}
-PassRefPtr<NamedFlow> NamedFlowCollection::ensureFlowWithName(const String& flowName)
+// Takes an AtomicString in argument because RenderStyle::flowThread() returns an AtomicString.
eseidel 2013/12/30 22:31:11 It would be fine for this to take a String in that
Inactive 2013/12/30 22:39:34 Yes, I understand that. However, in this particula
+PassRefPtr<NamedFlow> NamedFlowCollection::ensureFlowWithName(const AtomicString& flowName)
{
NamedFlowSet::iterator it = m_namedFlows.find<NamedFlowHashTranslator>(flowName);
if (it != m_namedFlows.end()) {
@@ -117,15 +120,15 @@ PassRefPtr<DOMNamedFlowCollection> NamedFlowCollection::createCSSOMSnapshot()
// The HashFunctions object used by the HashSet to compare between NamedFlows.
// It is safe to set safeToCompareToEmptyOrDeleted because the HashSet will never contain null pointers or deleted values.
struct NamedFlowCollection::NamedFlowHashFunctions {
- static unsigned hash(NamedFlow* key) { return DefaultHash<String>::Hash::hash(key->name()); }
+ static unsigned hash(NamedFlow* key) { return DefaultHash<AtomicString>::Hash::hash(key->name()); }
static bool equal(NamedFlow* a, NamedFlow* b) { return a->name() == b->name(); }
static const bool safeToCompareToEmptyOrDeleted = true;
};
// The HashTranslator is used to lookup a NamedFlow in the set using a name.
struct NamedFlowCollection::NamedFlowHashTranslator {
- static unsigned hash(const String& key) { return DefaultHash<String>::Hash::hash(key); }
- static bool equal(NamedFlow* a, const String& b) { return a->name() == b; }
+ static unsigned hash(const AtomicString& key) { return DefaultHash<AtomicString>::Hash::hash(key); }
+ static bool equal(NamedFlow* a, const AtomicString& b) { return a->name() == b; }
};
} // namespace WebCore
« no previous file with comments | « Source/core/dom/NamedFlowCollection.h ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698