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

Unified Diff: webkit/common/database/database_identifier.cc

Issue 16879013: Use chromium logic for database identifier<->origin conversions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove webkit/base/origin_url_conversions Created 7 years, 6 months 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 side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « webkit/common/database/database_identifier.h ('k') | webkit/common/database/database_identifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698