| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return origin < other.origin; | 105 return origin < other.origin; |
| 106 } | 106 } |
| 107 | 107 |
| 108 CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper( | 108 CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper( |
| 109 content::IndexedDBContext* context) | 109 content::IndexedDBContext* context) |
| 110 : BrowsingDataIndexedDBHelper(context) { | 110 : BrowsingDataIndexedDBHelper(context) { |
| 111 } | 111 } |
| 112 | 112 |
| 113 CannedBrowsingDataIndexedDBHelper::~CannedBrowsingDataIndexedDBHelper() {} | 113 CannedBrowsingDataIndexedDBHelper::~CannedBrowsingDataIndexedDBHelper() {} |
| 114 | 114 |
| 115 CannedBrowsingDataIndexedDBHelper* CannedBrowsingDataIndexedDBHelper::Clone() { | |
| 116 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 117 CannedBrowsingDataIndexedDBHelper* clone = | |
| 118 new CannedBrowsingDataIndexedDBHelper(indexed_db_context_.get()); | |
| 119 | |
| 120 clone->pending_indexed_db_info_ = pending_indexed_db_info_; | |
| 121 clone->indexed_db_info_ = indexed_db_info_; | |
| 122 return clone; | |
| 123 } | |
| 124 | |
| 125 void CannedBrowsingDataIndexedDBHelper::AddIndexedDB( | 115 void CannedBrowsingDataIndexedDBHelper::AddIndexedDB( |
| 126 const GURL& origin, const base::string16& name) { | 116 const GURL& origin, const base::string16& name) { |
| 127 if (!BrowsingDataHelper::HasWebScheme(origin)) | 117 if (!BrowsingDataHelper::HasWebScheme(origin)) |
| 128 return; // Non-websafe state is not considered browsing data. | 118 return; // Non-websafe state is not considered browsing data. |
| 129 | 119 |
| 130 pending_indexed_db_info_.insert(PendingIndexedDBInfo(origin, name)); | 120 pending_indexed_db_info_.insert(PendingIndexedDBInfo(origin, name)); |
| 131 } | 121 } |
| 132 | 122 |
| 133 void CannedBrowsingDataIndexedDBHelper::Reset() { | 123 void CannedBrowsingDataIndexedDBHelper::Reset() { |
| 134 indexed_db_info_.clear(); | 124 indexed_db_info_.clear(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 for (std::set<PendingIndexedDBInfo>::iterator it = | 161 for (std::set<PendingIndexedDBInfo>::iterator it = |
| 172 pending_indexed_db_info_.begin(); | 162 pending_indexed_db_info_.begin(); |
| 173 it != pending_indexed_db_info_.end(); ) { | 163 it != pending_indexed_db_info_.end(); ) { |
| 174 if (it->origin == origin) | 164 if (it->origin == origin) |
| 175 pending_indexed_db_info_.erase(it++); | 165 pending_indexed_db_info_.erase(it++); |
| 176 else | 166 else |
| 177 ++it; | 167 ++it; |
| 178 } | 168 } |
| 179 BrowsingDataIndexedDBHelper::DeleteIndexedDB(origin); | 169 BrowsingDataIndexedDBHelper::DeleteIndexedDB(origin); |
| 180 } | 170 } |
| OLD | NEW |