Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 // ParsedContentDisposition parses the content of a Content-Disposition header | |
|
kinuko
2017/05/23 11:27:31
nit: this can just start with "Parses the..." with
e_hakkinen
2017/05/23 20:07:02
Done.
| |
| 17 // field into disposition type and parameters and stores them. | |
| 18 class PLATFORM_EXPORT ParsedContentDisposition final { | |
| 19 STACK_ALLOCATED(); | |
| 20 | |
| 21 public: | |
| 22 using Mode = ParsedContentHeaderFieldParameters::Mode; | |
| 23 | |
| 24 explicit ParsedContentDisposition(const String&, Mode = Mode::kNormal); | |
| 25 | |
| 26 String Type() const { return type_; } | |
| 27 String Filename() const; | |
| 28 | |
| 29 // Note that in the case of multiple values for the same name, the last value | |
| 30 // is returned. | |
| 31 String ParameterValueForName(const String& name) const { | |
| 32 return parameters_.ParameterValueForName(name); | |
| 33 } | |
| 34 size_t ParameterCount() const { return parameters_.ParameterCount(); } | |
| 35 | |
| 36 bool IsValid() const { return parameters_.IsValid(); } | |
| 37 | |
| 38 private: | |
| 39 String type_; | |
| 40 ParsedContentHeaderFieldParameters parameters_; | |
| 41 }; | |
| 42 | |
| 43 } // namespace blink | |
| 44 | |
| 45 #endif | |
| OLD | NEW |