| Index: trunk/src/content/browser/indexed_db/indexed_db_quota_client.cc
|
| ===================================================================
|
| --- trunk/src/content/browser/indexed_db/indexed_db_quota_client.cc (revision 202301)
|
| +++ trunk/src/content/browser/indexed_db/indexed_db_quota_client.cc (working copy)
|
| @@ -26,34 +26,37 @@
|
| return quota::kQuotaStatusOk;
|
| }
|
|
|
| -int64 GetOriginUsageOnWebKitThread(IndexedDBContextImpl* context,
|
| - const GURL& origin) {
|
| +int64 GetOriginUsageOnWebKitThread(
|
| + IndexedDBContextImpl* context,
|
| + const GURL& origin) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
|
| return context->GetOriginDiskUsage(origin);
|
| }
|
|
|
| -void GetAllOriginsOnWebKitThread(IndexedDBContextImpl* context,
|
| - std::set<GURL>* origins_to_return) {
|
| +void GetAllOriginsOnWebKitThread(
|
| + IndexedDBContextImpl* context,
|
| + std::set<GURL>* origins_to_return) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
|
| std::vector<GURL> all_origins = context->GetAllOrigins();
|
| origins_to_return->insert(all_origins.begin(), all_origins.end());
|
| }
|
|
|
| -void DidGetOrigins(const IndexedDBQuotaClient::GetOriginsCallback& callback,
|
| - const std::set<GURL>* origins,
|
| - quota::StorageType storage_type) {
|
| +void DidGetOrigins(
|
| + const IndexedDBQuotaClient::GetOriginsCallback& callback,
|
| + const std::set<GURL>* origins,
|
| + quota::StorageType storage_type) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| callback.Run(*origins, storage_type);
|
| }
|
|
|
| -void GetOriginsForHostOnWebKitThread(IndexedDBContextImpl* context,
|
| - const std::string& host,
|
| - std::set<GURL>* origins_to_return) {
|
| +void GetOriginsForHostOnWebKitThread(
|
| + IndexedDBContextImpl* context,
|
| + const std::string& host,
|
| + std::set<GURL>* origins_to_return) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
|
| std::vector<GURL> all_origins = context->GetAllOrigins();
|
| for (std::vector<GURL>::const_iterator iter = all_origins.begin();
|
| - iter != all_origins.end();
|
| - ++iter) {
|
| + iter != all_origins.end(); ++iter) {
|
| if (host == net::GetHostOrSpecFromURL(*iter))
|
| origins_to_return->insert(*iter);
|
| }
|
| @@ -67,17 +70,24 @@
|
| base::MessageLoopProxy* webkit_thread_message_loop,
|
| IndexedDBContextImpl* indexed_db_context)
|
| : webkit_thread_message_loop_(webkit_thread_message_loop),
|
| - indexed_db_context_(indexed_db_context) {}
|
| + indexed_db_context_(indexed_db_context) {
|
| +}
|
|
|
| -IndexedDBQuotaClient::~IndexedDBQuotaClient() {}
|
| +IndexedDBQuotaClient::~IndexedDBQuotaClient() {
|
| +}
|
|
|
| -QuotaClient::ID IndexedDBQuotaClient::id() const { return kIndexedDatabase; }
|
| +QuotaClient::ID IndexedDBQuotaClient::id() const {
|
| + return kIndexedDatabase;
|
| +}
|
|
|
| -void IndexedDBQuotaClient::OnQuotaManagerDestroyed() { delete this; }
|
| +void IndexedDBQuotaClient::OnQuotaManagerDestroyed() {
|
| + delete this;
|
| +}
|
|
|
| -void IndexedDBQuotaClient::GetOriginUsage(const GURL& origin_url,
|
| - quota::StorageType type,
|
| - const GetUsageCallback& callback) {
|
| +void IndexedDBQuotaClient::GetOriginUsage(
|
| + const GURL& origin_url,
|
| + quota::StorageType type,
|
| + const GetUsageCallback& callback) {
|
| DCHECK(!callback.is_null());
|
| DCHECK(indexed_db_context_.get());
|
|
|
| @@ -90,8 +100,9 @@
|
| base::PostTaskAndReplyWithResult(
|
| webkit_thread_message_loop_,
|
| FROM_HERE,
|
| - base::Bind(
|
| - &GetOriginUsageOnWebKitThread, indexed_db_context_, origin_url),
|
| + base::Bind(&GetOriginUsageOnWebKitThread,
|
| + indexed_db_context_,
|
| + origin_url),
|
| callback);
|
| }
|
|
|
| @@ -113,8 +124,10 @@
|
| base::Bind(&GetAllOriginsOnWebKitThread,
|
| indexed_db_context_,
|
| base::Unretained(origins_to_return)),
|
| - base::Bind(
|
| - &DidGetOrigins, callback, base::Owned(origins_to_return), type));
|
| + base::Bind(&DidGetOrigins,
|
| + callback,
|
| + base::Owned(origins_to_return),
|
| + type));
|
| }
|
|
|
| void IndexedDBQuotaClient::GetOriginsForHost(
|
| @@ -137,13 +150,16 @@
|
| indexed_db_context_,
|
| host,
|
| base::Unretained(origins_to_return)),
|
| - base::Bind(
|
| - &DidGetOrigins, callback, base::Owned(origins_to_return), type));
|
| + base::Bind(&DidGetOrigins,
|
| + callback,
|
| + base::Owned(origins_to_return),
|
| + type));
|
| }
|
|
|
| -void IndexedDBQuotaClient::DeleteOriginData(const GURL& origin,
|
| - quota::StorageType type,
|
| - const DeletionCallback& callback) {
|
| +void IndexedDBQuotaClient::DeleteOriginData(
|
| + const GURL& origin,
|
| + quota::StorageType type,
|
| + const DeletionCallback& callback) {
|
| if (type != quota::kStorageTypeTemporary) {
|
| callback.Run(quota::kQuotaErrorNotSupported);
|
| return;
|
| @@ -152,7 +168,9 @@
|
| base::PostTaskAndReplyWithResult(
|
| webkit_thread_message_loop_,
|
| FROM_HERE,
|
| - base::Bind(&DeleteOriginDataOnWebKitThread, indexed_db_context_, origin),
|
| + base::Bind(&DeleteOriginDataOnWebKitThread,
|
| + indexed_db_context_,
|
| + origin),
|
| callback);
|
| }
|
|
|
|
|