Index: webkit/common/database/database_identifier.cc |
diff --git a/webkit/common/database/database_identifier.cc b/webkit/common/database/database_identifier.cc |
index 72e6cd66e29b08400a3b155d44161617463a4c32..f432f38f9546e1406b234270db228efb954e89b6 100644 |
--- a/webkit/common/database/database_identifier.cc |
+++ b/webkit/common/database/database_identifier.cc |
@@ -10,6 +10,16 @@ |
namespace webkit_database { |
+// static |
+std::string GetIdentifierFromOrigin(const GURL& origin) { |
+ return DatabaseIdentifier::CreateFromOrigin(origin).ToString(); |
+} |
+ |
+// static |
+GURL GetOriginFromIdentifier(const std::string& identifier) { |
+ return DatabaseIdentifier::Parse(identifier).ToOrigin(); |
+} |
+ |
static bool SchemeIsUnique(const std::string& scheme) { |
return scheme == "about" || scheme == "data" || scheme == "javascript"; |
} |
@@ -116,6 +126,8 @@ std::string DatabaseIdentifier::ToString() const { |
} |
GURL DatabaseIdentifier::ToOrigin() const { |
+ if (is_file_) |
+ return GURL("file:///"); |
if (is_unique_) |
return GURL(); |
if (port_ == 0) |