| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/offline_pages/offline_page_metadata_store_sql.h" | 5 #include "components/offline_pages/offline_page_metadata_store_sql.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 489 |
| 490 void OfflinePageMetadataStoreSQL::OnResetDone(const ResetCallback& callback, | 490 void OfflinePageMetadataStoreSQL::OnResetDone(const ResetCallback& callback, |
| 491 StoreState state) { | 491 StoreState state) { |
| 492 OnOpenConnectionDone(state); | 492 OnOpenConnectionDone(state); |
| 493 callback.Run(state == LOADED); | 493 callback.Run(state == LOADED); |
| 494 } | 494 } |
| 495 | 495 |
| 496 bool OfflinePageMetadataStoreSQL::CheckDb(const base::Closure& callback) { | 496 bool OfflinePageMetadataStoreSQL::CheckDb(const base::Closure& callback) { |
| 497 DCHECK(db_.get()); | 497 DCHECK(db_.get()); |
| 498 if (!db_.get()) { | 498 if (!db_.get()) { |
| 499 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 499 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); |
| 500 base::Bind(callback)); | |
| 501 return false; | 500 return false; |
| 502 } | 501 } |
| 503 return true; | 502 return true; |
| 504 } | 503 } |
| 505 | 504 |
| 506 } // namespace offline_pages | 505 } // namespace offline_pages |
| OLD | NEW |