| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 | 137 |
| 138 // static | 138 // static |
| 139 BrowsingDataIndexedDBHelper* BrowsingDataIndexedDBHelper::Create( | 139 BrowsingDataIndexedDBHelper* BrowsingDataIndexedDBHelper::Create( |
| 140 IndexedDBContext* indexed_db_context) { | 140 IndexedDBContext* indexed_db_context) { |
| 141 return new BrowsingDataIndexedDBHelperImpl(indexed_db_context); | 141 return new BrowsingDataIndexedDBHelperImpl(indexed_db_context); |
| 142 } | 142 } |
| 143 | 143 |
| 144 CannedBrowsingDataIndexedDBHelper:: | 144 CannedBrowsingDataIndexedDBHelper:: |
| 145 PendingIndexedDBInfo::PendingIndexedDBInfo(const GURL& origin, | 145 PendingIndexedDBInfo::PendingIndexedDBInfo(const GURL& origin, |
| 146 const string16& name) | 146 const base::string16& name) |
| 147 : origin(origin), | 147 : origin(origin), |
| 148 name(name) { | 148 name(name) { |
| 149 } | 149 } |
| 150 | 150 |
| 151 CannedBrowsingDataIndexedDBHelper:: | 151 CannedBrowsingDataIndexedDBHelper:: |
| 152 PendingIndexedDBInfo::~PendingIndexedDBInfo() { | 152 PendingIndexedDBInfo::~PendingIndexedDBInfo() { |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool CannedBrowsingDataIndexedDBHelper::PendingIndexedDBInfo::operator<( | 155 bool CannedBrowsingDataIndexedDBHelper::PendingIndexedDBInfo::operator<( |
| 156 const PendingIndexedDBInfo& other) const { | 156 const PendingIndexedDBInfo& other) const { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 169 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 169 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 170 CannedBrowsingDataIndexedDBHelper* clone = | 170 CannedBrowsingDataIndexedDBHelper* clone = |
| 171 new CannedBrowsingDataIndexedDBHelper(); | 171 new CannedBrowsingDataIndexedDBHelper(); |
| 172 | 172 |
| 173 clone->pending_indexed_db_info_ = pending_indexed_db_info_; | 173 clone->pending_indexed_db_info_ = pending_indexed_db_info_; |
| 174 clone->indexed_db_info_ = indexed_db_info_; | 174 clone->indexed_db_info_ = indexed_db_info_; |
| 175 return clone; | 175 return clone; |
| 176 } | 176 } |
| 177 | 177 |
| 178 void CannedBrowsingDataIndexedDBHelper::AddIndexedDB( | 178 void CannedBrowsingDataIndexedDBHelper::AddIndexedDB( |
| 179 const GURL& origin, const string16& name) { | 179 const GURL& origin, const base::string16& name) { |
| 180 if (!BrowsingDataHelper::HasWebScheme(origin)) | 180 if (!BrowsingDataHelper::HasWebScheme(origin)) |
| 181 return; // Non-websafe state is not considered browsing data. | 181 return; // Non-websafe state is not considered browsing data. |
| 182 | 182 |
| 183 pending_indexed_db_info_.insert(PendingIndexedDBInfo(origin, name)); | 183 pending_indexed_db_info_.insert(PendingIndexedDBInfo(origin, name)); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void CannedBrowsingDataIndexedDBHelper::Reset() { | 186 void CannedBrowsingDataIndexedDBHelper::Reset() { |
| 187 indexed_db_info_.clear(); | 187 indexed_db_info_.clear(); |
| 188 pending_indexed_db_info_.clear(); | 188 pending_indexed_db_info_.clear(); |
| 189 } | 189 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 pending_info != pending_indexed_db_info_.end(); ++pending_info) { | 226 pending_info != pending_indexed_db_info_.end(); ++pending_info) { |
| 227 IndexedDBInfo info( | 227 IndexedDBInfo info( |
| 228 pending_info->origin, 0, base::Time(), base::FilePath(), 0); | 228 pending_info->origin, 0, base::Time(), base::FilePath(), 0); |
| 229 indexed_db_info_.push_back(info); | 229 indexed_db_info_.push_back(info); |
| 230 } | 230 } |
| 231 | 231 |
| 232 completion_callback_.Run(indexed_db_info_); | 232 completion_callback_.Run(indexed_db_info_); |
| 233 completion_callback_.Reset(); | 233 completion_callback_.Reset(); |
| 234 is_fetching_ = false; | 234 is_fetching_ = false; |
| 235 } | 235 } |
| OLD | NEW |