| 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_indexed_db_helper.h" | 5 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 void CannedBrowsingDataIndexedDBHelper::StartFetching( | 141 void CannedBrowsingDataIndexedDBHelper::StartFetching( |
| 142 const base::Callback<void(const std::list<IndexedDBInfo>&)>& callback) { | 142 const base::Callback<void(const std::list<IndexedDBInfo>&)>& callback) { |
| 143 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 143 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 144 DCHECK(!callback.is_null()); | 144 DCHECK(!callback.is_null()); |
| 145 | 145 |
| 146 std::list<IndexedDBInfo> result; | 146 std::list<IndexedDBInfo> result; |
| 147 for (std::set<PendingIndexedDBInfo>::const_iterator | 147 for (std::set<PendingIndexedDBInfo>::const_iterator |
| 148 pending_info = pending_indexed_db_info_.begin(); | 148 pending_info = pending_indexed_db_info_.begin(); |
| 149 pending_info != pending_indexed_db_info_.end(); ++pending_info) { | 149 pending_info != pending_indexed_db_info_.end(); ++pending_info) { |
| 150 IndexedDBInfo info( | 150 IndexedDBInfo info(pending_info->origin, 0, base::Time(), 0); |
| 151 pending_info->origin, 0, base::Time(), base::FilePath(), 0); | |
| 152 result.push_back(info); | 151 result.push_back(info); |
| 153 } | 152 } |
| 154 | 153 |
| 155 BrowserThread::PostTask( | 154 BrowserThread::PostTask( |
| 156 BrowserThread::UI, FROM_HERE, base::Bind(callback, result)); | 155 BrowserThread::UI, FROM_HERE, base::Bind(callback, result)); |
| 157 } | 156 } |
| 158 | 157 |
| 159 void CannedBrowsingDataIndexedDBHelper::DeleteIndexedDB( | 158 void CannedBrowsingDataIndexedDBHelper::DeleteIndexedDB( |
| 160 const GURL& origin) { | 159 const GURL& origin) { |
| 161 for (std::set<PendingIndexedDBInfo>::iterator it = | 160 for (std::set<PendingIndexedDBInfo>::iterator it = |
| 162 pending_indexed_db_info_.begin(); | 161 pending_indexed_db_info_.begin(); |
| 163 it != pending_indexed_db_info_.end(); ) { | 162 it != pending_indexed_db_info_.end(); ) { |
| 164 if (it->origin == origin) | 163 if (it->origin == origin) |
| 165 pending_indexed_db_info_.erase(it++); | 164 pending_indexed_db_info_.erase(it++); |
| 166 else | 165 else |
| 167 ++it; | 166 ++it; |
| 168 } | 167 } |
| 169 BrowsingDataIndexedDBHelper::DeleteIndexedDB(origin); | 168 BrowsingDataIndexedDBHelper::DeleteIndexedDB(origin); |
| 170 } | 169 } |
| OLD | NEW |