| Index: third_party/WebKit/Source/modules/fetch/RequestInit.cpp
|
| diff --git a/third_party/WebKit/Source/modules/fetch/RequestInit.cpp b/third_party/WebKit/Source/modules/fetch/RequestInit.cpp
|
| index 54a76a215bdb1497bd74102830eef4e701a0dc90..b892ca9071dbb80a5f5d732fe0c05063c5b1cab6 100644
|
| --- a/third_party/WebKit/Source/modules/fetch/RequestInit.cpp
|
| +++ b/third_party/WebKit/Source/modules/fetch/RequestInit.cpp
|
| @@ -11,6 +11,7 @@
|
| #include "bindings/core/v8/V8Blob.h"
|
| #include "bindings/core/v8/V8FormData.h"
|
| #include "bindings/core/v8/V8URLSearchParams.h"
|
| +#include "bindings/modules/v8/ByteStringSequenceSequenceOrDictionaryOrHeaders.h"
|
| #include "bindings/modules/v8/V8PasswordCredential.h"
|
| #include "core/dom/URLSearchParams.h"
|
| #include "core/fileapi/Blob.h"
|
| @@ -30,18 +31,11 @@ RequestInit::RequestInit(ExecutionContext* context,
|
| ExceptionState& exceptionState)
|
| : areAnyMembersSet(false) {
|
| areAnyMembersSet |= DictionaryHelper::get(options, "method", method);
|
| - areAnyMembersSet |= DictionaryHelper::get(options, "headers", headers);
|
| - if (!headers) {
|
| - Vector<Vector<String>> headersVector;
|
| - if (DictionaryHelper::get(options, "headers", headersVector,
|
| - exceptionState)) {
|
| - headers = Headers::create(headersVector, exceptionState);
|
| - areAnyMembersSet = true;
|
| - } else {
|
| - areAnyMembersSet |=
|
| - DictionaryHelper::get(options, "headers", headersDictionary);
|
| - }
|
| - }
|
| +
|
| + v8::Local<v8::Value> v8Headers;
|
| + bool isHeadersSet = DictionaryHelper::get(options, "headers", v8Headers);
|
| + areAnyMembersSet |= isHeadersSet;
|
| +
|
| areAnyMembersSet |= DictionaryHelper::get(options, "mode", mode);
|
| areAnyMembersSet |= DictionaryHelper::get(options, "redirect", redirect);
|
| AtomicString referrerString;
|
| @@ -99,6 +93,15 @@ RequestInit::RequestInit(ExecutionContext* context,
|
| }
|
|
|
| v8::Isolate* isolate = toIsolate(context);
|
| +
|
| + if (isHeadersSet) {
|
| + ByteStringSequenceSequenceOrDictionaryOrHeaders headersInit;
|
| + V8ByteStringSequenceSequenceOrDictionaryOrHeaders::toImpl(
|
| + isolate, v8Headers, headersInit, UnionTypeConversionMode::NotNullable,
|
| + exceptionState);
|
| + headers = Headers::create(headersInit, exceptionState);
|
| + }
|
| +
|
| if (isCredentialSet) {
|
| if (V8PasswordCredential::hasInstance(v8Credential, isolate)) {
|
| // TODO(mkwst): According to the spec, we'd serialize this once we touch
|
|
|