OLD | NEW |
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_DOWNLOAD_UPDATES_COMMAND_H_ | 5 #ifndef SYNC_ENGINE_DOWNLOAD_UPDATES_COMMAND_H_ |
6 #define SYNC_ENGINE_DOWNLOAD_UPDATES_COMMAND_H_ | 6 #define SYNC_ENGINE_DOWNLOAD_UPDATES_COMMAND_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "sync/engine/syncer_command.h" | 11 #include "sync/engine/syncer_command.h" |
(...skipping 18 matching lines...) Expand all Loading... |
30 // in the SyncSession. Only one server request is performed per Execute | 30 // in the SyncSession. Only one server request is performed per Execute |
31 // operation. A loop that causes multiple Execute operations within a sync | 31 // operation. A loop that causes multiple Execute operations within a sync |
32 // session can be found in the Syncer logic. When looping, the | 32 // session can be found in the Syncer logic. When looping, the |
33 // DownloadUpdatesCommand consumes the information stored by the | 33 // DownloadUpdatesCommand consumes the information stored by the |
34 // StoreTimestampsCommand. | 34 // StoreTimestampsCommand. |
35 // | 35 // |
36 // In practice, DownloadUpdatesCommand should loop until all updates are | 36 // In practice, DownloadUpdatesCommand should loop until all updates are |
37 // downloaded for all enabled datatypes (i.e., until the server indicates | 37 // downloaded for all enabled datatypes (i.e., until the server indicates |
38 // changes_remaining == 0 in the GetUpdates response), or until an error | 38 // changes_remaining == 0 in the GetUpdates response), or until an error |
39 // is encountered. | 39 // is encountered. |
40 class DownloadUpdatesCommand : public SyncerCommand { | 40 class SYNC_EXPORT_PRIVATE DownloadUpdatesCommand : public SyncerCommand { |
41 public: | 41 public: |
42 // |create_mobile_bookmarks_folder| controls whether or not to | 42 // |create_mobile_bookmarks_folder| controls whether or not to |
43 // create the mobile bookmarks folder if it's not already created. | 43 // create the mobile bookmarks folder if it's not already created. |
44 // Should be set to true only by mobile clients. | 44 // Should be set to true only by mobile clients. |
45 explicit DownloadUpdatesCommand(bool create_mobile_bookmarks_folder); | 45 explicit DownloadUpdatesCommand(bool create_mobile_bookmarks_folder); |
46 virtual ~DownloadUpdatesCommand(); | 46 virtual ~DownloadUpdatesCommand(); |
47 | 47 |
48 // SyncerCommand implementation. | 48 // SyncerCommand implementation. |
49 virtual SyncerError ExecuteImpl(sessions::SyncSession* session) OVERRIDE; | 49 virtual SyncerError ExecuteImpl(sessions::SyncSession* session) OVERRIDE; |
50 | 50 |
51 private: | 51 private: |
52 FRIEND_TEST_ALL_PREFIXES(DownloadUpdatesCommandTest, VerifyAppendDebugInfo); | 52 FRIEND_TEST_ALL_PREFIXES(DownloadUpdatesCommandTest, VerifyAppendDebugInfo); |
53 void AppendClientDebugInfoIfNeeded(sessions::SyncSession* session, | 53 void AppendClientDebugInfoIfNeeded(sessions::SyncSession* session, |
54 sync_pb::DebugInfo* debug_info); | 54 sync_pb::DebugInfo* debug_info); |
55 | 55 |
56 const bool create_mobile_bookmarks_folder_; | 56 const bool create_mobile_bookmarks_folder_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(DownloadUpdatesCommand); | 58 DISALLOW_COPY_AND_ASSIGN(DownloadUpdatesCommand); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace syncer | 61 } // namespace syncer |
62 | 62 |
63 #endif // SYNC_ENGINE_DOWNLOAD_UPDATES_COMMAND_H_ | 63 #endif // SYNC_ENGINE_DOWNLOAD_UPDATES_COMMAND_H_ |
OLD | NEW |