OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/storage/storage_info_fetcher.h" | 5 #include "chrome/browser/storage/storage_info_fetcher.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/browser/storage_partition.h" | 10 #include "content/public/browser/storage_partition.h" |
| 11 #include "storage/browser/quota/quota_manager.h" |
11 | 12 |
12 using content::BrowserContext; | 13 using content::BrowserContext; |
13 using content::BrowserThread; | 14 using content::BrowserThread; |
14 | 15 |
15 StorageInfoFetcher::StorageInfoFetcher(Profile* profile) { | 16 StorageInfoFetcher::StorageInfoFetcher(Profile* profile) { |
16 quota_manager_ = content::BrowserContext::GetDefaultStoragePartition( | 17 quota_manager_ = content::BrowserContext::GetDefaultStoragePartition( |
17 profile)->GetQuotaManager(); | 18 profile)->GetQuotaManager(); |
18 } | 19 } |
19 | 20 |
20 StorageInfoFetcher::~StorageInfoFetcher() { | 21 StorageInfoFetcher::~StorageInfoFetcher() { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 base::Bind(&StorageInfoFetcher::OnClearCompleted, this, code)); | 90 base::Bind(&StorageInfoFetcher::OnClearCompleted, this, code)); |
90 } | 91 } |
91 | 92 |
92 void StorageInfoFetcher::OnClearCompleted(storage::QuotaStatusCode code) { | 93 void StorageInfoFetcher::OnClearCompleted(storage::QuotaStatusCode code) { |
93 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 94 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
94 | 95 |
95 clear_callback_.Run(code); | 96 clear_callback_.Run(code); |
96 | 97 |
97 Release(); | 98 Release(); |
98 } | 99 } |
OLD | NEW |