Commit f64ed8f1 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

WebSQL: Minor improvements to QuotaClient implementation.

1) Make constructor explicit.
2) Remove inline definition of virtual function.
3) Update obsolete comments.

Bug: 1016065
Change-Id: Ic66263b7919668323d525f153c28bb8475ff3f3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2045727Reviewed-by: default avatarChris Mumford <cmumford@google.com>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740067}
parent 1ea07b24
......@@ -103,13 +103,15 @@ QuotaClient::ID DatabaseQuotaClient::id() const {
return kDatabase;
}
void DatabaseQuotaClient::OnQuotaManagerDestroyed() {}
void DatabaseQuotaClient::GetOriginUsage(const url::Origin& origin,
StorageType type,
GetUsageCallback callback) {
DCHECK(!callback.is_null());
DCHECK(db_tracker_.get());
// All databases are in the temp namespace for now.
// All databases are in the default bucket.
if (type != StorageType::kTemporary) {
std::move(callback).Run(0);
return;
......@@ -127,7 +129,7 @@ void DatabaseQuotaClient::GetOriginsForType(StorageType type,
DCHECK(!callback.is_null());
DCHECK(db_tracker_.get());
// All databases are in the temp namespace for now.
// All databases are in the default bucket.
if (type != StorageType::kTemporary) {
std::move(callback).Run(std::set<url::Origin>());
return;
......@@ -148,7 +150,7 @@ void DatabaseQuotaClient::GetOriginsForHost(StorageType type,
DCHECK(!callback.is_null());
DCHECK(db_tracker_.get());
// All databases are in the temp namespace for now.
// All databases are in the default bucket.
if (type != StorageType::kTemporary) {
std::move(callback).Run(std::set<url::Origin>());
return;
......@@ -170,7 +172,7 @@ void DatabaseQuotaClient::DeleteOriginData(const url::Origin& origin,
DCHECK(!callback.is_null());
DCHECK(db_tracker_.get());
// All databases are in the temp namespace for now, so nothing to delete.
// All databases are in the default bucket.
if (type != StorageType::kTemporary) {
std::move(callback).Run(blink::mojom::QuotaStatusCode::kOk);
return;
......
......@@ -20,17 +20,17 @@ namespace storage {
class DatabaseTracker;
// A QuotaClient implementation to integrate WebSQLDatabases
// with the quota management system. This interface is used
// on the IO thread by the quota manager.
// Integrates WebSQL databases with the quota management system.
//
// This interface is used on the IO thread by the quota manager.
class COMPONENT_EXPORT(STORAGE_BROWSER) DatabaseQuotaClient
: public storage::QuotaClient {
public:
DatabaseQuotaClient(scoped_refptr<DatabaseTracker> tracker);
explicit DatabaseQuotaClient(scoped_refptr<DatabaseTracker> tracker);
// QuotaClient method overrides
ID id() const override;
void OnQuotaManagerDestroyed() override {}
void OnQuotaManagerDestroyed() override;
void GetOriginUsage(const url::Origin& origin,
blink::mojom::StorageType type,
GetUsageCallback callback) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment