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

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

Issue 2723953002: [sync] skeleton implementation of TypedURLSyncBridge (Closed)
Patch Set: rebase Created 3 years, 8 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 struct DownloadRow; 46 struct DownloadRow;
47 class HistoryBackendClient; 47 class HistoryBackendClient;
48 class HistoryBackendDBBaseTest; 48 class HistoryBackendDBBaseTest;
49 class HistoryBackendObserver; 49 class HistoryBackendObserver;
50 class HistoryBackendTest; 50 class HistoryBackendTest;
51 class HistoryDatabase; 51 class HistoryDatabase;
52 struct HistoryDatabaseParams; 52 struct HistoryDatabaseParams;
53 class HistoryDBTask; 53 class HistoryDBTask;
54 class InMemoryHistoryBackend; 54 class InMemoryHistoryBackend;
55 class TypedUrlSyncableService; 55 class TypedUrlSyncableService;
56 class TypedURLSyncBridge;
56 class HistoryBackendHelper; 57 class HistoryBackendHelper;
57 class URLDatabase; 58 class URLDatabase;
58 59
59 // 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
60 // thumbnail database. 61 // thumbnail database.
61 static const size_t kMaxFaviconsPerPage = 8; 62 static const size_t kMaxFaviconsPerPage = 8;
62 63
63 // 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
64 // the thumbnail database. 65 // the thumbnail database.
65 static const size_t kMaxFaviconBitmapsPerIconURL = 8; 66 static const size_t kMaxFaviconBitmapsPerIconURL = 8;
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 // If there is no entry in the map for a given visit, that means the visit 394 // If there is no entry in the map for a given visit, that means the visit
394 // was SOURCE_BROWSED. Returns false if there is no HistoryDatabase.. 395 // was SOURCE_BROWSED. Returns false if there is no HistoryDatabase..
395 bool GetVisitsSource(const VisitVector& visits, VisitSourceMap* sources); 396 bool GetVisitsSource(const VisitVector& visits, VisitSourceMap* sources);
396 397
397 virtual bool GetURL(const GURL& url, URLRow* url_row); 398 virtual bool GetURL(const GURL& url, URLRow* url_row);
398 399
399 // Returns the syncable service for syncing typed urls. The returned service 400 // Returns the syncable service for syncing typed urls. The returned service
400 // is owned by |this| object. 401 // is owned by |this| object.
401 virtual TypedUrlSyncableService* GetTypedUrlSyncableService() const; 402 virtual TypedUrlSyncableService* GetTypedUrlSyncableService() const;
402 403
404 // Returns the sync bridge for syncing typed urls. The returned service
405 // is owned by |this| object.
406 TypedURLSyncBridge* GetTypedURLSyncBridge() const;
407
403 // Deleting ------------------------------------------------------------------ 408 // Deleting ------------------------------------------------------------------
404 409
405 virtual void DeleteURLs(const std::vector<GURL>& urls); 410 virtual void DeleteURLs(const std::vector<GURL>& urls);
406 411
407 virtual void DeleteURL(const GURL& url); 412 virtual void DeleteURL(const GURL& url);
408 413
409 // Calls ExpireHistoryBackend::ExpireHistoryBetween and commits the change. 414 // Calls ExpireHistoryBackend::ExpireHistoryBetween and commits the change.
410 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls, 415 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls,
411 base::Time begin_time, 416 base::Time begin_time,
412 base::Time end_time); 417 base::Time end_time);
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 // when a catastrophic error occurs. 907 // when a catastrophic error occurs.
903 std::string db_diagnostics_; 908 std::string db_diagnostics_;
904 909
905 // Map from host to index in the TopHosts list. It is updated only by 910 // Map from host to index in the TopHosts list. It is updated only by
906 // TopHosts(), so it's usually stale. 911 // TopHosts(), so it's usually stale.
907 mutable base::hash_map<std::string, int> host_ranks_; 912 mutable base::hash_map<std::string, int> host_ranks_;
908 913
909 // List of observers 914 // List of observers
910 base::ObserverList<HistoryBackendObserver> observers_; 915 base::ObserverList<HistoryBackendObserver> observers_;
911 916
912 // Used to manage syncing of the typed urls datatype. This will be null before 917 // Used to manage syncing of the typed urls datatype. They will be null before
913 // Init is called. Defined after observers_ because it unregisters itself as 918 // Init is called, and only one will be instantiated after Init is called
914 // observer during destruction. 919 // depending on switches::kSyncUSSTypedURL. Defined after observers_ because
920 // it unregisters itself as observer during destruction.
915 std::unique_ptr<TypedUrlSyncableService> typed_url_syncable_service_; 921 std::unique_ptr<TypedUrlSyncableService> typed_url_syncable_service_;
922 std::unique_ptr<TypedURLSyncBridge> typed_url_sync_bridge_;
916 923
917 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); 924 DISALLOW_COPY_AND_ASSIGN(HistoryBackend);
918 }; 925 };
919 926
920 } // namespace history 927 } // namespace history
921 928
922 #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