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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/Dictionary.h

Issue 2285183005: Use StringView in Dictionary and DictionaryHelper. (Closed)
Patch Set: rebase. Created 4 years, 4 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/bindings/core/v8/Dictionary.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/Dictionary.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/Dictionary.h b/third_party/WebKit/Source/bindings/core/v8/Dictionary.h
index 926a02323042fc70db5706b04c0325930de28a8b..e930ed8ca5acce22ddf90eb34831bc3384bdcc33 100644
--- a/third_party/WebKit/Source/bindings/core/v8/Dictionary.h
+++ b/third_party/WebKit/Source/bindings/core/v8/Dictionary.h
@@ -29,15 +29,11 @@
#include "bindings/core/v8/DictionaryIterator.h"
#include "bindings/core/v8/ExceptionMessages.h"
#include "bindings/core/v8/Nullable.h"
-#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/V8Binding.h"
-#include "bindings/core/v8/V8BindingMacros.h"
#include "core/CoreExport.h"
#include "wtf/HashMap.h"
-#include "wtf/HashSet.h"
#include "wtf/Vector.h"
-#include "wtf/text/AtomicString.h"
-#include "wtf/text/WTFString.h"
+#include "wtf/text/StringView.h"
#include <v8.h>
namespace blink {
@@ -67,15 +63,15 @@ public:
bool isObject() const;
bool isUndefinedOrNull() const;
- bool get(const String&, Dictionary&) const;
- bool get(const String&, v8::Local<v8::Value>&) const;
+ bool get(const StringView&, Dictionary&) const;
+ bool get(const StringView&, v8::Local<v8::Value>&) const;
v8::Local<v8::Value> v8Value() const { return m_options; }
bool getOwnPropertiesAsStringHashMap(HashMap<String, String>&) const;
bool getPropertyNames(Vector<String>&) const;
- bool hasProperty(const String&) const;
+ bool hasProperty(const StringView&) const;
v8::Isolate* isolate() const { return m_isolate; }
v8::Local<v8::Context> v8Context() const
@@ -84,7 +80,6 @@ public:
return m_isolate->GetCurrentContext();
}
- bool getKey(const String& key, v8::Local<v8::Value>&) const;
DictionaryIterator getIterator(ExecutionContext*) const;
private:
@@ -108,21 +103,21 @@ struct NativeValueTraits<Dictionary> {
struct DictionaryHelper {
STATIC_ONLY(DictionaryHelper);
template <typename T>
- static bool get(const Dictionary&, const String& key, T& value);
+ static bool get(const Dictionary&, const StringView& key, T& value);
template <typename T>
- static bool get(const Dictionary&, const String& key, T& value, bool& hasValue);
+ static bool get(const Dictionary&, const StringView& key, T& value, bool& hasValue);
template <typename T>
- static bool get(const Dictionary&, const String& key, T& value, ExceptionState&);
+ static bool get(const Dictionary&, const StringView& key, T& value, ExceptionState&);
template <typename T>
- static bool getWithUndefinedOrNullCheck(const Dictionary& dictionary, const String& key, T& value)
+ static bool getWithUndefinedOrNullCheck(const Dictionary& dictionary, const StringView& key, T& value)
{
v8::Local<v8::Value> v8Value;
- if (!dictionary.getKey(key, v8Value) || isUndefinedOrNull(v8Value))
+ if (!dictionary.get(key, v8Value) || isUndefinedOrNull(v8Value))
return false;
return DictionaryHelper::get(dictionary, key, value);
}
template <template <typename> class PointerType, typename T>
- static bool get(const Dictionary&, const String& key, PointerType<T>& value);
+ static bool get(const Dictionary&, const StringView& key, PointerType<T>& value);
};
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698