OLD | NEW |
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" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // it's true when StartFetching() is called in the UI thread, and it's reset | 57 // it's true when StartFetching() is called in the UI thread, and it's reset |
58 // after we notified the callback in the UI thread. | 58 // after we notified the callback in the UI thread. |
59 // This only mutates on the UI thread. | 59 // This only mutates on the UI thread. |
60 bool is_fetching_; | 60 bool is_fetching_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(BrowsingDataIndexedDBHelperImpl); | 62 DISALLOW_COPY_AND_ASSIGN(BrowsingDataIndexedDBHelperImpl); |
63 }; | 63 }; |
64 | 64 |
65 BrowsingDataIndexedDBHelperImpl::BrowsingDataIndexedDBHelperImpl( | 65 BrowsingDataIndexedDBHelperImpl::BrowsingDataIndexedDBHelperImpl( |
66 Profile* profile) | 66 Profile* profile) |
67 : indexed_db_context_(IndexedDBContext::GetForBrowserContext(profile)), | 67 : indexed_db_context_(BrowserContext::GetIndexedDBContext(profile)), |
68 is_fetching_(false) { | 68 is_fetching_(false) { |
69 DCHECK(indexed_db_context_.get()); | 69 DCHECK(indexed_db_context_.get()); |
70 } | 70 } |
71 | 71 |
72 BrowsingDataIndexedDBHelperImpl::~BrowsingDataIndexedDBHelperImpl() { | 72 BrowsingDataIndexedDBHelperImpl::~BrowsingDataIndexedDBHelperImpl() { |
73 } | 73 } |
74 | 74 |
75 void BrowsingDataIndexedDBHelperImpl::StartFetching( | 75 void BrowsingDataIndexedDBHelperImpl::StartFetching( |
76 const base::Callback<void(const std::list<IndexedDBInfo>&)>& callback) { | 76 const base::Callback<void(const std::list<IndexedDBInfo>&)>& callback) { |
77 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 77 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 completion_callback_.Run(indexed_db_info_); | 261 completion_callback_.Run(indexed_db_info_); |
262 completion_callback_.Reset(); | 262 completion_callback_.Reset(); |
263 } | 263 } |
264 is_fetching_ = false; | 264 is_fetching_ = false; |
265 } | 265 } |
266 | 266 |
267 void CannedBrowsingDataIndexedDBHelper::CancelNotification() { | 267 void CannedBrowsingDataIndexedDBHelper::CancelNotification() { |
268 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 268 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
269 completion_callback_.Reset(); | 269 completion_callback_.Reset(); |
270 } | 270 } |
OLD | NEW |