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

Unified Diff: Source/modules/serviceworkers/Headers.cpp

Issue 373423002: Split Dictionary's get and convert into DictionaryHelper. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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: Source/modules/serviceworkers/Headers.cpp
diff --git a/Source/modules/serviceworkers/Headers.cpp b/Source/modules/serviceworkers/Headers.cpp
index 187b3af1f31102bac0948409ba5b8393bcabbebb..96efcf7d14ade26a64ff456a22da5004b40f5267 100644
--- a/Source/modules/serviceworkers/Headers.cpp
+++ b/Source/modules/serviceworkers/Headers.cpp
@@ -6,6 +6,7 @@
#include "modules/serviceworkers/Headers.h"
#include "bindings/core/v8/Dictionary.h"
+#include "bindings/core/v8/DictionaryHelper.h"
#include "bindings/core/v8/ExceptionState.h"
#include "core/fetch/CrossOriginAccessControl.h"
#include "core/xml/XMLHttpRequest.h"
@@ -245,7 +246,7 @@ void Headers::fillWith(const Dictionary& object, ExceptionState& exceptionState)
// http://fetch.spec.whatwg.org/#headers-class
// FIXME: Support sequence<sequence<ByteString>>.
Vector<String> keyValuePair;
- if (object.get(keys[0], keyValuePair)) {
+ if (DictionaryHelper::get(object, keys[0], keyValuePair)) {
// "2. Otherwise, if |object| is a sequence, then for each |header| in
// |object|, run these substeps:
// 1. If |header| does not contain exactly two items, throw a
@@ -255,7 +256,7 @@ void Headers::fillWith(const Dictionary& object, ExceptionState& exceptionState)
for (size_t i = 0; i < keys.size(); ++i) {
// We've already got the keyValuePair for key[0].
if (i > 0) {
- if (!object.get(keys[i], keyValuePair)) {
+ if (!DictionaryHelper::get(object, keys[i], keyValuePair)) {
exceptionState.throwTypeError("Invalid value");
return;
}
@@ -280,7 +281,7 @@ void Headers::fillWith(const Dictionary& object, ExceptionState& exceptionState)
// FIXME: Support OpenEndedDictionary<ByteString>.
for (size_t i = 0; i < keys.size(); ++i) {
String value;
- if (!object.get(keys[i], value)) {
+ if (!DictionaryHelper::get(object, keys[i], value)) {
exceptionState.throwTypeError("Invalid value");
return;
}

Powered by Google App Engine
This is Rietveld 408576698