summaryrefslogtreecommitdiffstats
path: root/webkit/database/database_util.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-25 03:25:06 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-25 03:25:06 +0000
commit8ad0e6bea30cbef719b531dfaa7b4009581ee23e (patch)
tree1e974ce095f622a8cd9c4d1a56e7e70766fc0e52 /webkit/database/database_util.cc
parentc25bb740b849135b1316bcbb0c30a13d8dda34a2 (diff)
downloadchromium_src-8ad0e6bea30cbef719b531dfaa7b4009581ee23e.zip
chromium_src-8ad0e6bea30cbef719b531dfaa7b4009581ee23e.tar.gz
chromium_src-8ad0e6bea30cbef719b531dfaa7b4009581ee23e.tar.bz2
We need this work-around for file:/// URIs as
createFromDatabaseIdentifier() returns empty origin urls for them. Review URL: http://codereview.chromium.org/7053007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86563 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/database/database_util.cc')
-rw-r--r--webkit/database/database_util.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/webkit/database/database_util.cc b/webkit/database/database_util.cc
index d86a8c2..184e495 100644
--- a/webkit/database/database_util.cc
+++ b/webkit/database/database_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -77,7 +77,11 @@ string16 DatabaseUtil::GetOriginIdentifier(const GURL& url) {
GURL DatabaseUtil::GetOriginFromIdentifier(const string16& origin_identifier) {
GURL origin(WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(
origin_identifier).toString());
- DCHECK(origin == origin.GetOrigin());
+ // 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;
}