| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 | 152 |
| 153 void BrowsingDataIndexedDBHelperImpl::DeleteIndexedDBFileInWebKitThread( | 153 void BrowsingDataIndexedDBHelperImpl::DeleteIndexedDBFileInWebKitThread( |
| 154 const FilePath& file_path) { | 154 const FilePath& file_path) { |
| 155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); | 155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
| 156 // TODO(jochen): implement this once it's possible to delete indexed DBs. | 156 // TODO(jochen): implement this once it's possible to delete indexed DBs. |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace | 159 } // namespace |
| 160 | 160 |
| 161 BrowsingDataIndexedDBHelper::IndexedDBInfo::IndexedDBInfo( |
| 162 const std::string& protocol, |
| 163 const std::string& host, |
| 164 unsigned short port, |
| 165 const std::string& database_identifier, |
| 166 const std::string& origin, |
| 167 const FilePath& file_path, |
| 168 int64 size, |
| 169 base::Time last_modified) |
| 170 : protocol(protocol), |
| 171 host(host), |
| 172 port(port), |
| 173 database_identifier(database_identifier), |
| 174 origin(origin), |
| 175 file_path(file_path), |
| 176 size(size), |
| 177 last_modified(last_modified) { |
| 178 } |
| 179 |
| 180 BrowsingDataIndexedDBHelper::IndexedDBInfo::~IndexedDBInfo() {} |
| 181 |
| 182 bool BrowsingDataIndexedDBHelper::IndexedDBInfo::IsFileSchemeData() { |
| 183 return protocol == chrome::kFileScheme; |
| 184 } |
| 185 |
| 161 // static | 186 // static |
| 162 BrowsingDataIndexedDBHelper* BrowsingDataIndexedDBHelper::Create( | 187 BrowsingDataIndexedDBHelper* BrowsingDataIndexedDBHelper::Create( |
| 163 Profile* profile) { | 188 Profile* profile) { |
| 164 return new BrowsingDataIndexedDBHelperImpl(profile); | 189 return new BrowsingDataIndexedDBHelperImpl(profile); |
| 165 } | 190 } |
| 166 | 191 |
| 167 CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper( | 192 CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper( |
| 168 Profile* profile) | 193 Profile* profile) |
| 169 : profile_(profile) { | 194 : profile_(profile) { |
| 170 DCHECK(profile); | 195 DCHECK(profile); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return indexed_db_info_.empty(); | 229 return indexed_db_info_.empty(); |
| 205 } | 230 } |
| 206 | 231 |
| 207 void CannedBrowsingDataIndexedDBHelper::StartFetching( | 232 void CannedBrowsingDataIndexedDBHelper::StartFetching( |
| 208 Callback1<const std::vector<IndexedDBInfo>& >::Type* callback) { | 233 Callback1<const std::vector<IndexedDBInfo>& >::Type* callback) { |
| 209 callback->Run(indexed_db_info_); | 234 callback->Run(indexed_db_info_); |
| 210 delete callback; | 235 delete callback; |
| 211 } | 236 } |
| 212 | 237 |
| 213 CannedBrowsingDataIndexedDBHelper::~CannedBrowsingDataIndexedDBHelper() {} | 238 CannedBrowsingDataIndexedDBHelper::~CannedBrowsingDataIndexedDBHelper() {} |
| OLD | NEW |