| 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 "chrome/browser/history/top_sites_backend.h" | 5 #include "chrome/browser/history/top_sites_backend.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/task/cancelable_task_tracker.h" | 11 #include "base/task/cancelable_task_tracker.h" |
| 12 #include "chrome/browser/history/top_sites_database.h" | 12 #include "chrome/browser/history/top_sites_database.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 #include "sql/connection.h" |
| 14 | 15 |
| 15 using content::BrowserThread; | 16 using content::BrowserThread; |
| 16 | 17 |
| 17 namespace history { | 18 namespace history { |
| 18 | 19 |
| 19 TopSitesBackend::TopSitesBackend() | 20 TopSitesBackend::TopSitesBackend() |
| 20 : db_(new TopSitesDatabase()) { | 21 : db_(new TopSitesDatabase()) { |
| 21 } | 22 } |
| 22 | 23 |
| 23 void TopSitesBackend::Init(const base::FilePath& path) { | 24 void TopSitesBackend::Init(const base::FilePath& path) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 131 |
| 131 void TopSitesBackend::ResetDatabaseOnDBThread(const base::FilePath& file_path) { | 132 void TopSitesBackend::ResetDatabaseOnDBThread(const base::FilePath& file_path) { |
| 132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 133 db_.reset(NULL); | 134 db_.reset(NULL); |
| 134 sql::Connection::Delete(db_path_); | 135 sql::Connection::Delete(db_path_); |
| 135 db_.reset(new TopSitesDatabase()); | 136 db_.reset(new TopSitesDatabase()); |
| 136 InitDBOnDBThread(db_path_); | 137 InitDBOnDBThread(db_path_); |
| 137 } | 138 } |
| 138 | 139 |
| 139 } // namespace history | 140 } // namespace history |
| OLD | NEW |