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 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2477 db_->BeginTransaction(); | 2477 db_->BeginTransaction(); |
2478 CloseAllDatabases(); | 2478 CloseAllDatabases(); |
2479 } | 2479 } |
2480 | 2480 |
2481 base::SupportsUserData::Data* HistoryBackend::GetUserData( | 2481 base::SupportsUserData::Data* HistoryBackend::GetUserData( |
2482 const void* key) const { | 2482 const void* key) const { |
2483 DCHECK(supports_user_data_helper_); | 2483 DCHECK(supports_user_data_helper_); |
2484 return supports_user_data_helper_->GetUserData(key); | 2484 return supports_user_data_helper_->GetUserData(key); |
2485 } | 2485 } |
2486 | 2486 |
2487 void HistoryBackend::SetUserData(const void* key, | 2487 void HistoryBackend::SetUserData( |
2488 base::SupportsUserData::Data* data) { | 2488 const void* key, |
| 2489 std::unique_ptr<base::SupportsUserData::Data> data) { |
2489 DCHECK(supports_user_data_helper_); | 2490 DCHECK(supports_user_data_helper_); |
2490 supports_user_data_helper_->SetUserData(key, data); | 2491 supports_user_data_helper_->SetUserData(key, std::move(data)); |
2491 } | 2492 } |
2492 | 2493 |
2493 void HistoryBackend::ProcessDBTask( | 2494 void HistoryBackend::ProcessDBTask( |
2494 std::unique_ptr<HistoryDBTask> task, | 2495 std::unique_ptr<HistoryDBTask> task, |
2495 scoped_refptr<base::SingleThreadTaskRunner> origin_loop, | 2496 scoped_refptr<base::SingleThreadTaskRunner> origin_loop, |
2496 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled) { | 2497 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled) { |
2497 bool scheduled = !queued_history_db_tasks_.empty(); | 2498 bool scheduled = !queued_history_db_tasks_.empty(); |
2498 queued_history_db_tasks_.push_back(base::MakeUnique<QueuedHistoryDBTask>( | 2499 queued_history_db_tasks_.push_back(base::MakeUnique<QueuedHistoryDBTask>( |
2499 std::move(task), origin_loop, is_canceled)); | 2500 std::move(task), origin_loop, is_canceled)); |
2500 if (!scheduled) | 2501 if (!scheduled) |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2660 // transaction is currently open. | 2661 // transaction is currently open. |
2661 db_->CommitTransaction(); | 2662 db_->CommitTransaction(); |
2662 db_->Vacuum(); | 2663 db_->Vacuum(); |
2663 db_->BeginTransaction(); | 2664 db_->BeginTransaction(); |
2664 db_->GetStartDate(&first_recorded_time_); | 2665 db_->GetStartDate(&first_recorded_time_); |
2665 | 2666 |
2666 return true; | 2667 return true; |
2667 } | 2668 } |
2668 | 2669 |
2669 } // namespace history | 2670 } // namespace history |
OLD | NEW |