diff options
Diffstat (limited to 'webkit/fileapi/file_system_quota.cc')
-rw-r--r-- | webkit/fileapi/file_system_quota.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/webkit/fileapi/file_system_quota.cc b/webkit/fileapi/file_system_quota.cc new file mode 100644 index 0000000..eb69beb --- /dev/null +++ b/webkit/fileapi/file_system_quota.cc @@ -0,0 +1,35 @@ +// Copyright (c) 2010 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. + +#include "webkit/fileapi/file_system_quota.h" + +#include "base/file_path.h" +#include "base/file_util_proxy.h" +#include "base/ref_counted.h" +#include "base/scoped_callback_factory.h" + +namespace fileapi { + +const int64 FileSystemQuota::kUnknownSize = -1; + +bool FileSystemQuota::CheckOriginQuota(const GURL& origin, int64) { + return CheckIfOriginGrantedUnlimitedQuota(origin); +} + +void FileSystemQuota::SetOriginQuotaUnlimited(const GURL& origin) { + DCHECK(origin == origin.GetOrigin()); + unlimited_quota_origins_.insert(origin); +} + +void FileSystemQuota::ResetOriginQuotaUnlimited(const GURL& origin) { + DCHECK(origin == origin.GetOrigin()); + unlimited_quota_origins_.erase(origin); +} + +bool FileSystemQuota::CheckIfOriginGrantedUnlimitedQuota(const GURL& origin) { + std::set<GURL>::const_iterator found = unlimited_quota_origins_.find(origin); + return (found != unlimited_quota_origins_.end()); +} + +} // namespace fileapi |