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

Unified Diff: webkit/fileapi/file_system_util.cc

Issue 10572006: Fix GetOriginURLFromIdentifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to using isUnique. 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 | « webkit/database/database_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_util.cc
diff --git a/webkit/fileapi/file_system_util.cc b/webkit/fileapi/file_system_util.cc
index 089e4e288d3f81cfcd298090117287a1528be2ab..5224b3596923ffa6bb31cf88d8ec92449308e1d4 100644
--- a/webkit/fileapi/file_system_util.cc
+++ b/webkit/fileapi/file_system_util.cc
@@ -205,14 +205,16 @@ GURL GetOriginURLFromIdentifier(const std::string& origin_identifier) {
WebKit::WebSecurityOrigin web_security_origin =
WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(
UTF8ToUTF16(origin_identifier));
- GURL origin_url(web_security_origin.toString());
// We need this work-around for file:/// URIs as
- // createFromDatabaseIdentifier returns empty origin_url for them.
- if (origin_url.spec().empty() &&
- origin_identifier.find("file__") == 0)
- return GURL("file:///");
- return origin_url;
+ // createFromDatabaseIdentifier returns null origin_url for them.
+ if (web_security_origin.isUnique()) {
+ if (origin_identifier.find("file__") == 0)
+ return GURL("file:///");
+ return GURL();
+ }
+
+ return GURL(web_security_origin.toString());
}
std::string GetFileSystemTypeString(FileSystemType type) {
« no previous file with comments | « webkit/database/database_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698