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

Side by Side Diff: net/base/data_url.h

Issue 5542001: Allow data URLs to trigger downloads, as they do in Firefox.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/base/data_url.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_DATA_URL_H_ 5 #ifndef NET_BASE_DATA_URL_H_
6 #define NET_BASE_DATA_URL_H_ 6 #define NET_BASE_DATA_URL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 19 matching lines...) Expand all
30 public: 30 public:
31 // This method can be used to parse a 'data' URL into its component pieces. 31 // This method can be used to parse a 'data' URL into its component pieces.
32 // 32 //
33 // The resulting mime_type is normalized to lowercase. The data is the 33 // The resulting mime_type is normalized to lowercase. The data is the
34 // decoded data (e.g.., if the data URL specifies base64 encoding, then the 34 // decoded data (e.g.., if the data URL specifies base64 encoding, then the
35 // returned data is base64 decoded, and any %-escaped bytes are unescaped). 35 // returned data is base64 decoded, and any %-escaped bytes are unescaped).
36 // 36 //
37 // If the URL is malformed, then this method will return false, and its 37 // If the URL is malformed, then this method will return false, and its
38 // output variables will remain unchanged. On success, true is returned. 38 // output variables will remain unchanged. On success, true is returned.
39 // 39 //
40 // OPTIONAL: If |data| is NULL, then the <data> section will not be parsed
41 // or validated.
42 //
40 static bool Parse(const GURL& url, 43 static bool Parse(const GURL& url,
41 std::string* mime_type, 44 std::string* mime_type,
42 std::string* charset, 45 std::string* charset,
43 std::string* data); 46 std::string* data);
44 }; 47 };
45 48
46 } // namespace net 49 } // namespace net
47 50
48 #endif // NET_BASE_DATA_URL_H_ 51 #endif // NET_BASE_DATA_URL_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/data_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698