| Index: components/sync/syncable/directory.h
|
| diff --git a/sync/syncable/directory.h b/components/sync/syncable/directory.h
|
| similarity index 93%
|
| rename from sync/syncable/directory.h
|
| rename to components/sync/syncable/directory.h
|
| index bdbfe95c6fa3f2b6504f5637ca9721bf0581b19b..ba8738e809962c1f9450eb7e70d2d018f80ff198 100644
|
| --- a/sync/syncable/directory.h
|
| +++ b/components/sync/syncable/directory.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef SYNC_SYNCABLE_DIRECTORY_H_
|
| -#define SYNC_SYNCABLE_DIRECTORY_H_
|
| +#ifndef COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_
|
| +#define COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_
|
|
|
| #include <stddef.h>
|
| #include <stdint.h>
|
| @@ -20,15 +20,15 @@
|
| #include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| #include "base/values.h"
|
| -#include "sync/api/attachments/attachment_id.h"
|
| -#include "sync/base/sync_export.h"
|
| -#include "sync/internal_api/public/util/weak_handle.h"
|
| -#include "sync/syncable/dir_open_result.h"
|
| -#include "sync/syncable/entry.h"
|
| -#include "sync/syncable/entry_kernel.h"
|
| -#include "sync/syncable/metahandle_set.h"
|
| -#include "sync/syncable/parent_child_index.h"
|
| -#include "sync/syncable/syncable_delete_journal.h"
|
| +#include "components/sync/api/attachments/attachment_id.h"
|
| +#include "components/sync/base/sync_export.h"
|
| +#include "components/sync/base/weak_handle.h"
|
| +#include "components/sync/syncable/dir_open_result.h"
|
| +#include "components/sync/syncable/entry.h"
|
| +#include "components/sync/syncable/entry_kernel.h"
|
| +#include "components/sync/syncable/metahandle_set.h"
|
| +#include "components/sync/syncable/parent_child_index.h"
|
| +#include "components/sync/syncable/syncable_delete_journal.h"
|
|
|
| namespace syncer {
|
|
|
| @@ -120,8 +120,7 @@ class SYNC_EXPORT Directory {
|
| PersistedKernelInfo kernel_info;
|
| std::string cache_guid; // Created on first initialization, never changes.
|
| int64_t max_metahandle; // Computed (using sql MAX aggregate) on init.
|
| - KernelLoadInfo() : max_metahandle(0) {
|
| - }
|
| + KernelLoadInfo() : max_metahandle(0) {}
|
| };
|
|
|
| // When the Directory is told to SaveChanges, a SaveChangesSnapshot is
|
| @@ -145,7 +144,8 @@ class SYNC_EXPORT Directory {
|
| struct Kernel {
|
| // |delegate| must not be NULL. |transaction_observer| must be
|
| // initialized.
|
| - Kernel(const std::string& name, const KernelLoadInfo& info,
|
| + Kernel(const std::string& name,
|
| + const KernelLoadInfo& info,
|
| DirectoryChangeDelegate* delegate,
|
| const WeakHandle<TransactionObserver>& transaction_observer);
|
|
|
| @@ -256,10 +256,10 @@ class SYNC_EXPORT Directory {
|
| // Starts sending events to |delegate| if the returned result is
|
| // OPENED. Note that events to |delegate| may be sent from *any*
|
| // thread. |transaction_observer| must be initialized.
|
| - DirOpenResult Open(const std::string& name,
|
| - DirectoryChangeDelegate* delegate,
|
| - const WeakHandle<TransactionObserver>&
|
| - transaction_observer);
|
| + DirOpenResult Open(
|
| + const std::string& name,
|
| + DirectoryChangeDelegate* delegate,
|
| + const WeakHandle<TransactionObserver>& transaction_observer);
|
|
|
| int64_t NextMetahandle();
|
| // Generates next client ID based on a randomly generated GUID.
|
| @@ -269,15 +269,12 @@ class SYNC_EXPORT Directory {
|
|
|
| // The download progress is an opaque token provided by the sync server
|
| // to indicate the continuation state of the next GetUpdates operation.
|
| - void GetDownloadProgress(
|
| - ModelType type,
|
| - sync_pb::DataTypeProgressMarker* value_out) const;
|
| - void GetDownloadProgressAsString(
|
| - ModelType type,
|
| - std::string* value_out) const;
|
| - void SetDownloadProgress(
|
| - ModelType type,
|
| - const sync_pb::DataTypeProgressMarker& value);
|
| + void GetDownloadProgress(ModelType type,
|
| + sync_pb::DataTypeProgressMarker* value_out) const;
|
| + void GetDownloadProgressAsString(ModelType type,
|
| + std::string* value_out) const;
|
| + void SetDownloadProgress(ModelType type,
|
| + const sync_pb::DataTypeProgressMarker& value);
|
| bool HasEmptyDownloadProgress(ModelType type) const;
|
|
|
| // Gets the total number of entries in the directory.
|
| @@ -336,15 +333,16 @@ class SYNC_EXPORT Directory {
|
| // the error to upper layers.
|
| void OnUnrecoverableError(const BaseTransaction* trans,
|
| const tracked_objects::Location& location,
|
| - const std::string & message);
|
| + const std::string& message);
|
|
|
| DeleteJournal* delete_journal();
|
|
|
| // Returns the child meta handles (even those for deleted/unlinked
|
| // nodes) for given parent id. Clears |result| if there are no
|
| // children.
|
| - bool GetChildHandlesById(BaseTransaction*, const Id& parent_id,
|
| - Metahandles* result);
|
| + bool GetChildHandlesById(BaseTransaction*,
|
| + const Id& parent_id,
|
| + Metahandles* result);
|
|
|
| // Counts all items under the given node, including the node itself.
|
| int GetTotalNodeCount(BaseTransaction*, EntryKernel* kernel_) const;
|
| @@ -398,8 +396,7 @@ class SYNC_EXPORT Directory {
|
| // Get GetUnsyncedMetaHandles should only be called after SaveChanges and
|
| // before any new entries have been created. The intention is that the
|
| // syncer should call it from its PerformSyncQueries member.
|
| - void GetUnsyncedMetaHandles(BaseTransaction* trans,
|
| - Metahandles* result);
|
| + void GetUnsyncedMetaHandles(BaseTransaction* trans, Metahandles* result);
|
|
|
| // Returns whether or not this |type| has unapplied updates.
|
| bool TypeHasUnappliedUpdates(ModelType type);
|
| @@ -432,13 +429,12 @@ class SYNC_EXPORT Directory {
|
| // Checks tree metadata consistency following a transaction. It is intended
|
| // to provide a reasonable tradeoff between performance and comprehensiveness
|
| // and may be used in release code.
|
| - bool CheckInvariantsOnTransactionClose(
|
| - syncable::BaseTransaction* trans,
|
| - const MetahandleSet& modified_handles);
|
| + bool CheckInvariantsOnTransactionClose(syncable::BaseTransaction* trans,
|
| + const MetahandleSet& modified_handles);
|
|
|
| // Forces a full check of the directory. This operation may be slow and
|
| // should not be invoked outside of tests.
|
| - bool FullyCheckTreeInvariants(BaseTransaction *trans);
|
| + bool FullyCheckTreeInvariants(BaseTransaction* trans);
|
|
|
| // Purges data associated with any entries whose ModelType or ServerModelType
|
| // is found in |disabled_types|, from sync directory _both_ in memory and on
|
| @@ -508,10 +504,12 @@ class SYNC_EXPORT Directory {
|
|
|
| virtual EntryKernel* GetEntryByHandle(int64_t handle);
|
|
|
| - bool ReindexId(BaseWriteTransaction* trans, EntryKernel* const entry,
|
| + bool ReindexId(BaseWriteTransaction* trans,
|
| + EntryKernel* const entry,
|
| const Id& new_id);
|
|
|
| - bool ReindexParentId(BaseWriteTransaction* trans, EntryKernel* const entry,
|
| + bool ReindexParentId(BaseWriteTransaction* trans,
|
| + EntryKernel* const entry,
|
| const Id& new_parent_id);
|
|
|
| // Accessors for the underlying Kernel. Although these are public methods, the
|
| @@ -659,4 +657,4 @@ class SYNC_EXPORT Directory {
|
| } // namespace syncable
|
| } // namespace syncer
|
|
|
| -#endif // SYNC_SYNCABLE_DIRECTORY_H_
|
| +#endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_
|
|
|