Chromium Code Reviews| Index: third_party/WebKit/Source/platform/network/ParsedContentDisposition.h |
| diff --git a/third_party/WebKit/Source/platform/network/ParsedContentDisposition.h b/third_party/WebKit/Source/platform/network/ParsedContentDisposition.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ede411c8afb37012d5cdc00064c69d775715c29c |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/platform/network/ParsedContentDisposition.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ParsedContentDisposition_h |
| +#define ParsedContentDisposition_h |
| + |
| +#include "platform/PlatformExport.h" |
| +#include "platform/network/ParsedContentHeaderFieldParameters.h" |
| +#include "platform/wtf/Allocator.h" |
| +#include "platform/wtf/HashMap.h" |
| +#include "platform/wtf/text/StringHash.h" |
| + |
| +namespace blink { |
| + |
| +// 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.
|
| +class PLATFORM_EXPORT ParsedContentDisposition final { |
| + STACK_ALLOCATED(); |
| + |
| + public: |
| + using Mode = ParsedContentHeaderFieldParameters::Mode; |
| + |
| + explicit ParsedContentDisposition(const String&, Mode = Mode::kNormal); |
| + |
| + String Type() const { return type_; } |
| + String Filename() const; |
| + |
| + // Note that in the case of multiple values for the same name, the last value |
| + // is returned. |
| + String ParameterValueForName(const String& name) const { |
| + return parameters_.ParameterValueForName(name); |
| + } |
| + size_t ParameterCount() const { return parameters_.ParameterCount(); } |
| + |
| + bool IsValid() const { return parameters_.IsValid(); } |
| + |
| + private: |
| + String type_; |
| + ParsedContentHeaderFieldParameters parameters_; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif |