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 "content/browser/renderer_host/database_message_filter.h" | 5 #include "content/browser/renderer_host/database_message_filter.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 } else { | 203 } else { |
204 error_code = VfsBackend::DeleteFile(db_file, sync_dir); | 204 error_code = VfsBackend::DeleteFile(db_file, sync_dir); |
205 } | 205 } |
206 | 206 |
207 if ((error_code == SQLITE_IOERR_DELETE) && reschedule_count) { | 207 if ((error_code == SQLITE_IOERR_DELETE) && reschedule_count) { |
208 // If the file could not be deleted, try again. | 208 // If the file could not be deleted, try again. |
209 BrowserThread::PostDelayedTask( | 209 BrowserThread::PostDelayedTask( |
210 BrowserThread::FILE, FROM_HERE, | 210 BrowserThread::FILE, FROM_HERE, |
211 base::Bind(&DatabaseMessageFilter::DatabaseDeleteFile, this, | 211 base::Bind(&DatabaseMessageFilter::DatabaseDeleteFile, this, |
212 vfs_file_name, sync_dir, reply_msg, reschedule_count - 1), | 212 vfs_file_name, sync_dir, reply_msg, reschedule_count - 1), |
213 kDelayDeleteRetryMs); | 213 base::TimeDelta::FromMilliseconds(kDelayDeleteRetryMs)); |
214 return; | 214 return; |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 DatabaseHostMsg_DeleteFile::WriteReplyParams(reply_msg, error_code); | 218 DatabaseHostMsg_DeleteFile::WriteReplyParams(reply_msg, error_code); |
219 Send(reply_msg); | 219 Send(reply_msg); |
220 } | 220 } |
221 | 221 |
222 void DatabaseMessageFilter::OnDatabaseGetFileAttributes( | 222 void DatabaseMessageFilter::OnDatabaseGetFileAttributes( |
223 const string16& vfs_file_name, | 223 const string16& vfs_file_name, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 database_size)); | 340 database_size)); |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 void DatabaseMessageFilter::OnDatabaseScheduledForDeletion( | 344 void DatabaseMessageFilter::OnDatabaseScheduledForDeletion( |
345 const string16& origin_identifier, | 345 const string16& origin_identifier, |
346 const string16& database_name) { | 346 const string16& database_name) { |
347 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 347 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
348 Send(new DatabaseMsg_CloseImmediately(origin_identifier, database_name)); | 348 Send(new DatabaseMsg_CloseImmediately(origin_identifier, database_name)); |
349 } | 349 } |
OLD | NEW |