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

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

Issue 11624037: [sync] Componentize sync: Part 6: Add more SYNC_EXPORTs to files in src/sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase (no code changes) Created 7 years, 11 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 | « sync/engine/syncer.h ('k') | sync/engine/syncer_proto_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 SYNC_ENGINE_SYNCER_COMMAND_H_ 5 #ifndef SYNC_ENGINE_SYNCER_COMMAND_H_
6 #define SYNC_ENGINE_SYNCER_COMMAND_H_ 6 #define SYNC_ENGINE_SYNCER_COMMAND_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 #include "sync/base/sync_export.h"
10 #include "sync/internal_api/public/util/syncer_error.h" 11 #include "sync/internal_api/public/util/syncer_error.h"
11 12
12 namespace syncer { 13 namespace syncer {
13 14
14 namespace sessions { 15 namespace sessions {
15 class SyncSession; 16 class SyncSession;
16 } 17 }
17 18
18 // Implementation of a simple command pattern intended to be driven by the 19 // Implementation of a simple command pattern intended to be driven by the
19 // Syncer. SyncerCommand is abstract and all subclasses must implement 20 // Syncer. SyncerCommand is abstract and all subclasses must implement
20 // ExecuteImpl(). This is done so that chunks of syncer operation can be unit 21 // ExecuteImpl(). This is done so that chunks of syncer operation can be unit
21 // tested. 22 // tested.
22 // 23 //
23 // Example Usage: 24 // Example Usage:
24 // 25 //
25 // SyncSession session = ...; 26 // SyncSession session = ...;
26 // SyncerCommand *cmd = SomeCommandFactory.createCommand(...); 27 // SyncerCommand *cmd = SomeCommandFactory.createCommand(...);
27 // cmd->Execute(session); 28 // cmd->Execute(session);
28 // delete cmd; 29 // delete cmd;
29 30
30 class SyncerCommand { 31 class SYNC_EXPORT_PRIVATE SyncerCommand {
31 public: 32 public:
32 SyncerCommand(); 33 SyncerCommand();
33 virtual ~SyncerCommand(); 34 virtual ~SyncerCommand();
34 35
35 // Execute dispatches to a derived class's ExecuteImpl. 36 // Execute dispatches to a derived class's ExecuteImpl.
36 SyncerError Execute(sessions::SyncSession* session); 37 SyncerError Execute(sessions::SyncSession* session);
37 38
38 // ExecuteImpl is where derived classes actually do work. 39 // ExecuteImpl is where derived classes actually do work.
39 virtual SyncerError ExecuteImpl(sessions::SyncSession* session) = 0; 40 virtual SyncerError ExecuteImpl(sessions::SyncSession* session) = 0;
40 private: 41 private:
41 DISALLOW_COPY_AND_ASSIGN(SyncerCommand); 42 DISALLOW_COPY_AND_ASSIGN(SyncerCommand);
42 }; 43 };
43 44
44 } // namespace syncer 45 } // namespace syncer
45 46
46 #endif // SYNC_ENGINE_SYNCER_COMMAND_H_ 47 #endif // SYNC_ENGINE_SYNCER_COMMAND_H_
OLDNEW
« no previous file with comments | « sync/engine/syncer.h ('k') | sync/engine/syncer_proto_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698