Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1219)

Side by Side Diff: components/history/core/browser/history_backend.h

Issue 2901093009: [USS] Implement GetAllData and GetStorageKey. (Closed)
Patch Set: brettw review and rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 SetTypedURLSyncBridgeForTest(
481 std::unique_ptr<TypedURLSyncBridge> bridge) {
482 typed_url_sync_bridge_ = std::move(bridge);
483 }
479 #endif 484 #endif
480 485
481 // Returns true if the passed visit time is already expired (used by the sync 486 // 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). 487 // code to avoid syncing visits that would immediately be expired).
483 virtual bool IsExpiredVisitTime(const base::Time& time); 488 virtual bool IsExpiredVisitTime(const base::Time& time);
484 489
485 base::Time GetFirstRecordedTimeForTest() { return first_recorded_time_; } 490 base::Time GetFirstRecordedTimeForTest() { return first_recorded_time_; }
486 491
487 protected: 492 protected:
488 ~HistoryBackend() override; 493 ~HistoryBackend() override;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 // it unregisters itself as observer during destruction. 920 // it unregisters itself as observer during destruction.
916 std::unique_ptr<TypedUrlSyncableService> typed_url_syncable_service_; 921 std::unique_ptr<TypedUrlSyncableService> typed_url_syncable_service_;
917 std::unique_ptr<TypedURLSyncBridge> typed_url_sync_bridge_; 922 std::unique_ptr<TypedURLSyncBridge> typed_url_sync_bridge_;
918 923
919 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); 924 DISALLOW_COPY_AND_ASSIGN(HistoryBackend);
920 }; 925 };
921 926
922 } // namespace history 927 } // namespace history
923 928
924 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ 929 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_
OLDNEW
« no previous file with comments | « components/history/core/browser/BUILD.gn ('k') | components/history/core/browser/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698