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

Side by Side Diff: chrome/browser/sync/engine/model_changing_syncer_command.h

Issue 8470005: Add OVERRIDE to chrome/browser/sync/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: includes Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_ENGINE_MODEL_CHANGING_SYNCER_COMMAND_H_ 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_MODEL_CHANGING_SYNCER_COMMAND_H_
6 #define CHROME_BROWSER_SYNC_ENGINE_MODEL_CHANGING_SYNCER_COMMAND_H_ 6 #define CHROME_BROWSER_SYNC_ENGINE_MODEL_CHANGING_SYNCER_COMMAND_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h"
9 #include "chrome/browser/sync/engine/syncer_command.h" 10 #include "chrome/browser/sync/engine/syncer_command.h"
10 #include "chrome/browser/sync/util/unrecoverable_error_info.h" 11 #include "chrome/browser/sync/util/unrecoverable_error_info.h"
11 12
12 namespace browser_sync { 13 namespace browser_sync {
13 namespace sessions { 14 namespace sessions {
14 class SyncSession; 15 class SyncSession;
15 } 16 }
16 17
17 // An abstract SyncerCommand which dispatches its Execute step to the 18 // An abstract SyncerCommand which dispatches its Execute step to the
18 // model-safe worker thread. Classes derived from ModelChangingSyncerCommand 19 // model-safe worker thread. Classes derived from ModelChangingSyncerCommand
19 // instead of SyncerCommand must implement ModelChangingExecuteImpl instead of 20 // instead of SyncerCommand must implement ModelChangingExecuteImpl instead of
20 // ExecuteImpl, but otherwise, the contract is the same. 21 // ExecuteImpl, but otherwise, the contract is the same.
21 // 22 //
22 // A command should derive from ModelChangingSyncerCommand instead of 23 // A command should derive from ModelChangingSyncerCommand instead of
23 // SyncerCommand whenever the operation might change any client-visible 24 // SyncerCommand whenever the operation might change any client-visible
24 // fields on any syncable::Entry. If the operation involves creating a 25 // fields on any syncable::Entry. If the operation involves creating a
25 // WriteTransaction, this is a sign that ModelChangingSyncerCommand is likely 26 // WriteTransaction, this is a sign that ModelChangingSyncerCommand is likely
26 // necessary. 27 // necessary.
27 class ModelChangingSyncerCommand : public SyncerCommand { 28 class ModelChangingSyncerCommand : public SyncerCommand {
28 public: 29 public:
29 ModelChangingSyncerCommand() : work_session_(NULL) { } 30 ModelChangingSyncerCommand() : work_session_(NULL) { }
30 virtual ~ModelChangingSyncerCommand() { } 31 virtual ~ModelChangingSyncerCommand() { }
31 32
32 // SyncerCommand implementation. Sets work_session to session. 33 // SyncerCommand implementation. Sets work_session to session.
33 virtual void ExecuteImpl(sessions::SyncSession* session); 34 virtual void ExecuteImpl(sessions::SyncSession* session) OVERRIDE;
34 35
35 // wrapper so implementations don't worry about storing work_session 36 // wrapper so implementations don't worry about storing work_session
36 UnrecoverableErrorInfo StartChangingModel() { 37 UnrecoverableErrorInfo StartChangingModel() {
37 // TODO(lipalani): |ModelChangingExecuteImpl| should return an 38 // TODO(lipalani): |ModelChangingExecuteImpl| should return an
38 // UnrecoverableErrorInfo struct. 39 // UnrecoverableErrorInfo struct.
39 ModelChangingExecuteImpl(work_session_); 40 ModelChangingExecuteImpl(work_session_);
40 return UnrecoverableErrorInfo(); 41 return UnrecoverableErrorInfo();
41 } 42 }
42 43
43 // Sometimes, a command has work to do that needs to touch global state 44 // Sometimes, a command has work to do that needs to touch global state
(...skipping 16 matching lines...) Expand all
60 // Implementations will implement ModelChangingExecuteImpl and not 61 // Implementations will implement ModelChangingExecuteImpl and not
61 // worry about storing the session or setting it. They are given work_session. 62 // worry about storing the session or setting it. They are given work_session.
62 sessions::SyncSession* work_session_; 63 sessions::SyncSession* work_session_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(ModelChangingSyncerCommand); 65 DISALLOW_COPY_AND_ASSIGN(ModelChangingSyncerCommand);
65 }; 66 };
66 67
67 } // namespace browser_sync 68 } // namespace browser_sync
68 69
69 #endif // CHROME_BROWSER_SYNC_ENGINE_MODEL_CHANGING_SYNCER_COMMAND_H_ 70 #endif // CHROME_BROWSER_SYNC_ENGINE_MODEL_CHANGING_SYNCER_COMMAND_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/mock_model_safe_workers.h ('k') | chrome/browser/sync/engine/post_commit_message_command.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698