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 "webkit/appcache/appcache_storage_impl.h" | 5 #include "webkit/appcache/appcache_storage_impl.h" |
6 | 6 |
7 #include "app/sql/connection.h" | 7 #include "app/sql/connection.h" |
8 #include "app/sql/transaction.h" | 8 #include "app/sql/transaction.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 class AppCacheStorageImpl::DatabaseTask | 42 class AppCacheStorageImpl::DatabaseTask |
43 : public base::RefCountedThreadSafe<DatabaseTask> { | 43 : public base::RefCountedThreadSafe<DatabaseTask> { |
44 public: | 44 public: |
45 explicit DatabaseTask(AppCacheStorageImpl* storage) | 45 explicit DatabaseTask(AppCacheStorageImpl* storage) |
46 : storage_(storage), database_(storage->database_) {} | 46 : storage_(storage), database_(storage->database_) {} |
47 | 47 |
48 virtual ~DatabaseTask() {} | 48 virtual ~DatabaseTask() {} |
49 | 49 |
50 void AddDelegate(DelegateReference* delegate_reference) { | 50 void AddDelegate(DelegateReference* delegate_reference) { |
51 delegates_.push_back(delegate_reference); | 51 delegates_.push_back(make_scoped_refptr(delegate_reference)); |
52 } | 52 } |
53 | 53 |
54 // Schedules a task to be Run() on the DB thread. Tasks | 54 // Schedules a task to be Run() on the DB thread. Tasks |
55 // are run in the order in which they are scheduled. | 55 // are run in the order in which they are scheduled. |
56 void Schedule(); | 56 void Schedule(); |
57 | 57 |
58 // Called on the DB thread. | 58 // Called on the DB thread. |
59 virtual void Run() = 0; | 59 virtual void Run() = 0; |
60 | 60 |
61 // Called on the IO thread after Run() has completed. | 61 // Called on the IO thread after Run() has completed. |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 Disable(); | 1319 Disable(); |
1320 if (!is_incognito_) { | 1320 if (!is_incognito_) { |
1321 VLOG(1) << "Deleting existing appcache data and starting over."; | 1321 VLOG(1) << "Deleting existing appcache data and starting over."; |
1322 AppCacheThread::PostTask(AppCacheThread::db(), FROM_HERE, | 1322 AppCacheThread::PostTask(AppCacheThread::db(), FROM_HERE, |
1323 NewRunnableFunction(DeleteDirectory, cache_directory_)); | 1323 NewRunnableFunction(DeleteDirectory, cache_directory_)); |
1324 } | 1324 } |
1325 } | 1325 } |
1326 } | 1326 } |
1327 | 1327 |
1328 } // namespace appcache | 1328 } // namespace appcache |
OLD | NEW |