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

Side by Side Diff: chrome/browser/sync/profile_sync_service.h

Issue 332923002: [sync] Add backup time in synced device info so that server can flag device (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check db on DB thread Created 6 years, 5 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 | Annotate | Revision Log
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 CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 } 775 }
776 776
777 void SetClearingBrowseringDataForTesting( 777 void SetClearingBrowseringDataForTesting(
778 base::Callback<void(Profile*, base::Time, base::Time)> c); 778 base::Callback<void(Profile*, base::Time, base::Time)> c);
779 779
780 // Return the base URL of the Sync Server. 780 // Return the base URL of the Sync Server.
781 static GURL GetSyncServiceURL(const base::CommandLine& command_line); 781 static GURL GetSyncServiceURL(const base::CommandLine& command_line);
782 782
783 void StartStopBackupForTesting(); 783 void StartStopBackupForTesting();
784 784
785 base::Time GetDeviceBackupTimeForTesting() const;
786
785 protected: 787 protected:
786 // Helper to configure the priority data types. 788 // Helper to configure the priority data types.
787 void ConfigurePriorityDataTypes(); 789 void ConfigurePriorityDataTypes();
788 790
789 // Helper to install and configure a data type manager. 791 // Helper to install and configure a data type manager.
790 void ConfigureDataTypeManager(); 792 void ConfigureDataTypeManager();
791 793
792 // Shuts down the backend sync components. 794 // Shuts down the backend sync components.
793 // |option| indicates if syncing is being disabled or not, and whether 795 // |option| indicates if syncing is being disabled or not, and whether
794 // to claim ownership of sync thread from backend. 796 // to claim ownership of sync thread from backend.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 952
951 // True if a syncing backend exists. 953 // True if a syncing backend exists.
952 bool HasSyncingBackend() const; 954 bool HasSyncingBackend() const;
953 955
954 // Update first sync time stored in preferences 956 // Update first sync time stored in preferences
955 void UpdateFirstSyncTimePref(); 957 void UpdateFirstSyncTimePref();
956 958
957 // Clear browsing data since first sync during rollback. 959 // Clear browsing data since first sync during rollback.
958 void ClearBrowsingDataSinceFirstSync(); 960 void ClearBrowsingDataSinceFirstSync();
959 961
962 // Post background task to check sync backup DB state if needed.
963 void CheckSyncBackupIfNeeded();
964
965 // Callback to receive backup DB check result.
966 void CheckSyncBackupCallback(base::Time backup_time);
967
960 // Factory used to create various dependent objects. 968 // Factory used to create various dependent objects.
961 scoped_ptr<ProfileSyncComponentsFactory> factory_; 969 scoped_ptr<ProfileSyncComponentsFactory> factory_;
962 970
963 // The profile whose data we are synchronizing. 971 // The profile whose data we are synchronizing.
964 Profile* profile_; 972 Profile* profile_;
965 973
966 // The class that handles getting, setting, and persisting sync 974 // The class that handles getting, setting, and persisting sync
967 // preferences. 975 // preferences.
968 sync_driver::SyncPrefs sync_prefs_; 976 sync_driver::SyncPrefs sync_prefs_;
969 977
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 1125
1118 // Mode of current backend. 1126 // Mode of current backend.
1119 BackendMode backend_mode_; 1127 BackendMode backend_mode_;
1120 1128
1121 // When browser starts, delay sync backup/rollback backend start for this 1129 // When browser starts, delay sync backup/rollback backend start for this
1122 // time. 1130 // time.
1123 base::TimeDelta backup_start_delay_; 1131 base::TimeDelta backup_start_delay_;
1124 1132
1125 base::Callback<void(Profile*, base::Time, base::Time)> clear_browsing_data_; 1133 base::Callback<void(Profile*, base::Time, base::Time)> clear_browsing_data_;
1126 1134
1135 // Last time when pre-sync data was saved. NULL pointer means backup data
1136 // state is unknown. If time value is null, backup data doesn't exist.
1137 scoped_ptr<base::Time> last_backup_time_;
1138
1127 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 1139 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
1128 }; 1140 };
1129 1141
1130 bool ShouldShowActionOnUI( 1142 bool ShouldShowActionOnUI(
1131 const syncer::SyncProtocolError& error); 1143 const syncer::SyncProtocolError& error);
1132 1144
1133 1145
1134 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 1146 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/synced_device_tracker_unittest.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698