OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/browsing_data/browsing_data_quota_helper_impl.h" | 5 #include "chrome/browser/browsing_data/browsing_data_quota_helper_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 12 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
15 #include "content/public/browser/browser_context.h" | 15 #include "content/public/browser/browser_context.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/browser/storage_partition.h" | 17 #include "content/public/browser/storage_partition.h" |
18 #include "webkit/browser/quota/quota_manager.h" | 18 #include "webkit/browser/quota/quota_manager.h" |
19 | 19 |
20 using content::BrowserThread; | 20 using content::BrowserThread; |
21 using content::BrowserContext; | 21 using content::BrowserContext; |
22 | 22 |
23 // static | 23 // static |
24 BrowsingDataQuotaHelper* BrowsingDataQuotaHelper::Create(Profile* profile) { | 24 BrowsingDataQuotaHelper* BrowsingDataQuotaHelper::Create(Profile* profile) { |
25 return new BrowsingDataQuotaHelperImpl( | 25 return new BrowsingDataQuotaHelperImpl( |
26 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 26 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get(), |
27 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 27 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), |
28 BrowserContext::GetDefaultStoragePartition(profile)->GetQuotaManager()); | 28 BrowserContext::GetDefaultStoragePartition(profile)->GetQuotaManager()); |
29 } | 29 } |
30 | 30 |
31 void BrowsingDataQuotaHelperImpl::StartFetching( | 31 void BrowsingDataQuotaHelperImpl::StartFetching( |
32 const FetchResultCallback& callback) { | 32 const FetchResultCallback& callback) { |
33 DCHECK_EQ(false, callback.is_null()); | 33 DCHECK_EQ(false, callback.is_null()); |
34 DCHECK(callback_.is_null()); | 34 DCHECK(callback_.is_null()); |
35 DCHECK(!is_fetching_); | 35 DCHECK(!is_fetching_); |
36 callback_ = callback; | 36 callback_ = callback; |
37 quota_info_.clear(); | 37 quota_info_.clear(); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 | 184 |
185 callback_.Run(result); | 185 callback_.Run(result); |
186 callback_.Reset(); | 186 callback_.Reset(); |
187 } | 187 } |
188 | 188 |
189 void BrowsingDataQuotaHelperImpl::DidRevokeHostQuota( | 189 void BrowsingDataQuotaHelperImpl::DidRevokeHostQuota( |
190 quota::QuotaStatusCode status_unused, | 190 quota::QuotaStatusCode status_unused, |
191 int64 quota_unused) { | 191 int64 quota_unused) { |
192 } | 192 } |
OLD | NEW |