summaryrefslogtreecommitdiffstats
path: root/sync/syncable
diff options
context:
space:
mode:
authorskym <skym@chromium.org>2015-12-14 11:56:34 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-14 19:57:20 +0000
commitf593336f972fa8d64584baf5c2e5cef809857a88 (patch)
treecc265bd5b06199bb10a78dd1835fb67db0312ebf /sync/syncable
parentd9f3318112e50d0cfd3e2c2cd97b236dd0038f79 (diff)
downloadchromium_src-f593336f972fa8d64584baf5c2e5cef809857a88.zip
chromium_src-f593336f972fa8d64584baf5c2e5cef809857a88.tar.gz
chromium_src-f593336f972fa8d64584baf5c2e5cef809857a88.tar.bz2
[Sync] Fixing all trivial lint violations in src/sync/*
BUG=567301 Review URL: https://codereview.chromium.org/1510023002 Cr-Commit-Position: refs/heads/master@{#365077}
Diffstat (limited to 'sync/syncable')
-rw-r--r--sync/syncable/dir_open_result.h21
-rw-r--r--sync/syncable/directory_backing_store.cc13
-rw-r--r--sync/syncable/directory_unittest.cc26
-rw-r--r--sync/syncable/entry.h5
-rw-r--r--sync/syncable/entry_kernel.cc2
-rw-r--r--sync/syncable/metahandle_set.h6
-rw-r--r--sync/syncable/model_neutral_mutable_entry.cc2
-rw-r--r--sync/syncable/mutable_entry.cc2
-rw-r--r--sync/syncable/nigori_handler.cc2
-rw-r--r--sync/syncable/parent_child_index_unittest.cc9
-rw-r--r--sync/syncable/scoped_kernel_lock.h2
-rw-r--r--sync/syncable/scoped_parent_child_index_updater.cc7
-rw-r--r--sync/syncable/scoped_parent_child_index_updater.h10
-rw-r--r--sync/syncable/syncable_base_transaction.h2
-rw-r--r--sync/syncable/syncable_delete_journal.h4
-rw-r--r--sync/syncable/syncable_enum_conversions.cc4
-rw-r--r--sync/syncable/syncable_model_neutral_write_transaction.cc2
-rw-r--r--sync/syncable/syncable_read_transaction.h4
-rw-r--r--sync/syncable/syncable_unittest.cc14
-rw-r--r--sync/syncable/syncable_util_unittest.cc2
-rw-r--r--sync/syncable/syncable_write_transaction.cc4
-rw-r--r--sync/syncable/syncable_write_transaction.h4
-rw-r--r--sync/syncable/write_transaction_info.h2
23 files changed, 82 insertions, 67 deletions
diff --git a/sync/syncable/dir_open_result.h b/sync/syncable/dir_open_result.h
index 0df3c6c..2ba8d66 100644
--- a/sync/syncable/dir_open_result.h
+++ b/sync/syncable/dir_open_result.h
@@ -7,16 +7,17 @@
namespace syncer {
namespace syncable {
-enum DirOpenResult { NOT_INITIALIZED,
- OPENED, // success.
- FAILED_NEWER_VERSION, // DB version is too new.
- FAILED_MAKE_REPOSITORY, // Couldn't create subdir.
- FAILED_OPEN_DATABASE, // sqlite_open() failed.
- FAILED_DISK_FULL, // The disk is full.
- FAILED_DATABASE_CORRUPT, // Something is wrong with the DB
- FAILED_LOGICAL_CORRUPTION, // Invalid database contents
- FAILED_IN_UNITTEST, // For tests.
- FAILED_INITIAL_WRITE, // Early write to DB failed.
+enum DirOpenResult {
+ NOT_INITIALIZED,
+ OPENED, // success.
+ FAILED_NEWER_VERSION, // DB version is too new.
+ FAILED_MAKE_REPOSITORY, // Couldn't create subdir.
+ FAILED_OPEN_DATABASE, // sqlite_open() failed.
+ FAILED_DISK_FULL, // The disk is full.
+ FAILED_DATABASE_CORRUPT, // Something is wrong with the DB
+ FAILED_LOGICAL_CORRUPTION, // Invalid database contents
+ FAILED_IN_UNITTEST, // For tests.
+ FAILED_INITIAL_WRITE, // Early write to DB failed.
};
} // namespace syncable
} // namespace syncer
diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc
index e57f246..54b573f 100644
--- a/sync/syncable/directory_backing_store.cc
+++ b/sync/syncable/directory_backing_store.cc
@@ -4,8 +4,6 @@
#include "sync/syncable/directory_backing_store.h"
-#include "build/build_config.h"
-
#include <limits>
#include "base/base64.h"
@@ -16,6 +14,7 @@
#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
+#include "build/build_config.h"
#include "sql/connection.h"
#include "sql/error_delegate_util.h"
#include "sql/statement.h"
@@ -1210,8 +1209,8 @@ bool DirectoryBackingStore::MigrateVersion79To80() {
}
bool DirectoryBackingStore::MigrateVersion80To81() {
- if(!db_->Execute(
- "ALTER TABLE metas ADD COLUMN server_ordinal_in_parent BLOB"))
+ if (!db_->Execute(
+ "ALTER TABLE metas ADD COLUMN server_ordinal_in_parent BLOB"))
return false;
sql::Statement get_positions(db_->GetUniqueStatement(
@@ -1221,7 +1220,7 @@ bool DirectoryBackingStore::MigrateVersion80To81() {
"UPDATE metas SET server_ordinal_in_parent = ?"
"WHERE metahandle = ?"));
- while(get_positions.Step()) {
+ while (get_positions.Step()) {
int64 metahandle = get_positions.ColumnInt64(0);
int64 position = get_positions.ColumnInt64(1);
@@ -1229,7 +1228,7 @@ bool DirectoryBackingStore::MigrateVersion80To81() {
put_ordinals.BindBlob(0, ordinal.data(), ordinal.length());
put_ordinals.BindInt64(1, metahandle);
- if(!put_ordinals.Run())
+ if (!put_ordinals.Run())
return false;
put_ordinals.Reset(true);
}
@@ -1390,7 +1389,7 @@ bool DirectoryBackingStore::MigrateVersion85To86() {
// when we see updates for this item. That should ensure that commonly
// modified items will end up with the proper tag values eventually.
unique_bookmark_tag = syncable::GenerateSyncableBookmarkHash(
- std::string(), // cache_guid left intentionally blank.
+ std::string(), // cache_guid left intentionally blank.
id_string.substr(1));
}
diff --git a/sync/syncable/directory_unittest.cc b/sync/syncable/directory_unittest.cc
index a9d8058..c5eae75 100644
--- a/sync/syncable/directory_unittest.cc
+++ b/sync/syncable/directory_unittest.cc
@@ -700,7 +700,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnsynced) {
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnsyncedMetaHandles(&trans, &handles);
- ASSERT_TRUE(0 == handles.size());
+ ASSERT_EQ(0u, handles.size());
MutableEntry e1(&trans, CREATE, BOOKMARKS, trans.root_id(), "abba");
ASSERT_TRUE(e1.good());
@@ -720,7 +720,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnsynced) {
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnsyncedMetaHandles(&trans, &handles);
- ASSERT_TRUE(0 == handles.size());
+ ASSERT_EQ(0u, handles.size());
MutableEntry e3(&trans, GET_BY_HANDLE, handle1);
ASSERT_TRUE(e3.good());
@@ -730,7 +730,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnsynced) {
{
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnsyncedMetaHandles(&trans, &handles);
- ASSERT_TRUE(1 == handles.size());
+ ASSERT_EQ(1u, handles.size());
ASSERT_TRUE(handle1 == handles[0]);
MutableEntry e4(&trans, GET_BY_HANDLE, handle2);
@@ -741,7 +741,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnsynced) {
{
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnsyncedMetaHandles(&trans, &handles);
- ASSERT_TRUE(2 == handles.size());
+ ASSERT_EQ(2u, handles.size());
if (handle1 == handles[0]) {
ASSERT_TRUE(handle2 == handles[1]);
} else {
@@ -759,7 +759,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnsynced) {
{
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnsyncedMetaHandles(&trans, &handles);
- ASSERT_TRUE(1 == handles.size());
+ ASSERT_EQ(1u, handles.size());
ASSERT_TRUE(handle2 == handles[0]);
}
}
@@ -772,7 +772,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnappliedUpdates) {
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
- ASSERT_TRUE(0 == handles.size());
+ ASSERT_EQ(0u, handles.size());
MutableEntry e1(&trans, CREATE, BOOKMARKS, trans.root_id(), "abba");
ASSERT_TRUE(e1.good());
@@ -794,7 +794,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnappliedUpdates) {
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
- ASSERT_TRUE(0 == handles.size());
+ ASSERT_EQ(0u, handles.size());
MutableEntry e3(&trans, GET_BY_HANDLE, handle1);
ASSERT_TRUE(e3.good());
@@ -804,7 +804,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnappliedUpdates) {
{
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
- ASSERT_TRUE(1 == handles.size());
+ ASSERT_EQ(1u, handles.size());
ASSERT_TRUE(handle1 == handles[0]);
MutableEntry e4(&trans, GET_BY_HANDLE, handle2);
@@ -815,7 +815,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnappliedUpdates) {
{
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
- ASSERT_TRUE(2 == handles.size());
+ ASSERT_EQ(2u, handles.size());
if (handle1 == handles[0]) {
ASSERT_TRUE(handle2 == handles[1]);
} else {
@@ -831,7 +831,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnappliedUpdates) {
{
WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
dir()->GetUnappliedUpdateMetaHandles(&trans, all_types, &handles);
- ASSERT_TRUE(1 == handles.size());
+ ASSERT_EQ(1u, handles.size());
ASSERT_TRUE(handle2 == handles[0]);
}
}
@@ -1668,7 +1668,7 @@ class StressTransactionsDelegate : public base::PlatformThread::Delegate {
const int rand_action = rand() % 10;
if (rand_action < 4 && !path_name.empty()) {
ReadTransaction trans(FROM_HERE, dir_);
- CHECK(1 == CountEntriesWithName(&trans, trans.root_id(), path_name));
+ EXPECT_EQ(1, CountEntriesWithName(&trans, trans.root_id(), path_name));
base::PlatformThread::Sleep(
base::TimeDelta::FromMilliseconds(rand() % 10));
} else {
@@ -1677,7 +1677,7 @@ class StressTransactionsDelegate : public base::PlatformThread::Delegate {
path_name.assign(unique_name.begin(), unique_name.end());
WriteTransaction trans(FROM_HERE, UNITTEST, dir_);
MutableEntry e(&trans, CREATE, BOOKMARKS, trans.root_id(), path_name);
- CHECK(e.good());
+ EXPECT_TRUE(e.good());
base::PlatformThread::Sleep(
base::TimeDelta::FromMilliseconds(rand() % 20));
e.PutIsUnsynced(true);
@@ -2119,7 +2119,7 @@ TEST_F(SyncableDirectoryTest, InitialSyncEndedForType) {
// Create the root node.
ModelNeutralMutableEntry entry(&trans, syncable::CREATE_NEW_TYPE_ROOT,
PREFERENCES);
- DCHECK(entry.good());
+ ASSERT_TRUE(entry.good());
entry.PutServerIsDir(true);
entry.PutUniqueServerTag(ModelTypeToRootTag(PREFERENCES));
diff --git a/sync/syncable/entry.h b/sync/syncable/entry.h
index 47a7815..cf9b9af 100644
--- a/sync/syncable/entry.h
+++ b/sync/syncable/entry.h
@@ -5,6 +5,9 @@
#ifndef SYNC_SYNCABLE_ENTRY_H_
#define SYNC_SYNCABLE_ENTRY_H_
+#include <string>
+#include <vector>
+
#include "sync/base/sync_export.h"
#include "sync/syncable/entry_kernel.h"
@@ -216,7 +219,7 @@ class SYNC_EXPORT Entry {
}
bool GetSyncing() const;
- bool GetDirtySync() const ;
+ bool GetDirtySync() const;
ModelType GetServerModelType() const;
ModelType GetModelType() const;
diff --git a/sync/syncable/entry_kernel.cc b/sync/syncable/entry_kernel.cc
index 8fb611f..ec7575b 100644
--- a/sync/syncable/entry_kernel.cc
+++ b/sync/syncable/entry_kernel.cc
@@ -287,5 +287,5 @@ std::ostream& operator<<(std::ostream& os, const EntryKernel& entry_kernel) {
return os;
}
-} // namespace syncer
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/metahandle_set.h b/sync/syncable/metahandle_set.h
index 5b4e425..acb5c27 100644
--- a/sync/syncable/metahandle_set.h
+++ b/sync/syncable/metahandle_set.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_METAHANDLE_SET_
-#define SYNC_SYNCABLE_METAHANDLE_SET_
+#ifndef SYNC_SYNCABLE_METAHANDLE_SET_H_
+#define SYNC_SYNCABLE_METAHANDLE_SET_H_
#include <set>
@@ -17,4 +17,4 @@ typedef std::set<int64> MetahandleSet;
} // namespace syncable
} // namespace syncer
-#endif // SYNC_SYNCABLE_METAHANDLE_SET_
+#endif // SYNC_SYNCABLE_METAHANDLE_SET_H_
diff --git a/sync/syncable/model_neutral_mutable_entry.cc b/sync/syncable/model_neutral_mutable_entry.cc
index 1c75b64..46486f7 100644
--- a/sync/syncable/model_neutral_mutable_entry.cc
+++ b/sync/syncable/model_neutral_mutable_entry.cc
@@ -402,7 +402,7 @@ void ModelNeutralMutableEntry::PutBaseServerSpecifics(
void ModelNeutralMutableEntry::PutServerUniquePosition(
const UniquePosition& value) {
DCHECK(kernel_);
- if(!kernel_->ref(SERVER_UNIQUE_POSITION).Equals(value)) {
+ if (!kernel_->ref(SERVER_UNIQUE_POSITION).Equals(value)) {
base_write_transaction_->TrackChangesTo(kernel_);
// We should never overwrite a valid position with an invalid one.
DCHECK(value.IsValid());
diff --git a/sync/syncable/mutable_entry.cc b/sync/syncable/mutable_entry.cc
index 7c42b48..978bbe7 100644
--- a/sync/syncable/mutable_entry.cc
+++ b/sync/syncable/mutable_entry.cc
@@ -237,7 +237,7 @@ void MutableEntry::PutSpecifics(const sync_pb::EntitySpecifics& value) {
void MutableEntry::PutUniquePosition(const UniquePosition& value) {
DCHECK(kernel_);
- if(!kernel_->ref(UNIQUE_POSITION).Equals(value)) {
+ if (!kernel_->ref(UNIQUE_POSITION).Equals(value)) {
write_transaction()->TrackChangesTo(kernel_);
// We should never overwrite a valid position with an invalid one.
DCHECK(value.IsValid());
diff --git a/sync/syncable/nigori_handler.cc b/sync/syncable/nigori_handler.cc
index e193c893..fd8a9a3 100644
--- a/sync/syncable/nigori_handler.cc
+++ b/sync/syncable/nigori_handler.cc
@@ -10,5 +10,5 @@ namespace syncable {
NigoriHandler::NigoriHandler() {}
NigoriHandler::~NigoriHandler() {}
-} // namespace syncer
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/parent_child_index_unittest.cc b/sync/syncable/parent_child_index_unittest.cc
index 26ccb52..50aeca1 100644
--- a/sync/syncable/parent_child_index_unittest.cc
+++ b/sync/syncable/parent_child_index_unittest.cc
@@ -5,6 +5,7 @@
#include "sync/syncable/parent_child_index.h"
#include <list>
+#include <string>
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
@@ -176,10 +177,10 @@ TEST_F(ParentChildIndexTest, ChildInsertionAndIteration) {
EntryKernel* b4 = MakeBookmark(4, 4, false);
// Insert them out-of-order to test different cases.
- index_.Insert(b3); // Only child.
- index_.Insert(b4); // Right-most child.
- index_.Insert(b1); // Left-most child.
- index_.Insert(b2); // Between existing items.
+ index_.Insert(b3); // Only child.
+ index_.Insert(b4); // Right-most child.
+ index_.Insert(b1); // Left-most child.
+ index_.Insert(b2); // Between existing items.
// Double-check they've been added.
EXPECT_TRUE(index_.Contains(b1));
diff --git a/sync/syncable/scoped_kernel_lock.h b/sync/syncable/scoped_kernel_lock.h
index c684810..942faef 100644
--- a/sync/syncable/scoped_kernel_lock.h
+++ b/sync/syncable/scoped_kernel_lock.h
@@ -20,6 +20,8 @@ class ScopedKernelLock {
base::AutoLock scoped_lock_;
const Directory* const dir_;
+
+ private:
DISALLOW_COPY_AND_ASSIGN(ScopedKernelLock);
};
diff --git a/sync/syncable/scoped_parent_child_index_updater.cc b/sync/syncable/scoped_parent_child_index_updater.cc
index 0dc3e95..dc48edd 100644
--- a/sync/syncable/scoped_parent_child_index_updater.cc
+++ b/sync/syncable/scoped_parent_child_index_updater.cc
@@ -10,9 +10,10 @@ namespace syncer {
namespace syncable {
ScopedParentChildIndexUpdater::ScopedParentChildIndexUpdater(
- ScopedKernelLock& proof_of_lock,
+ const ScopedKernelLock& proof_of_lock,
EntryKernel* entry,
- ParentChildIndex* index) : entry_(entry), index_(index) {
+ ParentChildIndex* index)
+ : entry_(entry), index_(index) {
if (ParentChildIndex::ShouldInclude(entry_)) {
index_->Remove(entry_);
}
@@ -24,5 +25,5 @@ ScopedParentChildIndexUpdater::~ScopedParentChildIndexUpdater() {
}
}
-} // namespace syncer
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/scoped_parent_child_index_updater.h b/sync/syncable/scoped_parent_child_index_updater.h
index 89385feb..29bda16 100644
--- a/sync/syncable/scoped_parent_child_index_updater.h
+++ b/sync/syncable/scoped_parent_child_index_updater.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_PARENT_CHILD_INDEX_UPDATER_H_
-#define SYNC_SYNCABLE_PARENT_CHILD_INDEX_UPDATER_H_
+#ifndef SYNC_SYNCABLE_SCOPED_PARENT_CHILD_INDEX_UPDATER_H_
+#define SYNC_SYNCABLE_SCOPED_PARENT_CHILD_INDEX_UPDATER_H_
#include "base/basictypes.h"
#include "sync/base/sync_export.h"
@@ -19,7 +19,7 @@ struct EntryKernel;
// object goes out of scope.
class ScopedParentChildIndexUpdater {
public:
- ScopedParentChildIndexUpdater(ScopedKernelLock& proof_of_lock,
+ ScopedParentChildIndexUpdater(const ScopedKernelLock& proof_of_lock,
EntryKernel* entry,
ParentChildIndex* index);
~ScopedParentChildIndexUpdater();
@@ -31,7 +31,7 @@ class ScopedParentChildIndexUpdater {
DISALLOW_COPY_AND_ASSIGN(ScopedParentChildIndexUpdater);
};
-} // namespace syncer
} // namespace syncable
+} // namespace syncer
-#endif // SYNC_SYNCABLE_PARENT_CHILD_INDEX_UPDATER_H_
+#endif // SYNC_SYNCABLE_SCOPED_PARENT_CHILD_INDEX_UPDATER_H_
diff --git a/sync/syncable/syncable_base_transaction.h b/sync/syncable/syncable_base_transaction.h
index 58c7bfa..8921623 100644
--- a/sync/syncable/syncable_base_transaction.h
+++ b/sync/syncable/syncable_base_transaction.h
@@ -5,6 +5,8 @@
#ifndef SYNC_SYNCABLE_SYNCABLE_BASE_TRANSACTION_H_
#define SYNC_SYNCABLE_SYNCABLE_BASE_TRANSACTION_H_
+#include <string>
+
#include "base/location.h"
#include "sync/base/sync_export.h"
#include "sync/syncable/syncable_id.h"
diff --git a/sync/syncable/syncable_delete_journal.h b/sync/syncable/syncable_delete_journal.h
index b475850..bba5321 100644
--- a/sync/syncable/syncable_delete_journal.h
+++ b/sync/syncable/syncable_delete_journal.h
@@ -28,8 +28,6 @@ typedef std::set<const EntryKernel*, LessField<IdField, ID> > JournalIndex;
// method requires a non-null |trans| parameter.
class SYNC_EXPORT DeleteJournal {
public:
- FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest, ManageDeleteJournals);
-
// Initialize |delete_journals_| using |intitial_journal|, whose content is
// destroyed during initialization.
explicit DeleteJournal(JournalIndex* initial_journal);
@@ -81,6 +79,8 @@ class SYNC_EXPORT DeleteJournal {
static bool IsDeleteJournalEnabled(ModelType type);
private:
+ FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest, ManageDeleteJournals);
+
// Contains deleted entries that may not be persisted in native models. And
// in case of unrecoverable error, all purged entries are moved here for
// bookkeeping to prevent back-from-dead entries that are deleted elsewhere
diff --git a/sync/syncable/syncable_enum_conversions.cc b/sync/syncable/syncable_enum_conversions.cc
index fe8cd5d4..6ac1fdc 100644
--- a/sync/syncable/syncable_enum_conversions.cc
+++ b/sync/syncable/syncable_enum_conversions.cc
@@ -151,7 +151,7 @@ const char* GetUniquePositionFieldString(UniquePositionField position_field) {
ASSERT_ENUM_BOUNDS(SERVER_UNIQUE_POSITION, UNIQUE_POSITION,
UNIQUE_POSITION_FIELDS_BEGIN,
UNIQUE_POSITION_FIELDS_END - 1);
- switch(position_field) {
+ switch (position_field) {
ENUM_CASE(SERVER_UNIQUE_POSITION);
ENUM_CASE(UNIQUE_POSITION);
case UNIQUE_POSITION_FIELDS_END: break;
@@ -166,7 +166,7 @@ const char* GetAttachmentMetadataFieldString(
SERVER_ATTACHMENT_METADATA,
ATTACHMENT_METADATA_FIELDS_BEGIN,
ATTACHMENT_METADATA_FIELDS_END - 1);
- switch(attachment_metadata_field) {
+ switch (attachment_metadata_field) {
ENUM_CASE(ATTACHMENT_METADATA);
ENUM_CASE(SERVER_ATTACHMENT_METADATA);
case ATTACHMENT_METADATA_FIELDS_END: break;
diff --git a/sync/syncable/syncable_model_neutral_write_transaction.cc b/sync/syncable/syncable_model_neutral_write_transaction.cc
index 9aaf740..d7981d2 100644
--- a/sync/syncable/syncable_model_neutral_write_transaction.cc
+++ b/sync/syncable/syncable_model_neutral_write_transaction.cc
@@ -29,5 +29,5 @@ void ModelNeutralWriteTransaction::TrackChangesTo(const EntryKernel* entry) {
modified_handles_.insert(entry->ref(META_HANDLE));
}
-} // namespace syncer
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_read_transaction.h b/sync/syncable/syncable_read_transaction.h
index a13f92f..4ee325f 100644
--- a/sync/syncable/syncable_read_transaction.h
+++ b/sync/syncable/syncable_read_transaction.h
@@ -21,9 +21,11 @@ class SYNC_EXPORT ReadTransaction : public BaseTransaction {
~ReadTransaction() override;
protected: // Don't allow creation on heap, except by sync API wrapper.
- friend class syncer::ReadTransaction;
void* operator new(size_t size) { return (::operator new)(size); }
+ private:
+ friend class syncer::ReadTransaction;
+
DISALLOW_COPY_AND_ASSIGN(ReadTransaction);
};
diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc
index 6430aab..c4d5443 100644
--- a/sync/syncable/syncable_unittest.cc
+++ b/sync/syncable/syncable_unittest.cc
@@ -54,12 +54,10 @@ class TestBackingStore : public OnDiskDirectoryBackingStore {
bool SaveChanges(const Directory::SaveChangesSnapshot& snapshot) override;
- void StartFailingSaveChanges() {
- fail_save_changes_ = true;
- }
+ void StartFailingSaveChanges() { fail_save_changes_ = true; }
private:
- bool fail_save_changes_;
+ bool fail_save_changes_;
};
TestBackingStore::TestBackingStore(const std::string& dir_name,
@@ -71,7 +69,7 @@ TestBackingStore::TestBackingStore(const std::string& dir_name,
TestBackingStore::~TestBackingStore() { }
bool TestBackingStore::SaveChanges(
- const Directory::SaveChangesSnapshot& snapshot){
+ const Directory::SaveChangesSnapshot& snapshot) {
if (fail_save_changes_) {
return false;
} else {
@@ -84,7 +82,7 @@ class TestDirectory : public Directory {
public:
// A factory function used to work around some initialization order issues.
static TestDirectory* Create(
- Encryptor *encryptor,
+ Encryptor* encryptor,
const WeakHandle<UnrecoverableErrorHandler>& handler,
const std::string& dir_name,
const base::FilePath& backing_filepath);
@@ -104,7 +102,7 @@ class TestDirectory : public Directory {
};
TestDirectory* TestDirectory::Create(
- Encryptor *encryptor,
+ Encryptor* encryptor,
const WeakHandle<UnrecoverableErrorHandler>& handler,
const std::string& dir_name,
const base::FilePath& backing_filepath) {
@@ -193,7 +191,7 @@ class OnDiskSyncableDirectoryTest : public SyncableDirectoryTest {
test_directory_->StartFailingSaveChanges();
}
- TestDirectory *test_directory_; // mirrors scoped_ptr<Directory> dir_
+ TestDirectory* test_directory_; // mirrors scoped_ptr<Directory> dir_
base::ScopedTempDir temp_dir_;
base::FilePath file_path_;
};
diff --git a/sync/syncable/syncable_util_unittest.cc b/sync/syncable/syncable_util_unittest.cc
index 8f818f0..c94ead6 100644
--- a/sync/syncable/syncable_util_unittest.cc
+++ b/sync/syncable/syncable_util_unittest.cc
@@ -28,5 +28,5 @@ TEST(SyncableUtilTest, GenerateSyncableHash) {
}
} // namespace
-} // namespace syncer
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_write_transaction.cc b/sync/syncable/syncable_write_transaction.cc
index 6a5557f..1e1ac56 100644
--- a/sync/syncable/syncable_write_transaction.cc
+++ b/sync/syncable/syncable_write_transaction.cc
@@ -4,6 +4,8 @@
#include "sync/syncable/syncable_write_transaction.h"
+#include <string>
+
#include "sync/syncable/directory.h"
#include "sync/syncable/directory_change_delegate.h"
#include "sync/syncable/mutable_entry.h"
@@ -177,7 +179,7 @@ std::string WriterTagToString(WriterTag writer_tag) {
ENUM_CASE(HANDLE_SAVE_FAILURE);
ENUM_CASE(PURGE_ENTRIES);
ENUM_CASE(SYNCAPI);
- };
+ }
NOTREACHED();
return std::string();
}
diff --git a/sync/syncable/syncable_write_transaction.h b/sync/syncable/syncable_write_transaction.h
index 93942c7..f85b035 100644
--- a/sync/syncable/syncable_write_transaction.h
+++ b/sync/syncable/syncable_write_transaction.h
@@ -5,6 +5,8 @@
#ifndef SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_
#define SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_
+#include <vector>
+
#include "sync/base/sync_export.h"
#include "sync/syncable/entry_kernel.h"
#include "sync/syncable/syncable_base_write_transaction.h"
@@ -65,4 +67,4 @@ class SYNC_EXPORT WriteTransaction : public BaseWriteTransaction {
} // namespace syncable
} // namespace syncer
-#endif // SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_
+#endif // SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_
diff --git a/sync/syncable/write_transaction_info.h b/sync/syncable/write_transaction_info.h
index 823a66c..0b571d2 100644
--- a/sync/syncable/write_transaction_info.h
+++ b/sync/syncable/write_transaction_info.h
@@ -5,6 +5,8 @@
#ifndef SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_
#define SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_
+#include <string>
+
#include "sync/syncable/entry_kernel.h"
#include "sync/syncable/syncable_base_transaction.h"