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

Unified Diff: webkit/database/database_util.cc

Issue 10578017: Test GURL::spec() usage changes with DEPS rolled to the new version. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes Created 8 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
« no previous file with comments | « sync/internal_api/write_node.cc ('k') | webkit/fileapi/file_system_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/database/database_util.cc
diff --git a/webkit/database/database_util.cc b/webkit/database/database_util.cc
index b5e8df0bfbe4b50cd1e835f66d63c2f1deed39d7..b38d9b59fc5bf25ba2f7a803cea823f04270c972 100644
--- a/webkit/database/database_util.cc
+++ b/webkit/database/database_util.cc
@@ -77,12 +77,14 @@ string16 DatabaseUtil::GetOriginIdentifier(const GURL& url) {
GURL DatabaseUtil::GetOriginFromIdentifier(const string16& origin_identifier) {
GURL origin(WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(
origin_identifier).toString());
- // We need this work-around for file:/// URIs as
- // createFromDatabaseIdentifier returns empty origin url for them.
- if (origin.spec().empty() &&
- origin_identifier.find(ASCIIToUTF16("file__")) == 0)
+ if (origin.is_valid())
+ return origin;
+ // Origin identifier for files start with 'file__', not with 'file:', thus
+ // GURL can't parse them correctly.
+ else if (origin_identifier.find(ASCIIToUTF16("file__")) == 0)
return GURL("file:///");
- return origin;
+ else
+ return GURL();
}
} // namespace webkit_database
« no previous file with comments | « sync/internal_api/write_node.cc ('k') | webkit/fileapi/file_system_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698