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 "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2222 thumbnail_db_->BeginTransaction(); | 2222 thumbnail_db_->BeginTransaction(); |
2223 } | 2223 } |
2224 } | 2224 } |
2225 | 2225 |
2226 void HistoryBackend::ScheduleCommit() { | 2226 void HistoryBackend::ScheduleCommit() { |
2227 if (scheduled_commit_) | 2227 if (scheduled_commit_) |
2228 return; | 2228 return; |
2229 scheduled_commit_ = new CommitLaterTask(this); | 2229 scheduled_commit_ = new CommitLaterTask(this); |
2230 task_runner_->PostDelayedTask( | 2230 task_runner_->PostDelayedTask( |
2231 FROM_HERE, | 2231 FROM_HERE, |
2232 base::Bind(&CommitLaterTask::RunCommit, scheduled_commit_.get()), | 2232 base::Bind(&CommitLaterTask::RunCommit, scheduled_commit_), |
2233 base::TimeDelta::FromSeconds(kCommitIntervalSeconds)); | 2233 base::TimeDelta::FromSeconds(kCommitIntervalSeconds)); |
2234 } | 2234 } |
2235 | 2235 |
2236 void HistoryBackend::CancelScheduledCommit() { | 2236 void HistoryBackend::CancelScheduledCommit() { |
2237 if (scheduled_commit_) { | 2237 if (scheduled_commit_) { |
2238 scheduled_commit_->Cancel(); | 2238 scheduled_commit_->Cancel(); |
2239 scheduled_commit_ = nullptr; | 2239 scheduled_commit_ = nullptr; |
2240 } | 2240 } |
2241 } | 2241 } |
2242 | 2242 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2629 // transaction is currently open. | 2629 // transaction is currently open. |
2630 db_->CommitTransaction(); | 2630 db_->CommitTransaction(); |
2631 db_->Vacuum(); | 2631 db_->Vacuum(); |
2632 db_->BeginTransaction(); | 2632 db_->BeginTransaction(); |
2633 db_->GetStartDate(&first_recorded_time_); | 2633 db_->GetStartDate(&first_recorded_time_); |
2634 | 2634 |
2635 return true; | 2635 return true; |
2636 } | 2636 } |
2637 | 2637 |
2638 } // namespace history | 2638 } // namespace history |
OLD | NEW |