OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |