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 23 matching lines...) Expand all Loading... |
34 #include "components/history/core/browser/download_row.h" | 34 #include "components/history/core/browser/download_row.h" |
35 #include "components/history/core/browser/history_backend_client.h" | 35 #include "components/history/core/browser/history_backend_client.h" |
36 #include "components/history/core/browser/history_backend_observer.h" | 36 #include "components/history/core/browser/history_backend_observer.h" |
37 #include "components/history/core/browser/history_constants.h" | 37 #include "components/history/core/browser/history_constants.h" |
38 #include "components/history/core/browser/history_database.h" | 38 #include "components/history/core/browser/history_database.h" |
39 #include "components/history/core/browser/history_database_params.h" | 39 #include "components/history/core/browser/history_database_params.h" |
40 #include "components/history/core/browser/history_db_task.h" | 40 #include "components/history/core/browser/history_db_task.h" |
41 #include "components/history/core/browser/in_memory_history_backend.h" | 41 #include "components/history/core/browser/in_memory_history_backend.h" |
42 #include "components/history/core/browser/keyword_search_term.h" | 42 #include "components/history/core/browser/keyword_search_term.h" |
43 #include "components/history/core/browser/page_usage_data.h" | 43 #include "components/history/core/browser/page_usage_data.h" |
44 #include "components/history/core/browser/typed_url_sync_bridge.h" | |
45 #include "components/history/core/browser/typed_url_syncable_service.h" | 44 #include "components/history/core/browser/typed_url_syncable_service.h" |
46 #include "components/history/core/browser/url_utils.h" | 45 #include "components/history/core/browser/url_utils.h" |
47 #include "components/sync/driver/sync_driver_switches.h" | 46 #include "components/sync/driver/sync_driver_switches.h" |
48 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 47 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
49 #include "sql/error_delegate_util.h" | 48 #include "sql/error_delegate_util.h" |
50 #include "third_party/skia/include/core/SkBitmap.h" | 49 #include "third_party/skia/include/core/SkBitmap.h" |
51 #include "ui/gfx/codec/png_codec.h" | 50 #include "ui/gfx/codec/png_codec.h" |
52 #include "url/gurl.h" | 51 #include "url/gurl.h" |
53 #include "url/url_constants.h" | 52 #include "url/url_constants.h" |
54 | 53 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 if (!force_fail) | 216 if (!force_fail) |
218 InitImpl(history_database_params); | 217 InitImpl(history_database_params); |
219 delegate_->DBLoaded(); | 218 delegate_->DBLoaded(); |
220 if (base::FeatureList::IsEnabled(switches::kSyncUSSTypedURL)) { | 219 if (base::FeatureList::IsEnabled(switches::kSyncUSSTypedURL)) { |
221 typed_url_sync_bridge_ = base::MakeUnique<TypedURLSyncBridge>( | 220 typed_url_sync_bridge_ = base::MakeUnique<TypedURLSyncBridge>( |
222 this, db_.get(), | 221 this, db_.get(), |
223 base::BindRepeating( | 222 base::BindRepeating( |
224 &ModelTypeChangeProcessor::Create, | 223 &ModelTypeChangeProcessor::Create, |
225 // TODO(gangwu): use ReportUnrecoverableError before launch. | 224 // TODO(gangwu): use ReportUnrecoverableError before launch. |
226 base::BindRepeating(base::IgnoreResult(&DumpWithoutCrashing)))); | 225 base::BindRepeating(base::IgnoreResult(&DumpWithoutCrashing)))); |
| 226 typed_url_sync_bridge_->Init(); |
227 } else { | 227 } else { |
228 typed_url_syncable_service_ = | 228 typed_url_syncable_service_ = |
229 base::MakeUnique<TypedUrlSyncableService>(this); | 229 base::MakeUnique<TypedUrlSyncableService>(this); |
230 } | 230 } |
231 | 231 |
232 memory_pressure_listener_.reset(new base::MemoryPressureListener( | 232 memory_pressure_listener_.reset(new base::MemoryPressureListener( |
233 base::Bind(&HistoryBackend::OnMemoryPressure, base::Unretained(this)))); | 233 base::Bind(&HistoryBackend::OnMemoryPressure, base::Unretained(this)))); |
234 } | 234 } |
235 | 235 |
236 void HistoryBackend::SetOnBackendDestroyTask( | 236 void HistoryBackend::SetOnBackendDestroyTask( |
(...skipping 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 // transaction is currently open. | 2636 // transaction is currently open. |
2637 db_->CommitTransaction(); | 2637 db_->CommitTransaction(); |
2638 db_->Vacuum(); | 2638 db_->Vacuum(); |
2639 db_->BeginTransaction(); | 2639 db_->BeginTransaction(); |
2640 db_->GetStartDate(&first_recorded_time_); | 2640 db_->GetStartDate(&first_recorded_time_); |
2641 | 2641 |
2642 return true; | 2642 return true; |
2643 } | 2643 } |
2644 | 2644 |
2645 } // namespace history | 2645 } // namespace history |
OLD | NEW |