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

Side by Side Diff: chrome/browser/browsing_data_indexed_db_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
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_indexed_db_helper.h" 5 #include "chrome/browser/browsing_data_indexed_db_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "content/browser/in_process_webkit/webkit_context.h" 16 #include "content/browser/in_process_webkit/webkit_context.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "webkit/database/database_util.h" 18 #include "webkit/database/database_util.h"
19 #include "webkit/glue/webkit_glue.h" 19 #include "webkit/glue/webkit_glue.h"
20 20
21 using content::BrowserContext;
21 using content::BrowserThread; 22 using content::BrowserThread;
22 using webkit_database::DatabaseUtil; 23 using webkit_database::DatabaseUtil;
23 24
24 namespace { 25 namespace {
25 26
26 class BrowsingDataIndexedDBHelperImpl : public BrowsingDataIndexedDBHelper { 27 class BrowsingDataIndexedDBHelperImpl : public BrowsingDataIndexedDBHelper {
27 public: 28 public:
28 explicit BrowsingDataIndexedDBHelperImpl(Profile* profile); 29 explicit BrowsingDataIndexedDBHelperImpl(Profile* profile);
29 30
30 virtual void StartFetching( 31 virtual void StartFetching(
(...skipping 24 matching lines...) Expand all
55 // it's true when StartFetching() is called in the UI thread, and it's reset 56 // it's true when StartFetching() is called in the UI thread, and it's reset
56 // after we notified the callback in the UI thread. 57 // after we notified the callback in the UI thread.
57 // This only mutates on the UI thread. 58 // This only mutates on the UI thread.
58 bool is_fetching_; 59 bool is_fetching_;
59 60
60 DISALLOW_COPY_AND_ASSIGN(BrowsingDataIndexedDBHelperImpl); 61 DISALLOW_COPY_AND_ASSIGN(BrowsingDataIndexedDBHelperImpl);
61 }; 62 };
62 63
63 BrowsingDataIndexedDBHelperImpl::BrowsingDataIndexedDBHelperImpl( 64 BrowsingDataIndexedDBHelperImpl::BrowsingDataIndexedDBHelperImpl(
64 Profile* profile) 65 Profile* profile)
65 : indexed_db_context_(profile->GetWebKitContext()->indexed_db_context()), 66 : indexed_db_context_(
67 BrowserContext::GetWebKitContext(profile)->indexed_db_context()),
66 is_fetching_(false) { 68 is_fetching_(false) {
67 DCHECK(indexed_db_context_.get()); 69 DCHECK(indexed_db_context_.get());
68 } 70 }
69 71
70 BrowsingDataIndexedDBHelperImpl::~BrowsingDataIndexedDBHelperImpl() { 72 BrowsingDataIndexedDBHelperImpl::~BrowsingDataIndexedDBHelperImpl() {
71 } 73 }
72 74
73 void BrowsingDataIndexedDBHelperImpl::StartFetching( 75 void BrowsingDataIndexedDBHelperImpl::StartFetching(
74 const base::Callback<void(const std::list<IndexedDBInfo>&)>& callback) { 76 const base::Callback<void(const std::list<IndexedDBInfo>&)>& callback) {
75 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 77 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 completion_callback_.Run(indexed_db_info_); 262 completion_callback_.Run(indexed_db_info_);
261 completion_callback_.Reset(); 263 completion_callback_.Reset();
262 } 264 }
263 is_fetching_ = false; 265 is_fetching_ = false;
264 } 266 }
265 267
266 void CannedBrowsingDataIndexedDBHelper::CancelNotification() { 268 void CannedBrowsingDataIndexedDBHelper::CancelNotification() {
267 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 269 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
268 completion_callback_.Reset(); 270 completion_callback_.Reset();
269 } 271 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data_file_system_helper_unittest.cc ('k') | chrome/browser/browsing_data_local_storage_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698