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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/Headers.h

Issue 2840193002: fetch: Align RequestInit's |headers| with the spec. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/Headers.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef Headers_h 5 #ifndef Headers_h
6 #define Headers_h 6 #define Headers_h
7 7
8 #include "bindings/core/v8/Iterable.h" 8 #include "bindings/core/v8/Iterable.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 String get(const String& key, ExceptionState&); 48 String get(const String& key, ExceptionState&);
49 Vector<String> getAll(const String& key, ExceptionState&); 49 Vector<String> getAll(const String& key, ExceptionState&);
50 bool has(const String& key, ExceptionState&); 50 bool has(const String& key, ExceptionState&);
51 void set(const String& key, const String& value, ExceptionState&); 51 void set(const String& key, const String& value, ExceptionState&);
52 52
53 void SetGuard(Guard guard) { guard_ = guard; } 53 void SetGuard(Guard guard) { guard_ = guard; }
54 Guard GetGuard() const { return guard_; } 54 Guard GetGuard() const { return guard_; }
55 55
56 // These methods should only be called when size() would return 0. 56 // These methods should only be called when size() would return 0.
57 void FillWith(const Headers*, ExceptionState&); 57 void FillWith(const Headers*, ExceptionState&);
58 void FillWith(const Vector<Vector<String>>&, ExceptionState&); 58 void FillWith(
59 void FillWith(const Vector<std::pair<String, String>>&, ExceptionState&); 59 const ByteStringSequenceSequenceOrByteStringByteStringRecordOrHeaders&,
yhirano 2017/04/28 10:07:44 Could you provide a typedef for this type? Maybe H
Raphael Kubo da Costa (rakuco) 2017/05/01 09:57:12 Done.
60 ExceptionState&);
60 61
61 FetchHeaderList* HeaderList() const { return header_list_; } 62 FetchHeaderList* HeaderList() const { return header_list_; }
62 DECLARE_TRACE(); 63 DECLARE_TRACE();
63 64
64 private: 65 private:
65 Headers(); 66 Headers();
66 // Shares the FetchHeaderList. Called when creating a Request or Response. 67 // Shares the FetchHeaderList. Called when creating a Request or Response.
67 explicit Headers(FetchHeaderList*); 68 explicit Headers(FetchHeaderList*);
68 69
70 // These methods should only be called when size() would return 0.
71 void FillWith(const Vector<Vector<String>>&, ExceptionState&);
72 void FillWith(const Vector<std::pair<String, String>>&, ExceptionState&);
73
69 Member<FetchHeaderList> header_list_; 74 Member<FetchHeaderList> header_list_;
70 Guard guard_; 75 Guard guard_;
71 76
72 IterationSource* StartIteration(ScriptState*, ExceptionState&) override; 77 IterationSource* StartIteration(ScriptState*, ExceptionState&) override;
73 }; 78 };
74 79
75 } // namespace blink 80 } // namespace blink
76 81
77 #endif // Headers_h 82 #endif // Headers_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/Headers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698