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

Unified Diff: third_party/WebKit/Source/platform/network/ContentHeaderFieldInput.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/network/ContentHeaderFieldInput.h
diff --git a/third_party/WebKit/Source/platform/network/ContentHeaderFieldInput.h b/third_party/WebKit/Source/platform/network/ContentHeaderFieldInput.h
new file mode 100644
index 0000000000000000000000000000000000000000..5586bb78392285a5240a0e5f35af27c95533d576
--- /dev/null
+++ b/third_party/WebKit/Source/platform/network/ContentHeaderFieldInput.h
@@ -0,0 +1,38 @@
+// 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 ContentHeaderFieldInput_h
+#define ContentHeaderFieldInput_h
+
+#include "platform/network/ParsedContentHeaderFieldParameters.h"
+#include "platform/wtf/text/WTFString.h"
+
+namespace blink {
+
+class ContentHeaderFieldInput final {
kinuko 2017/05/22 07:39:44 Please add a class-level comment. It'd be probabl
yhirano 2017/05/22 07:51:20 Please write a class comment.
e_hakkinen 2017/05/22 08:11:58 Done.
+ STACK_ALLOCATED();
+
+ public:
+ using Mode = ParsedContentHeaderFieldParameters::Mode;
+
+ explicit ContentHeaderFieldInput(const String& header_field);
+ ContentHeaderFieldInput(ContentHeaderFieldInput&&);
+
+ bool Consume(char);
yhirano 2017/05/22 07:51:20 It would be good to explain what the returned bool
e_hakkinen 2017/05/22 08:11:58 Done.
+ bool ConsumeToken(Mode, StringView& output);
+ bool ConsumeTokenOrQuotedString(Mode, String& output);
+ unsigned Index() const { return index_; }
+ bool IsConsumed() const { return index_ >= input_.length(); }
+ void SkipSpaces();
+
+ private:
+ bool ConsumeQuotedString(String& output);
+
+ unsigned index_;
+ const String input_;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698