OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 WEBKIT_BASE_ORIGIN_URL_CONVERSIONS_H_ | 5 #ifndef WEBKIT_BASE_ORIGIN_URL_CONVERSIONS_H_ |
6 #define WEBKIT_BASE_ORIGIN_URL_CONVERSIONS_H_ | 6 #define WEBKIT_BASE_ORIGIN_URL_CONVERSIONS_H_ |
7 | 7 |
8 #include "base/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "webkit/base/webkit_base_export.h" | 9 #include "webkit/base/webkit_base_export.h" |
10 | 10 |
11 class GURL; | 11 class GURL; |
12 | 12 |
13 namespace webkit_base { | 13 namespace webkit_base { |
14 | 14 |
15 // Returns the origin url for the given |identifier| and vice versa. | 15 // Returns the origin url for the given |identifier| and vice versa. |
16 // The origin identifier string is a serialized form of a security origin | 16 // The origin identifier string is a serialized form of a security origin |
17 // and can be used as a path name as it contains no "/" or other possibly | 17 // and can be used as a path name as it contains no "/" or other possibly |
18 // unsafe characters. (See WebKit's SecurityOrigin code for more details.) | 18 // unsafe characters. (See WebKit's SecurityOrigin code for more details.) |
19 // | 19 // |
20 // Example: | 20 // Example: |
21 // "http://www.example.com:80/"'s identifier should look like: | 21 // "http://www.example.com:80/"'s identifier should look like: |
22 // "http_www.example.host_80" | 22 // "http_www.example.host_80" |
23 WEBKIT_BASE_EXPORT GURL GetOriginURLFromIdentifier( | 23 WEBKIT_BASE_EXPORT GURL GetOriginURLFromIdentifier( |
24 const base::string16& identifier); | 24 const base::string16& identifier); |
25 | 25 |
26 WEBKIT_BASE_EXPORT base::string16 GetOriginIdentifierFromURL(const GURL& url); | 26 WEBKIT_BASE_EXPORT base::string16 GetOriginIdentifierFromURL(const GURL& url); |
27 | 27 |
28 } // namespace webkit_base | 28 } // namespace webkit_base |
29 | 29 |
30 #endif // WEBKIT_BASE_ORIGIN_URL_CONVERSIONS_H_ | 30 #endif // WEBKIT_BASE_ORIGIN_URL_CONVERSIONS_H_ |
OLD | NEW |