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

Side by Side Diff: sync/engine/cleanup_disabled_types_command.h

Issue 10541079: [Sync] Remove CleanupDisabledTypes command and move purge logic into SyncManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 8 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
« no previous file with comments | « no previous file | sync/engine/cleanup_disabled_types_command.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SYNC_ENGINE_CLEANUP_DISABLED_TYPES_COMMAND_H_
6 #define SYNC_ENGINE_CLEANUP_DISABLED_TYPES_COMMAND_H_
7
8 #include "base/compiler_specific.h"
9 #include "sync/engine/syncer_command.h"
10
11 namespace syncer {
12
13 // A syncer command that purges (from memory and disk) entries belonging to
14 // a ModelType or ServerModelType that the user has not elected to sync.
15 //
16 // This is done as part of a session to 1) ensure it does not block the UI,
17 // and 2) avoid complicated races that could arise between a) deleting
18 // things b) a sync session trying to use these things c) and the potential
19 // re-enabling of the data type by the user before some scheduled deletion
20 // took place. Here, we are safe to perform I/O synchronously and we know it
21 // is a safe time to delete as we are in the only active session.
22 //
23 // The removal from memory is done synchronously, while the disk purge is left
24 // to an asynchronous SaveChanges operation. However, all the updates for
25 // meta data fields (such as initial_sync_ended) as well as the actual entry
26 // deletions will be committed in a single sqlite transaction. Thus it is
27 // possible that disabled types re-appear (in the sync db) after a reboot,
28 // but things will remain in a consistent state. This kind of error case is
29 // cared for in this command by retrying; see ExecuteImpl.
30 class CleanupDisabledTypesCommand : public SyncerCommand {
31 public:
32 CleanupDisabledTypesCommand();
33 virtual ~CleanupDisabledTypesCommand();
34
35 // SyncerCommand implementation.
36 virtual SyncerError ExecuteImpl(sessions::SyncSession* session) OVERRIDE;
37
38 private:
39 DISALLOW_COPY_AND_ASSIGN(CleanupDisabledTypesCommand);
40 };
41
42 } // namespace syncer
43
44 #endif // SYNC_ENGINE_CLEANUP_DISABLED_TYPES_COMMAND_H_
OLDNEW
« no previous file with comments | « no previous file | sync/engine/cleanup_disabled_types_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698