| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TEST_FAKE_SERVER_FAKE_SERVER_H_ | 5 #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ |
| 6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ | 6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Returns the entity ID of the Bookmark Bar folder. | 139 // Returns the entity ID of the Bookmark Bar folder. |
| 140 std::string GetBookmarkBarFolderId() const; | 140 std::string GetBookmarkBarFolderId() const; |
| 141 | 141 |
| 142 // Returns the current FakeServer as a WeakPtr. | 142 // Returns the current FakeServer as a WeakPtr. |
| 143 base::WeakPtr<FakeServer> AsWeakPtr(); | 143 base::WeakPtr<FakeServer> AsWeakPtr(); |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 typedef base::ScopedPtrMap<std::string, scoped_ptr<FakeServerEntity>> | 146 typedef base::ScopedPtrMap<std::string, scoped_ptr<FakeServerEntity>> |
| 147 EntityMap; | 147 EntityMap; |
| 148 | 148 |
| 149 // Gets FakeServer ready for syncing. |
| 150 void Init(); |
| 151 |
| 149 // Processes a GetUpdates call. | 152 // Processes a GetUpdates call. |
| 150 bool HandleGetUpdatesRequest(const sync_pb::GetUpdatesMessage& get_updates, | 153 bool HandleGetUpdatesRequest(const sync_pb::GetUpdatesMessage& get_updates, |
| 151 sync_pb::GetUpdatesResponse* response); | 154 sync_pb::GetUpdatesResponse* response); |
| 152 | 155 |
| 153 // Processes a Commit call. | 156 // Processes a Commit call. |
| 154 bool HandleCommitRequest(const sync_pb::CommitMessage& message, | 157 bool HandleCommitRequest(const sync_pb::CommitMessage& message, |
| 155 const std::string& invalidator_client_id, | 158 const std::string& invalidator_client_id, |
| 156 sync_pb::CommitResponse* response); | 159 sync_pb::CommitResponse* response); |
| 157 | 160 |
| 158 // Creates and saves a permanent folder for Bookmarks (e.g., Bookmark Bar). | 161 // Creates and saves a permanent folder for Bookmarks (e.g., Bookmark Bar). |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 base::ThreadChecker thread_checker_; | 251 base::ThreadChecker thread_checker_; |
| 249 | 252 |
| 250 // Creates WeakPtr versions of the current FakeServer. This must be the last | 253 // Creates WeakPtr versions of the current FakeServer. This must be the last |
| 251 // data member! | 254 // data member! |
| 252 base::WeakPtrFactory<FakeServer> weak_ptr_factory_; | 255 base::WeakPtrFactory<FakeServer> weak_ptr_factory_; |
| 253 }; | 256 }; |
| 254 | 257 |
| 255 } // namespace fake_server | 258 } // namespace fake_server |
| 256 | 259 |
| 257 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ | 260 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ |
| OLD | NEW |