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 { ...@@ -103,13 +103,15 @@ QuotaClient::ID DatabaseQuotaClient::id() const {
return kDatabase; return kDatabase;
} }
void DatabaseQuotaClient::OnQuotaManagerDestroyed() {}
void DatabaseQuotaClient::GetOriginUsage(const url::Origin& origin, void DatabaseQuotaClient::GetOriginUsage(const url::Origin& origin,
StorageType type, StorageType type,
GetUsageCallback callback) { GetUsageCallback callback) {
DCHECK(!callback.is_null()); DCHECK(!callback.is_null());
DCHECK(db_tracker_.get()); DCHECK(db_tracker_.get());
// All databases are in the temp namespace for now. // All databases are in the default bucket.
if (type != StorageType::kTemporary) { if (type != StorageType::kTemporary) {
std::move(callback).Run(0); std::move(callback).Run(0);
return; return;
...@@ -127,7 +129,7 @@ void DatabaseQuotaClient::GetOriginsForType(StorageType type, ...@@ -127,7 +129,7 @@ void DatabaseQuotaClient::GetOriginsForType(StorageType type,
DCHECK(!callback.is_null()); DCHECK(!callback.is_null());
DCHECK(db_tracker_.get()); DCHECK(db_tracker_.get());
// All databases are in the temp namespace for now. // All databases are in the default bucket.
if (type != StorageType::kTemporary) { if (type != StorageType::kTemporary) {
std::move(callback).Run(std::set<url::Origin>()); std::move(callback).Run(std::set<url::Origin>());
return; return;
...@@ -148,7 +150,7 @@ void DatabaseQuotaClient::GetOriginsForHost(StorageType type, ...@@ -148,7 +150,7 @@ void DatabaseQuotaClient::GetOriginsForHost(StorageType type,
DCHECK(!callback.is_null()); DCHECK(!callback.is_null());
DCHECK(db_tracker_.get()); DCHECK(db_tracker_.get());
// All databases are in the temp namespace for now. // All databases are in the default bucket.
if (type != StorageType::kTemporary) { if (type != StorageType::kTemporary) {
std::move(callback).Run(std::set<url::Origin>()); std::move(callback).Run(std::set<url::Origin>());
return; return;
...@@ -170,7 +172,7 @@ void DatabaseQuotaClient::DeleteOriginData(const url::Origin& origin, ...@@ -170,7 +172,7 @@ void DatabaseQuotaClient::DeleteOriginData(const url::Origin& origin,
DCHECK(!callback.is_null()); DCHECK(!callback.is_null());
DCHECK(db_tracker_.get()); 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) { if (type != StorageType::kTemporary) {
std::move(callback).Run(blink::mojom::QuotaStatusCode::kOk); std::move(callback).Run(blink::mojom::QuotaStatusCode::kOk);
return; return;
......
...@@ -20,17 +20,17 @@ namespace storage { ...@@ -20,17 +20,17 @@ namespace storage {
class DatabaseTracker; class DatabaseTracker;
// A QuotaClient implementation to integrate WebSQLDatabases // Integrates WebSQL databases with the quota management system.
// with the quota management system. This interface is used //
// on the IO thread by the quota manager. // This interface is used on the IO thread by the quota manager.
class COMPONENT_EXPORT(STORAGE_BROWSER) DatabaseQuotaClient class COMPONENT_EXPORT(STORAGE_BROWSER) DatabaseQuotaClient
: public storage::QuotaClient { : public storage::QuotaClient {
public: public:
DatabaseQuotaClient(scoped_refptr<DatabaseTracker> tracker); explicit DatabaseQuotaClient(scoped_refptr<DatabaseTracker> tracker);
// QuotaClient method overrides // QuotaClient method overrides
ID id() const override; ID id() const override;
void OnQuotaManagerDestroyed() override {} void OnQuotaManagerDestroyed() override;
void GetOriginUsage(const url::Origin& origin, void GetOriginUsage(const url::Origin& origin,
blink::mojom::StorageType type, blink::mojom::StorageType type,
GetUsageCallback callback) override; 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