| Index: third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
|
| diff --git a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
|
| index b757b11af3c19d30d7eea8e9f03bee3800cc063c..f8061121b6c12cf09ce33e6d723e1b0a1d59749d 100644
|
| --- a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
|
| +++ b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
|
| @@ -7,6 +7,7 @@
|
| #include "core/fetch/FetchUtils.h"
|
| #include "platform/network/HTTPParsers.h"
|
| #include "wtf/PtrUtil.h"
|
| +#include <algorithm>
|
|
|
| namespace blink {
|
|
|
| @@ -14,7 +15,7 @@ FetchHeaderList* FetchHeaderList::create() {
|
| return new FetchHeaderList();
|
| }
|
|
|
| -FetchHeaderList* FetchHeaderList::clone() {
|
| +FetchHeaderList* FetchHeaderList::clone() const {
|
| FetchHeaderList* list = create();
|
| for (size_t i = 0; i < m_headerList.size(); ++i)
|
| list->append(m_headerList[i]->first, m_headerList[i]->second);
|
| @@ -126,6 +127,19 @@ bool FetchHeaderList::containsNonSimpleHeader() const {
|
| return false;
|
| }
|
|
|
| +void FetchHeaderList::sortAndCombine() {
|
| + // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
|
| + // "To sort and combine a header list..."
|
| +
|
| + // TODO(jsbell): Implement the combining part - this currently just sorts.
|
| +
|
| + std::sort(
|
| + m_headerList.begin(), m_headerList.end(),
|
| + [](const std::unique_ptr<Header>& a, const std::unique_ptr<Header>& b) {
|
| + return WTF::codePointCompareLessThan(a->first, b->first);
|
| + });
|
| +}
|
| +
|
| bool FetchHeaderList::isValidHeaderName(const String& name) {
|
| // "A name is a case-insensitive byte sequence that matches the field-name
|
| // token production."
|
|
|