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

Unified Diff: webkit/database/database_util.cc

Issue 10572006: Fix GetOriginURLFromIdentifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Just the right fix, but in two places. 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 | « no previous file | 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..52d7f7b90cefd73ac665aced64177c91fbee0da2 100644
--- a/webkit/database/database_util.cc
+++ b/webkit/database/database_util.cc
@@ -75,14 +75,19 @@ string16 DatabaseUtil::GetOriginIdentifier(const GURL& url) {
}
GURL DatabaseUtil::GetOriginFromIdentifier(const string16& origin_identifier) {
- GURL origin(WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(
- origin_identifier).toString());
+ WebKit::WebSecurityOrigin web_security_origin =
+ WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(
+ origin_identifier);
+
// 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)
- return GURL("file:///");
- return origin;
+ // createFromDatabaseIdentifier returns null origin_url for them.
+ if (web_security_origin.toString().equals("null")) {
kinuko 2012/06/20 11:39:01 Looks like maybe we could instead call web_securit
+ if (origin_identifier.find(UTF8ToUTF16("file__")) == 0)
+ return GURL("file:///");
+ return GURL();
+ }
+
+ return GURL(web_security_origin.toString());
}
} // namespace webkit_database
« no previous file with comments | « no previous file | webkit/fileapi/file_system_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698