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

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

Issue 2850633004: [USS] implement CreateMetadataChangeList and GetClientTag (Closed)
Patch Set: Created 3 years, 7 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 #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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 // TODO(brettw) bug 1140015: Add an "add page" notification so the history 882 // TODO(brettw) bug 1140015: Add an "add page" notification so the history
883 // views can keep in sync. 883 // views can keep in sync.
884 NotifyURLsModified(changed_urls); 884 NotifyURLsModified(changed_urls);
885 ScheduleCommit(); 885 ScheduleCommit();
886 } 886 }
887 887
888 bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) { 888 bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) {
889 return time < expirer_.GetCurrentExpirationTime(); 889 return time < expirer_.GetCurrentExpirationTime();
890 } 890 }
891 891
892 bool HistoryBackend::UpdateSyncMetadata(
893 syncer::ModelType model_type,
894 const std::string& storage_key,
895 const sync_pb::EntityMetadata& metadata) {
896 DCHECK_EQ(model_type, syncer::TYPED_URLS)
897 << "Only the TYPED_URLS model type is supported";
898
899 return db_->UpdateSyncMetadata(storage_key, metadata);
900 }
901
902 bool HistoryBackend::ClearSyncMetadata(syncer::ModelType model_type,
903 const std::string& storage_key) {
904 DCHECK_EQ(model_type, syncer::TYPED_URLS)
905 << "Only the TYPED_URLS model type is supported";
906
907 return db_->ClearSyncMetadata(storage_key);
908 }
909
910 bool HistoryBackend::UpdateModelTypeState(
911 syncer::ModelType model_type,
912 const sync_pb::ModelTypeState& model_type_state) {
913 DCHECK_EQ(model_type, syncer::TYPED_URLS)
914 << "Only the TYPED_URLS model type is supported";
915
916 return db_->UpdateModelTypeState(model_type_state);
917 }
918
919 bool HistoryBackend::ClearModelTypeState(syncer::ModelType model_type) {
920 DCHECK_EQ(model_type, syncer::TYPED_URLS)
921 << "Only the TYPED_URLS model type is supported";
922
923 return db_->ClearModelTypeState();
924 }
925
892 void HistoryBackend::SetPageTitle(const GURL& url, 926 void HistoryBackend::SetPageTitle(const GURL& url,
893 const base::string16& title) { 927 const base::string16& title) {
894 if (!db_) 928 if (!db_)
895 return; 929 return;
896 930
897 // Search for recent redirects which should get the same title. We make a 931 // Search for recent redirects which should get the same title. We make a
898 // dummy list containing the exact URL visited if there are no redirects so 932 // dummy list containing the exact URL visited if there are no redirects so
899 // the processing below can be the same. 933 // the processing below can be the same.
900 RedirectList dummy_list; 934 RedirectList dummy_list;
901 RedirectList* redirects; 935 RedirectList* redirects;
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after
2661 // transaction is currently open. 2695 // transaction is currently open.
2662 db_->CommitTransaction(); 2696 db_->CommitTransaction();
2663 db_->Vacuum(); 2697 db_->Vacuum();
2664 db_->BeginTransaction(); 2698 db_->BeginTransaction();
2665 db_->GetStartDate(&first_recorded_time_); 2699 db_->GetStartDate(&first_recorded_time_);
2666 2700
2667 return true; 2701 return true;
2668 } 2702 }
2669 2703
2670 } // namespace history 2704 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698