| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/offline_pages/offline_page_metadata_store_impl.h" | 5 #include "components/offline_pages/offline_page_metadata_store_impl.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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/sequenced_task_runner.h" | 11 #include "base/sequenced_task_runner.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 14 #include "chrome/browser/offline_pages/offline_pages.pb.h" | |
| 15 #include "components/leveldb_proto/proto_database.h" | 14 #include "components/leveldb_proto/proto_database.h" |
| 16 #include "components/offline_pages/offline_page_item.h" | 15 #include "components/offline_pages/offline_page_item.h" |
| 16 #include "components/offline_pages/proto/offline_pages.pb.h" |
| 17 #include "third_party/leveldatabase/env_chromium.h" | 17 #include "third_party/leveldatabase/env_chromium.h" |
| 18 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 18 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
| 19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 20 | 20 |
| 21 using leveldb_proto::ProtoDatabase; | 21 using leveldb_proto::ProtoDatabase; |
| 22 | 22 |
| 23 namespace offline_pages { | 23 namespace offline_pages { |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 typedef std::vector<OfflinePageEntry> OfflinePageEntryVector; | 26 typedef std::vector<OfflinePageEntry> OfflinePageEntryVector; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 base::Bind(&OfflinePageMetadataStoreImpl::ResetDB, | 202 base::Bind(&OfflinePageMetadataStoreImpl::ResetDB, |
| 203 weak_ptr_factory_.GetWeakPtr()))); | 203 weak_ptr_factory_.GetWeakPtr()))); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void OfflinePageMetadataStoreImpl::ResetDB() { | 206 void OfflinePageMetadataStoreImpl::ResetDB() { |
| 207 database_.reset(); | 207 database_.reset(); |
| 208 weak_ptr_factory_.InvalidateWeakPtrs(); | 208 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace offline_pages | 211 } // namespace offline_pages |
| OLD | NEW |