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

Side by Side Diff: third_party/WebKit/Source/platform/network/ParsedContentDisposition.h

Issue 2880543003: Implement a parser for Content-Disposition header fields (Closed)
Patch Set: License headers Created 3 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ParsedContentDisposition_h
6 #define ParsedContentDisposition_h
7
8 #include "platform/PlatformExport.h"
9 #include "platform/network/ParsedContentHeaderFieldParameters.h"
10 #include "platform/wtf/Allocator.h"
11 #include "platform/wtf/HashMap.h"
12 #include "platform/wtf/text/StringHash.h"
13
14 namespace blink {
15
16 // ParsedContentType parses the constructor argument and stores the result.
kinuko 2017/05/22 07:39:45 This class's not ParsedContentType. Could you add
e_hakkinen 2017/05/22 08:11:59 Done.
17 class PLATFORM_EXPORT ParsedContentDisposition final {
18 STACK_ALLOCATED();
19
20 public:
21 using Mode = ParsedContentHeaderFieldParameters::Mode;
22
23 explicit ParsedContentDisposition(const String&, Mode = Mode::kNormal);
24
25 String Type() const { return type_; }
26 String Filename() const;
27
28 // Note that in the case of multiple values for the same name, the last value
29 // is returned.
30 String ParameterValueForName(const String& name) const {
31 return parameters_.ParameterValueForName(name);
32 }
33 size_t ParameterCount() const { return parameters_.ParameterCount(); }
34
35 bool IsValid() const { return parameters_.IsValid(); }
36
37 private:
38 String type_;
39 ParsedContentHeaderFieldParameters parameters_;
40 };
41
42 } // namespace blink
43
44 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698