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

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

Issue 8533024: sync: Use a single transaction in ProcessUpdates rather than one per entry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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_PROCESS_UPDATES_COMMAND_H_ 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_
6 #define CHROME_BROWSER_SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ 6 #define CHROME_BROWSER_SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/sync/engine/model_changing_syncer_command.h" 9 #include "chrome/browser/sync/engine/model_changing_syncer_command.h"
10 #include "chrome/browser/sync/engine/syncer_types.h" 10 #include "chrome/browser/sync/engine/syncer_types.h"
11 11
12 namespace syncable { 12 namespace syncable {
13 class ScopedDirLookup; 13 class ScopedDirLookup;
14 class WriteTransaction;
14 } 15 }
15 16
16 namespace sync_pb { 17 namespace sync_pb {
17 class SyncEntity; 18 class SyncEntity;
18 } 19 }
19 20
20 namespace browser_sync { 21 namespace browser_sync {
21 22
22 // A syncer command for processing updates. 23 // A syncer command for processing updates.
23 // 24 //
24 // Preconditions - updates in the SyncerSesssion have been downloaded 25 // Preconditions - updates in the SyncerSesssion have been downloaded
25 // and verified. 26 // and verified.
26 // 27 //
27 // Postconditions - All of the verified SyncEntity data will be copied to 28 // Postconditions - All of the verified SyncEntity data will be copied to
28 // the server fields of the corresponding syncable entries. 29 // the server fields of the corresponding syncable entries.
29 // TODO(tim): This should not be ModelChanging (bug 36592). 30 // TODO(tim): This should not be ModelChanging (bug 36592).
30 class ProcessUpdatesCommand : public ModelChangingSyncerCommand { 31 class ProcessUpdatesCommand : public ModelChangingSyncerCommand {
31 public: 32 public:
32 ProcessUpdatesCommand(); 33 ProcessUpdatesCommand();
33 virtual ~ProcessUpdatesCommand(); 34 virtual ~ProcessUpdatesCommand();
34 35
35 // ModelChangingSyncerCommand implementation. 36 // ModelChangingSyncerCommand implementation.
36 virtual bool ModelNeutralExecuteImpl(sessions::SyncSession* session); 37 virtual bool ModelNeutralExecuteImpl(sessions::SyncSession* session);
37 virtual void ModelChangingExecuteImpl(sessions::SyncSession* session); 38 virtual void ModelChangingExecuteImpl(sessions::SyncSession* session);
38 39
39 private: 40 private:
40 ServerUpdateProcessingResult ProcessUpdate( 41 ServerUpdateProcessingResult ProcessUpdate(
41 const syncable::ScopedDirLookup& dir, 42 const syncable::ScopedDirLookup& dir,
42 const sync_pb::SyncEntity& proto_update); 43 const sync_pb::SyncEntity& proto_update,
44 syncable::WriteTransaction* const trans);
43 DISALLOW_COPY_AND_ASSIGN(ProcessUpdatesCommand); 45 DISALLOW_COPY_AND_ASSIGN(ProcessUpdatesCommand);
44 }; 46 };
45 47
46 } // namespace browser_sync 48 } // namespace browser_sync
47 49
48 #endif // CHROME_BROWSER_SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ 50 #endif // CHROME_BROWSER_SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698