| OLD | NEW | 
|    1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2006-2008 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 // Utility functions manipulating syncable::Entries, intended for use by the |    5 // Utility functions manipulating syncable::Entries, intended for use by the | 
|    6 // syncer. |    6 // syncer. | 
|    7  |    7  | 
|    8 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |    8 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 
|    9 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |    9 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 
|   10  |   10  | 
|   11 #include <set> |   11 #include <set> | 
|   12 #include <string> |   12 #include <string> | 
|   13 #include <vector> |   13 #include <vector> | 
|   14  |   14  | 
|   15 #include "build/build_config.h" |   15 #include "build/build_config.h" | 
|   16 #include "chrome/browser/sync/engine/syncer.h" |   16 #include "chrome/browser/sync/engine/syncer.h" | 
|   17 #include "chrome/browser/sync/engine/syncer_types.h" |   17 #include "chrome/browser/sync/engine/syncer_types.h" | 
|   18 #include "chrome/browser/sync/syncable/syncable.h" |   18 #include "chrome/browser/sync/syncable/syncable.h" | 
|   19 #include "chrome/browser/sync/syncable/syncable_id.h" |   19 #include "chrome/browser/sync/syncable/syncable_id.h" | 
|   20 #include "chrome/browser/sync/util/path_helpers.h" |   20 #include "chrome/browser/sync/util/path_helpers.h" | 
|   21 #include "chrome/browser/sync/util/sync_types.h" |   21 #include "chrome/browser/sync/util/sync_types.h" | 
|   22  |   22  | 
|   23 namespace browser_sync { |   23 namespace browser_sync { | 
|   24  |   24  | 
|   25 class SyncerSession; |  | 
|   26 class SyncEntity; |   25 class SyncEntity; | 
|   27  |   26  | 
|   28 class SyncerUtil { |   27 class SyncerUtil { | 
|   29  public: |   28  public: | 
|   30   // TODO(ncarter): Remove unique-in-parent title support and name conflicts. |   29   // TODO(ncarter): Remove unique-in-parent title support and name conflicts. | 
|   31   static syncable::Id GetNameConflictingItemId( |   30   static syncable::Id GetNameConflictingItemId( | 
|   32       syncable::BaseTransaction* trans, |   31       syncable::BaseTransaction* trans, | 
|   33       const syncable::Id& parent_id, |   32       const syncable::Id& parent_id, | 
|   34       const PathString& server_name); |   33       const PathString& server_name); | 
|   35  |   34  | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
|   48                                              const syncable::Id& new_id); |   47                                              const syncable::Id& new_id); | 
|   49  |   48  | 
|   50   static void AttemptReuniteLostCommitResponses( |   49   static void AttemptReuniteLostCommitResponses( | 
|   51       syncable::WriteTransaction* trans, |   50       syncable::WriteTransaction* trans, | 
|   52       const SyncEntity& server_entry, |   51       const SyncEntity& server_entry, | 
|   53       const std::string& client_id); |   52       const std::string& client_id); | 
|   54  |   53  | 
|   55   static UpdateAttemptResponse AttemptToUpdateEntry( |   54   static UpdateAttemptResponse AttemptToUpdateEntry( | 
|   56       syncable::WriteTransaction* const trans, |   55       syncable::WriteTransaction* const trans, | 
|   57       syncable::MutableEntry* const entry, |   56       syncable::MutableEntry* const entry, | 
|   58       SyncerSession* const session); |   57       ConflictResolver* resolver); | 
|   59  |   58  | 
|   60   static UpdateAttemptResponse AttemptToUpdateEntryWithoutMerge( |   59   static UpdateAttemptResponse AttemptToUpdateEntryWithoutMerge( | 
|   61       syncable::WriteTransaction* const trans, |   60       syncable::WriteTransaction* const trans, | 
|   62       syncable::MutableEntry* const entry, |   61       syncable::MutableEntry* const entry, | 
|   63       SyncerSession* const session, syncable::Id* const conflicting_id); |   62       syncable::Id* const conflicting_id); | 
|   64  |   63  | 
|   65   // Pass in name to avoid redundant UTF8 conversion. |   64   // Pass in name to avoid redundant UTF8 conversion. | 
|   66   static void UpdateServerFieldsFromUpdate( |   65   static void UpdateServerFieldsFromUpdate( | 
|   67       syncable::MutableEntry* local_entry, |   66       syncable::MutableEntry* local_entry, | 
|   68       const SyncEntity& server_entry, |   67       const SyncEntity& server_entry, | 
|   69       const syncable::SyncName& name); |   68       const syncable::SyncName& name); | 
|   70  |   69  | 
|   71   static void ApplyExtendedAttributes( |   70   static void ApplyExtendedAttributes( | 
|   72       syncable::MutableEntry* local_entry, |   71       syncable::MutableEntry* local_entry, | 
|   73       const SyncEntity& server_entry); |   72       const SyncEntity& server_entry); | 
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  197  |  196  | 
|  198 inline bool ClientAndServerTimeMatch(int64 client_time, int64 server_time) { |  197 inline bool ClientAndServerTimeMatch(int64 client_time, int64 server_time) { | 
|  199   // Compare at the coarser timescale (server) |  198   // Compare at the coarser timescale (server) | 
|  200   return ClientTimeToServerTime(client_time) == server_time; |  199   return ClientTimeToServerTime(client_time) == server_time; | 
|  201 } |  200 } | 
|  202 #endif |  201 #endif | 
|  203  |  202  | 
|  204 }  // namespace browser_sync |  203 }  // namespace browser_sync | 
|  205  |  204  | 
|  206 #endif  // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |  205 #endif  // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 
| OLD | NEW |