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

Unified Diff: third_party/WebKit/Source/modules/fetch/Headers.cpp

Issue 2854613002: fetch: Drop Headers from HeadersInit typedef declaration. (Closed)
Patch Set: Adjust expectations for ServiceWorkerVersionBrowserTest.FetchEvent_Response Created 3 years, 8 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: third_party/WebKit/Source/modules/fetch/Headers.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/Headers.cpp b/third_party/WebKit/Source/modules/fetch/Headers.cpp
index 85f7b18d77b9d1b5296046d2e2572744d961f562..7e6ea5f597759d5747cbd4997c10bab85c27a85b 100644
--- a/third_party/WebKit/Source/modules/fetch/Headers.cpp
+++ b/third_party/WebKit/Source/modules/fetch/Headers.cpp
@@ -6,7 +6,7 @@
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/V8IteratorResultValue.h"
-#include "bindings/modules/v8/ByteStringSequenceSequenceOrByteStringByteStringRecordOrHeaders.h"
+#include "bindings/modules/v8/ByteStringSequenceSequenceOrByteStringByteStringRecord.h"
#include "core/dom/Iterator.h"
#include "platform/loader/fetch/FetchUtils.h"
#include "platform/wtf/text/WTFString.h"
@@ -206,11 +206,11 @@ void Headers::set(const String& name,
header_list_->Set(name, value);
}
+// This overload is not called directly by Web APIs, but rather by other C++
+// classes. For example, when initializing a Request object it is possible that
+// a Request's Headers must be filled with an existing Headers object.
void Headers::FillWith(const Headers* object, ExceptionState& exception_state) {
DCHECK(header_list_->size() == 0);
- // There used to be specific steps describing filling a Headers object with
- // another Headers object, but it has since been removed because it should be
- // handled like a sequence (http://crbug.com/690428).
for (const auto& header : object->header_list_->List()) {
append(header.first, header.second, exception_state);
if (exception_state.HadException())
@@ -225,9 +225,6 @@ void Headers::FillWith(const HeadersInit& init,
FillWith(init.getAsByteStringSequenceSequence(), exception_state);
} else if (init.isByteStringByteStringRecord()) {
FillWith(init.getAsByteStringByteStringRecord(), exception_state);
- } else if (init.isHeaders()) {
- // This branch will not be necessary once http://crbug.com/690428 is fixed.
- FillWith(init.getAsHeaders(), exception_state);
} else {
NOTREACHED();
}
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/Headers.h ('k') | third_party/WebKit/Source/modules/fetch/Headers.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698