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

Side by Side Diff: chrome/browser/browsing_data_appcache_helper.cc

Issue 9419033: Move creation of BrowserContext objects that live in content to content, instead of depending on th… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix memory leaks in tests Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/browsing_data_database_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_appcache_helper.h" 5 #include "chrome/browser/browsing_data_appcache_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
11 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
12 #include "webkit/appcache/appcache_database.h" 12 #include "webkit/appcache/appcache_database.h"
13 #include "webkit/appcache/appcache_storage.h" 13 #include "webkit/appcache/appcache_storage.h"
14 14
15 using appcache::AppCacheDatabase; 15 using appcache::AppCacheDatabase;
16 using content::BrowserContext;
16 using content::BrowserThread; 17 using content::BrowserThread;
17 18
18 BrowsingDataAppCacheHelper::BrowsingDataAppCacheHelper(Profile* profile) 19 BrowsingDataAppCacheHelper::BrowsingDataAppCacheHelper(Profile* profile)
19 : is_fetching_(false), 20 : is_fetching_(false),
20 appcache_service_(profile->GetAppCacheService()) { 21 appcache_service_(BrowserContext::GetAppCacheService(profile)) {
21 } 22 }
22 23
23 void BrowsingDataAppCacheHelper::StartFetching(const base::Closure& callback) { 24 void BrowsingDataAppCacheHelper::StartFetching(const base::Closure& callback) {
24 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { 25 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
25 DCHECK(!is_fetching_); 26 DCHECK(!is_fetching_);
26 DCHECK_EQ(false, callback.is_null()); 27 DCHECK_EQ(false, callback.is_null());
27 is_fetching_ = true; 28 is_fetching_ = true;
28 info_collection_ = new appcache::AppCacheInfoCollection; 29 info_collection_ = new appcache::AppCacheInfoCollection;
29 completion_callback_ = callback; 30 completion_callback_ = callback;
30 BrowserThread::PostTask( 31 BrowserThread::PostTask(
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 bool CannedBrowsingDataAppCacheHelper::empty() const { 140 bool CannedBrowsingDataAppCacheHelper::empty() const {
140 return info_collection_->infos_by_origin.empty(); 141 return info_collection_->infos_by_origin.empty();
141 } 142 }
142 143
143 void CannedBrowsingDataAppCacheHelper::StartFetching( 144 void CannedBrowsingDataAppCacheHelper::StartFetching(
144 const base::Closure& completion_callback) { 145 const base::Closure& completion_callback) {
145 completion_callback.Run(); 146 completion_callback.Run();
146 } 147 }
147 148
148 CannedBrowsingDataAppCacheHelper::~CannedBrowsingDataAppCacheHelper() {} 149 CannedBrowsingDataAppCacheHelper::~CannedBrowsingDataAppCacheHelper() {}
OLDNEW
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/browsing_data_database_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698