| 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 "webkit/browser/appcache/appcache_storage_impl.h" | 5 #include "webkit/browser/appcache/appcache_storage_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 void AppCacheStorageImpl::DatabaseTask::Schedule() { | 181 void AppCacheStorageImpl::DatabaseTask::Schedule() { |
| 182 DCHECK(storage_); | 182 DCHECK(storage_); |
| 183 DCHECK(io_thread_->BelongsToCurrentThread()); | 183 DCHECK(io_thread_->BelongsToCurrentThread()); |
| 184 if (storage_->db_thread_->PostTask( | 184 if (storage_->db_thread_->PostTask( |
| 185 FROM_HERE, | 185 FROM_HERE, |
| 186 base::Bind(&DatabaseTask::CallRun, this, base::TimeTicks::Now()))) { | 186 base::Bind(&DatabaseTask::CallRun, this, base::TimeTicks::Now()))) { |
| 187 storage_->scheduled_database_tasks_.push_back(this); | 187 storage_->scheduled_database_tasks_.push_back(this); |
| 188 } else { | 188 } else { |
| 189 NOTREACHED() << "The database thread is not running."; | 189 NOTREACHED() << "Thread for database tasks is not running. " |
| 190 << "This is not always the DB thread."; |
| 190 } | 191 } |
| 191 } | 192 } |
| 192 | 193 |
| 193 void AppCacheStorageImpl::DatabaseTask::CancelCompletion() { | 194 void AppCacheStorageImpl::DatabaseTask::CancelCompletion() { |
| 194 DCHECK(io_thread_->BelongsToCurrentThread()); | 195 DCHECK(io_thread_->BelongsToCurrentThread()); |
| 195 delegates_.clear(); | 196 delegates_.clear(); |
| 196 storage_ = NULL; | 197 storage_ = NULL; |
| 197 } | 198 } |
| 198 | 199 |
| 199 void AppCacheStorageImpl::DatabaseTask::CallRun( | 200 void AppCacheStorageImpl::DatabaseTask::CallRun( |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 if (!is_incognito_) { | 1811 if (!is_incognito_) { |
| 1811 VLOG(1) << "Deleting existing appcache data and starting over."; | 1812 VLOG(1) << "Deleting existing appcache data and starting over."; |
| 1812 db_thread_->PostTask( | 1813 db_thread_->PostTask( |
| 1813 FROM_HERE, base::Bind(base::IgnoreResult(&file_util::Delete), | 1814 FROM_HERE, base::Bind(base::IgnoreResult(&file_util::Delete), |
| 1814 cache_directory_, true)); | 1815 cache_directory_, true)); |
| 1815 } | 1816 } |
| 1816 } | 1817 } |
| 1817 } | 1818 } |
| 1818 | 1819 |
| 1819 } // namespace appcache | 1820 } // namespace appcache |
| OLD | NEW |