Lines Matching +full:whatwg +full:- +full:url
2 // Use of this source code is governed by a BSD-style license that can be
22 #include "url/gurl.h"
27 // https://infra.spec.whatwg.org/#ascii-whitespace, which is referenced by
28 // https://infra.spec.whatwg.org/#forgiving-base64, does not include \v in the
34 // A data URL is ready for decode if it:
35 // - Doesn't need any extra padding.
36 // - Does not have any escaped characters.
37 // - Does not have any whitespace.
46 bool DataURL::Parse(const GURL& url, in Parse() argument
50 if (!url.is_valid() || !url.has_scheme()) in Parse()
53 DCHECK(mime_type->empty()); in Parse()
54 DCHECK(charset->empty()); in Parse()
55 DCHECK(!data || data->empty()); in Parse()
60 // Avoid copying the URL content which can be expensive for large URLs. in Parse()
61 content = url.GetContentPiece(); in Parse()
63 content_string = url.GetContent(); in Parse()
95 charset_value = std::string(iter->substr(kCharsetTag.size())); in Parse()
109 charset_value = "US-ASCII"; in Parse()
114 // set to "US-ASCII". in Parse()
116 charset_value = "US-ASCII"; in Parse()
125 // (Spaces in a data URL should be escaped, which is handled below, so any in Parse()
126 // spaces now are wrong. People expect to be able to enter them in the URL in Parse()
135 // For base64, we may have url-escaped whitespace which is not part in Parse()
139 // If the data URL is well formed, we can decode it immediately. in Parse()
151 // Strip whitespace for non-text MIME types. in Parse()
169 Error DataURL::BuildResponse(const GURL& url, in BuildResponse() argument
178 if (!DataURL::Parse(url, mime_type, charset, data)) in BuildResponse()
184 DCHECK(!mime_type->empty()); in BuildResponse()
186 // "charset" in the Content-Type header is specified explicitly to follow in BuildResponse()
191 if (!charset->empty()) in BuildResponse()
196 "Content-Type:" + in BuildResponse()
198 // Above line should always succeed - TryToCreate() only fails when there are in BuildResponse()
204 data->clear(); in BuildResponse()