Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Unified Diff: content/browser/indexed_db/indexed_db_quota_client.cc

Issue 15564008: Migrate the IndexedDB backend from Blink to Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to ToT again Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_quota_client.cc
diff --git a/content/browser/indexed_db/indexed_db_quota_client.cc b/content/browser/indexed_db/indexed_db_quota_client.cc
index 25f9668d0f9d2119233daa3eac4bec02a72fa62a..bbce16c5ef27efd399707888d013b7f278e90271 100644
--- a/content/browser/indexed_db/indexed_db_quota_client.cc
+++ b/content/browser/indexed_db/indexed_db_quota_client.cc
@@ -26,36 +26,33 @@ quota::QuotaStatusCode DeleteOriginDataOnWebKitThread(
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) {
+void DidGetOrigins(const IndexedDBQuotaClient::GetOriginsCallback& callback,
+ const std::set<GURL>* origins) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
callback.Run(*origins);
}
-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);
}
@@ -69,24 +66,17 @@ IndexedDBQuotaClient::IndexedDBQuotaClient(
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());
@@ -99,9 +89,8 @@ void IndexedDBQuotaClient::GetOriginUsage(
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);
}
@@ -123,9 +112,7 @@ void IndexedDBQuotaClient::GetOriginsForType(
base::Bind(&GetAllOriginsOnWebKitThread,
indexed_db_context_,
base::Unretained(origins_to_return)),
- base::Bind(&DidGetOrigins,
- callback,
- base::Owned(origins_to_return)));
+ base::Bind(&DidGetOrigins, callback, base::Owned(origins_to_return)));
}
void IndexedDBQuotaClient::GetOriginsForHost(
@@ -148,15 +135,12 @@ void IndexedDBQuotaClient::GetOriginsForHost(
indexed_db_context_,
host,
base::Unretained(origins_to_return)),
- base::Bind(&DidGetOrigins,
- callback,
- base::Owned(origins_to_return)));
+ base::Bind(&DidGetOrigins, callback, base::Owned(origins_to_return)));
}
-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;
@@ -165,9 +149,7 @@ void IndexedDBQuotaClient::DeleteOriginData(
base::PostTaskAndReplyWithResult(
webkit_thread_message_loop_,
FROM_HERE,
- base::Bind(&DeleteOriginDataOnWebKitThread,
- indexed_db_context_,
- origin),
+ base::Bind(&DeleteOriginDataOnWebKitThread, indexed_db_context_, origin),
callback);
}
« no previous file with comments | « content/browser/indexed_db/indexed_db_quota_client.h ('k') | content/browser/indexed_db/indexed_db_quota_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698