Index: net/http/http_content_disposition.h |
diff --git a/net/http/http_content_disposition.h b/net/http/http_content_disposition.h |
index f3573a9dceadcc27a6c9c54e8b7c0452b4f3e2a4..580f9046e82de212461a8b990e6c6187a30646d0 100644 |
--- a/net/http/http_content_disposition.h |
+++ b/net/http/http_content_disposition.h |
@@ -19,6 +19,37 @@ class NET_EXPORT HttpContentDisposition { |
ATTACHMENT, |
}; |
+ // Properties of the Content-Disposition header. Used for UMA. |
+ struct ParseResult { |
+ ParseResult(); |
+ |
+ // A valid disposition-type was present. |
+ bool has_disposition_type; |
+ |
+ // The disposition-type was not 'inline' or 'attachment'. |
+ bool has_unknown_disposition_type; |
+ |
+ // Has a valid non-empty 'name' attribute. |
+ bool has_name; |
+ |
+ // Has a valid non-empty 'filename' attribute. |
+ bool has_filename; |
+ |
+ // Has a valid non-empty 'filename*' attribute. |
+ bool has_ext_filename; |
+ |
+ // The following fields are properties of the 'filename' attribute: |
+ |
+ // quoted-string contained non-ASCII characters. |
rvargas (doing something else)
2012/12/14 22:49:54
nit: I know why you do it this way, but do you min
asanka
2012/12/15 01:57:32
Done.
|
+ bool has_non_ascii_strings; |
+ |
+ // quoted-string contained percent-encoding. |
+ bool has_percent_encoded_strings; |
+ |
+ // quoted-string contained RFC 2047 encoded words. |
+ bool has_rfc2047_encoded_strings; |
+ }; |
+ |
HttpContentDisposition(const std::string& header, |
const std::string& referrer_charset); |
~HttpContentDisposition(); |
@@ -28,6 +59,8 @@ class NET_EXPORT HttpContentDisposition { |
Type type() const { return type_; } |
const std::string& filename() const { return filename_; } |
+ const ParseResult& parse_result() const { return parse_result_; } |
+ |
private: |
void Parse(const std::string& header, const std::string& referrer_charset); |
std::string::const_iterator ConsumeDispositionType( |
@@ -35,6 +68,7 @@ class NET_EXPORT HttpContentDisposition { |
Type type_; |
std::string filename_; |
+ ParseResult parse_result_; |
DISALLOW_COPY_AND_ASSIGN(HttpContentDisposition); |
}; |