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

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

Issue 2880543003: Implement a parser for Content-Disposition header fields (Closed)
Patch Set: Rebase 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 #include "platform/network/ParsedContentDisposition.h"
6
7 #include "platform/network/HeaderFieldTokenizer.h"
8
9 namespace blink {
10
11 ParsedContentDisposition::ParsedContentDisposition(
12 const String& content_disposition,
13 Mode mode) {
14 HeaderFieldTokenizer tokenizer(content_disposition);
15
16 StringView type;
17 if (!tokenizer.ConsumeToken(Mode::kNormal, type)) {
18 DVLOG(1) << "Failed to find `type' in '" << content_disposition << "'";
19 return;
20 }
21 type_ = type.ToString();
22
23 parameters_.ParseParameters(std::move(tokenizer), mode);
24 }
25
26 String ParsedContentDisposition::Filename() const {
27 return ParameterValueForName("filename");
28 }
29
30 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698