Chromium Code Reviews| Index: third_party/WebKit/Source/modules/fetch/Headers.h |
| diff --git a/third_party/WebKit/Source/modules/fetch/Headers.h b/third_party/WebKit/Source/modules/fetch/Headers.h |
| index de5ffab206b723d49c0ca457c72beaa2148233a4..cefee608e5a9ac7d7ab8d73715724ba4f409b357 100644 |
| --- a/third_party/WebKit/Source/modules/fetch/Headers.h |
| +++ b/third_party/WebKit/Source/modules/fetch/Headers.h |
| @@ -17,6 +17,9 @@ namespace blink { |
| class ByteStringSequenceSequenceOrByteStringByteStringRecordOrHeaders; |
| class ExceptionState; |
| +typedef ByteStringSequenceSequenceOrByteStringByteStringRecordOrHeaders |
| + HeadersInit; |
|
yhirano
2017/05/01 10:36:40
Though I call both "typedef", "using" is better, I
Raphael Kubo da Costa (rakuco)
2017/05/01 10:46:32
Done too :)
|
| + |
| // http://fetch.spec.whatwg.org/#headers-class |
| class MODULES_EXPORT Headers final : public GarbageCollected<Headers>, |
| public ScriptWrappable, |
| @@ -33,9 +36,7 @@ class MODULES_EXPORT Headers final : public GarbageCollected<Headers>, |
| }; |
| static Headers* Create(ExceptionState&); |
| - static Headers* Create( |
| - const ByteStringSequenceSequenceOrByteStringByteStringRecordOrHeaders&, |
| - ExceptionState&); |
| + static Headers* Create(const HeadersInit&, ExceptionState&); |
| // Shares the FetchHeaderList. Called when creating a Request or Response. |
| static Headers* Create(FetchHeaderList*); |
| @@ -54,8 +55,7 @@ class MODULES_EXPORT Headers final : public GarbageCollected<Headers>, |
| // These methods should only be called when size() would return 0. |
| void FillWith(const Headers*, ExceptionState&); |
| - void FillWith(const Vector<Vector<String>>&, ExceptionState&); |
| - void FillWith(const Vector<std::pair<String, String>>&, ExceptionState&); |
| + void FillWith(const HeadersInit&, ExceptionState&); |
| FetchHeaderList* HeaderList() const { return header_list_; } |
| DECLARE_TRACE(); |
| @@ -65,6 +65,10 @@ class MODULES_EXPORT Headers final : public GarbageCollected<Headers>, |
| // Shares the FetchHeaderList. Called when creating a Request or Response. |
| explicit Headers(FetchHeaderList*); |
| + // These methods should only be called when size() would return 0. |
| + void FillWith(const Vector<Vector<String>>&, ExceptionState&); |
| + void FillWith(const Vector<std::pair<String, String>>&, ExceptionState&); |
| + |
| Member<FetchHeaderList> header_list_; |
| Guard guard_; |