| Index: components/precache/core/precache_database.cc
|
| diff --git a/components/precache/core/precache_database.cc b/components/precache/core/precache_database.cc
|
| index c6362fe3c226c8da6ed82fe4e5c97711292ca7c3..3159a2d10d8cb2ccefe3a6a210f62276f1030f45 100644
|
| --- a/components/precache/core/precache_database.cc
|
| +++ b/components/precache/core/precache_database.cc
|
| @@ -12,6 +12,7 @@
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "base/time/time.h"
|
| #include "components/history/core/browser/history_constants.h"
|
| +#include "components/precache/core/proto/unfinished_work.pb.h"
|
| #include "sql/connection.h"
|
| #include "sql/transaction.h"
|
| #include "url/gurl.h"
|
| @@ -51,7 +52,8 @@ bool PrecacheDatabase::Init(const base::FilePath& db_path) {
|
| return false;
|
| }
|
|
|
| - if (!precache_url_table_.Init(db_.get())) {
|
| + if (!precache_url_table_.Init(db_.get()) ||
|
| + !precache_session_table_.Init(db_.get())) {
|
| // Raze and close the database connection to indicate that it's not usable,
|
| // and so that the database will be created anew next time, in case it's
|
| // corrupted.
|
| @@ -259,4 +261,23 @@ void PrecacheDatabase::MaybePostFlush() {
|
| is_flush_posted_ = true;
|
| }
|
|
|
| +std::unique_ptr<PrecacheUnfinishedWork>
|
| +PrecacheDatabase::GetUnfinishedWork() {
|
| + return precache_session_table_.GetUnfinishedWork();
|
| +}
|
| +
|
| +void PrecacheDatabase::SaveUnfinishedWork(
|
| + std::unique_ptr<PrecacheUnfinishedWork> unfinished_work) {
|
| + precache_session_table_.SaveUnfinishedWork(
|
| + std::move(unfinished_work));
|
| +}
|
| +
|
| +void PrecacheDatabase::ClearPrecacheSessionState() {
|
| + precache_session_table_.ClearSessionInformation();
|
| +}
|
| +
|
| +base::WeakPtr<PrecacheDatabase> PrecacheDatabase::GetWeakPtr() {
|
| + return weak_factory_.GetWeakPtr();
|
| +}
|
| +
|
| } // namespace precache
|
|
|