summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 06:46:59 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 06:46:59 +0000
commit2bddc10a9e71bd3e7d7f010b46ec96c7ab623336 (patch)
tree9911592f4b8e4ce831418a59c9576f7c2557a71a /webkit
parentf54b8bbe590c43580476f5c47ee3c5fc5db99c53 (diff)
downloadchromium_src-2bddc10a9e71bd3e7d7f010b46ec96c7ab623336.zip
chromium_src-2bddc10a9e71bd3e7d7f010b46ec96c7ab623336.tar.gz
chromium_src-2bddc10a9e71bd3e7d7f010b46ec96c7ab623336.tar.bz2
Add extra checks to see if given origin URL has no path part
This could cause mysterious errors in usage cache in quota_manager (usage_tracker) BUG=none Review URL: https://codereview.chromium.org/11358063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/fileapi/file_system_context.cc11
-rw-r--r--webkit/quota/quota_manager.cc4
2 files changed, 12 insertions, 3 deletions
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc
index 33e1825..44142e7 100644
--- a/webkit/fileapi/file_system_context.cc
+++ b/webkit/fileapi/file_system_context.cc
@@ -84,17 +84,21 @@ bool FileSystemContext::DeleteDataForOriginOnFileThread(
const GURL& origin_url) {
DCHECK(task_runners_->file_task_runner()->RunsTasksOnCurrentThread());
DCHECK(sandbox_provider());
+ DCHECK(origin_url == origin_url.GetOrigin());
// Delete temporary and persistent data.
return
(sandbox_provider()->DeleteOriginDataOnFileThread(
- this, quota_manager_proxy(), origin_url, kFileSystemTypeTemporary) ==
+ this, quota_manager_proxy(), origin_url,
+ kFileSystemTypeTemporary) ==
base::PLATFORM_FILE_OK) &&
(sandbox_provider()->DeleteOriginDataOnFileThread(
- this, quota_manager_proxy(), origin_url, kFileSystemTypePersistent) ==
+ this, quota_manager_proxy(), origin_url,
+ kFileSystemTypePersistent) ==
base::PLATFORM_FILE_OK) &&
(sandbox_provider()->DeleteOriginDataOnFileThread(
- this, quota_manager_proxy(), origin_url, kFileSystemTypeSyncable) ==
+ this, quota_manager_proxy(), origin_url,
+ kFileSystemTypeSyncable) ==
base::PLATFORM_FILE_OK);
}
@@ -222,6 +226,7 @@ void FileSystemContext::DeleteFileSystem(
const GURL& origin_url,
FileSystemType type,
const DeleteFileSystemCallback& callback) {
+ DCHECK(origin_url == origin_url.GetOrigin());
FileSystemMountPointProvider* mount_point_provider =
GetMountPointProvider(type);
if (!mount_point_provider) {
diff --git a/webkit/quota/quota_manager.cc b/webkit/quota/quota_manager.cc
index 00c144c..ce3e9e7 100644
--- a/webkit/quota/quota_manager.cc
+++ b/webkit/quota/quota_manager.cc
@@ -905,6 +905,7 @@ void QuotaManager::GetUsageInfo(const GetUsageInfoCallback& callback) {
void QuotaManager::GetUsageAndQuota(
const GURL& origin, StorageType type,
const GetUsageAndQuotaCallback& callback) {
+ DCHECK(origin == origin.GetOrigin());
GetUsageAndQuotaInternal(
origin, type, false /* global */,
base::Bind(&CallGetUsageAndQuotaCallback, callback,
@@ -914,12 +915,14 @@ void QuotaManager::GetUsageAndQuota(
void QuotaManager::NotifyStorageAccessed(
QuotaClient::ID client_id,
const GURL& origin, StorageType type) {
+ DCHECK(origin == origin.GetOrigin());
NotifyStorageAccessedInternal(client_id, origin, type, base::Time::Now());
}
void QuotaManager::NotifyStorageModified(
QuotaClient::ID client_id,
const GURL& origin, StorageType type, int64 delta) {
+ DCHECK(origin == origin.GetOrigin());
NotifyStorageModifiedInternal(client_id, origin, type, delta,
base::Time::Now());
}
@@ -947,6 +950,7 @@ void QuotaManager::DeleteOriginData(
return;
}
+ DCHECK(origin == origin.GetOrigin());
OriginDataDeleter* deleter =
new OriginDataDeleter(this, origin, type, quota_client_mask, callback);
deleter->Start();