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 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... | |
25 #include "base/single_thread_task_runner.h" | 25 #include "base/single_thread_task_runner.h" |
26 #include "base/supports_user_data.h" | 26 #include "base/supports_user_data.h" |
27 #include "base/task/cancelable_task_tracker.h" | 27 #include "base/task/cancelable_task_tracker.h" |
28 #include "build/build_config.h" | 28 #include "build/build_config.h" |
29 #include "components/favicon_base/favicon_usage_data.h" | 29 #include "components/favicon_base/favicon_usage_data.h" |
30 #include "components/history/core/browser/expire_history_backend.h" | 30 #include "components/history/core/browser/expire_history_backend.h" |
31 #include "components/history/core/browser/history_backend_notifier.h" | 31 #include "components/history/core/browser/history_backend_notifier.h" |
32 #include "components/history/core/browser/history_types.h" | 32 #include "components/history/core/browser/history_types.h" |
33 #include "components/history/core/browser/keyword_id.h" | 33 #include "components/history/core/browser/keyword_id.h" |
34 #include "components/history/core/browser/thumbnail_database.h" | 34 #include "components/history/core/browser/thumbnail_database.h" |
35 #include "components/history/core/browser/typed_url_sync_bridge.h" | |
35 #include "components/history/core/browser/visit_tracker.h" | 36 #include "components/history/core/browser/visit_tracker.h" |
36 #include "sql/init_status.h" | 37 #include "sql/init_status.h" |
37 | 38 |
38 class SkBitmap; | 39 class SkBitmap; |
39 class TestingProfile; | 40 class TestingProfile; |
40 | 41 |
41 namespace base { | 42 namespace base { |
42 class SingleThreadTaskRunner; | 43 class SingleThreadTaskRunner; |
43 } | 44 } |
44 | 45 |
45 namespace history { | 46 namespace history { |
46 struct DownloadRow; | 47 struct DownloadRow; |
47 class HistoryBackendClient; | 48 class HistoryBackendClient; |
48 class HistoryBackendDBBaseTest; | 49 class HistoryBackendDBBaseTest; |
49 class HistoryBackendObserver; | 50 class HistoryBackendObserver; |
50 class HistoryBackendTest; | 51 class HistoryBackendTest; |
51 class HistoryDatabase; | 52 class HistoryDatabase; |
52 struct HistoryDatabaseParams; | 53 struct HistoryDatabaseParams; |
53 class HistoryDBTask; | 54 class HistoryDBTask; |
54 class InMemoryHistoryBackend; | 55 class InMemoryHistoryBackend; |
55 class TypedUrlSyncableService; | 56 class TypedUrlSyncableService; |
56 class TypedURLSyncBridge; | |
57 class HistoryBackendHelper; | 57 class HistoryBackendHelper; |
58 class URLDatabase; | 58 class URLDatabase; |
59 | 59 |
60 // The maximum number of icons URLs per page which can be stored in the | 60 // The maximum number of icons URLs per page which can be stored in the |
61 // thumbnail database. | 61 // thumbnail database. |
62 static const size_t kMaxFaviconsPerPage = 8; | 62 static const size_t kMaxFaviconsPerPage = 8; |
63 | 63 |
64 // The maximum number of bitmaps for a single icon URL which can be stored in | 64 // The maximum number of bitmaps for a single icon URL which can be stored in |
65 // the thumbnail database. | 65 // the thumbnail database. |
66 static const size_t kMaxFaviconBitmapsPerIconURL = 8; | 66 static const size_t kMaxFaviconBitmapsPerIconURL = 8; |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
469 // Adds the given rows to the database if it doesn't exist. A visit will be | 469 // Adds the given rows to the database if it doesn't exist. A visit will be |
470 // added for each given URL at the last visit time in the URLRow if the | 470 // added for each given URL at the last visit time in the URLRow if the |
471 // passed visit type != SOURCE_SYNCED (the sync code manages visits itself). | 471 // passed visit type != SOURCE_SYNCED (the sync code manages visits itself). |
472 // Each visit will have the visit_source type set. | 472 // Each visit will have the visit_source type set. |
473 void AddPagesWithDetails(const URLRows& info, VisitSource visit_source); | 473 void AddPagesWithDetails(const URLRows& info, VisitSource visit_source); |
474 | 474 |
475 #if defined(UNIT_TEST) | 475 #if defined(UNIT_TEST) |
476 HistoryDatabase* db() const { return db_.get(); } | 476 HistoryDatabase* db() const { return db_.get(); } |
477 | 477 |
478 ExpireHistoryBackend* expire_backend() { return &expirer_; } | 478 ExpireHistoryBackend* expire_backend() { return &expirer_; } |
479 | |
480 void SetTypedURLSyncBridge(std::unique_ptr<TypedURLSyncBridge> bridge) { | |
pavely
2017/06/01 20:49:18
Could you name it SetTypedURLSyncBridgeForTest. Th
Gang Wu
2017/06/02 00:00:23
Done.
| |
481 typed_url_sync_bridge_.swap(bridge); | |
pavely
2017/06/01 20:49:18
I'd prefer "typed_url_sync_bridge_ = std::move(bri
Gang Wu
2017/06/02 00:00:23
Done.
| |
482 } | |
479 #endif | 483 #endif |
480 | 484 |
481 // Returns true if the passed visit time is already expired (used by the sync | 485 // Returns true if the passed visit time is already expired (used by the sync |
482 // code to avoid syncing visits that would immediately be expired). | 486 // code to avoid syncing visits that would immediately be expired). |
483 virtual bool IsExpiredVisitTime(const base::Time& time); | 487 virtual bool IsExpiredVisitTime(const base::Time& time); |
484 | 488 |
485 base::Time GetFirstRecordedTimeForTest() { return first_recorded_time_; } | 489 base::Time GetFirstRecordedTimeForTest() { return first_recorded_time_; } |
486 | 490 |
487 protected: | 491 protected: |
488 ~HistoryBackend() override; | 492 ~HistoryBackend() override; |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
915 // it unregisters itself as observer during destruction. | 919 // it unregisters itself as observer during destruction. |
916 std::unique_ptr<TypedUrlSyncableService> typed_url_syncable_service_; | 920 std::unique_ptr<TypedUrlSyncableService> typed_url_syncable_service_; |
917 std::unique_ptr<TypedURLSyncBridge> typed_url_sync_bridge_; | 921 std::unique_ptr<TypedURLSyncBridge> typed_url_sync_bridge_; |
918 | 922 |
919 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 923 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
920 }; | 924 }; |
921 | 925 |
922 } // namespace history | 926 } // namespace history |
923 | 927 |
924 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 928 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
OLD | NEW |