diff options
author | skym <skym@chromium.org> | 2015-12-10 18:39:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-11 02:39:44 +0000 |
commit | 81977acc18a567185fcf76b434c8179d01f31685 (patch) | |
tree | 89895380e449e6afc4815773bf6cfa099f0461d8 /sync | |
parent | a7dd94484b64397611deaf2177f28dcb83a7903b (diff) | |
download | chromium_src-81977acc18a567185fcf76b434c8179d01f31685.zip chromium_src-81977acc18a567185fcf76b434c8179d01f31685.tar.gz chromium_src-81977acc18a567185fcf76b434c8179d01f31685.tar.bz2 |
[Sync] Fixing lint violations in src/sync/internal_api/*
BUG=567301
Review URL: https://codereview.chromium.org/1503263002
Cr-Commit-Position: refs/heads/master@{#364594}
Diffstat (limited to 'sync')
84 files changed, 213 insertions, 137 deletions
diff --git a/sync/internal_api/attachments/attachment_downloader.cc b/sync/internal_api/attachments/attachment_downloader.cc index 5b52eb0..c295e95c 100644 --- a/sync/internal_api/attachments/attachment_downloader.cc +++ b/sync/internal_api/attachments/attachment_downloader.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/attachments/attachment_downloader.h" +#include <string> + #include "sync/internal_api/public/attachments/attachment_downloader_impl.h" namespace syncer { diff --git a/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc b/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc index de6ca9a..6574cb1 100644 --- a/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc +++ b/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/attachments/attachment_downloader_impl.h" +#include <map> + #include "base/bind.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" @@ -106,7 +108,7 @@ class TokenServiceProvider : public OAuth2TokenServiceRequest::TokenServiceProvider, base::NonThreadSafe { public: - TokenServiceProvider(OAuth2TokenService* token_service); + explicit TokenServiceProvider(OAuth2TokenService* token_service); // OAuth2TokenService::TokenServiceProvider implementation. scoped_refptr<base::SingleThreadTaskRunner> GetTokenServiceTaskRunner() diff --git a/sync/internal_api/attachments/attachment_service_impl_unittest.cc b/sync/internal_api/attachments/attachment_service_impl_unittest.cc index 0ca4007..f5fbdc8 100644 --- a/sync/internal_api/attachments/attachment_service_impl_unittest.cc +++ b/sync/internal_api/attachments/attachment_service_impl_unittest.cc @@ -4,6 +4,11 @@ #include "sync/internal_api/public/attachments/attachment_service_impl.h" +#include <algorithm> +#include <map> +#include <utility> +#include <vector> + #include "base/bind.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" @@ -156,6 +161,7 @@ class MockAttachmentDownloader std::map<AttachmentId, DownloadCallback> download_requests; + private: DISALLOW_COPY_AND_ASSIGN(MockAttachmentDownloader); }; @@ -182,6 +188,7 @@ class MockAttachmentUploader std::map<AttachmentId, UploadCallback> upload_requests; + private: DISALLOW_COPY_AND_ASSIGN(MockAttachmentUploader); }; diff --git a/sync/internal_api/attachments/attachment_uploader_impl.cc b/sync/internal_api/attachments/attachment_uploader_impl.cc index 3566beb..d67a977 100644 --- a/sync/internal_api/attachments/attachment_uploader_impl.cc +++ b/sync/internal_api/attachments/attachment_uploader_impl.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" +#include <string> +#include <vector> + #include "base/base64.h" #include "base/base64url.h" #include "base/bind.h" diff --git a/sync/internal_api/attachments/attachment_uploader_impl_unittest.cc b/sync/internal_api/attachments/attachment_uploader_impl_unittest.cc index b4653a25..d8cf893 100644 --- a/sync/internal_api/attachments/attachment_uploader_impl_unittest.cc +++ b/sync/internal_api/attachments/attachment_uploader_impl_unittest.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" +#include <string> +#include <vector> + #include "base/bind.h" #include "base/callback.h" #include "base/memory/ref_counted.h" @@ -149,7 +152,7 @@ class TokenServiceProvider : public OAuth2TokenServiceRequest::TokenServiceProvider, base::NonThreadSafe { public: - TokenServiceProvider(OAuth2TokenService* token_service); + explicit TokenServiceProvider(OAuth2TokenService* token_service); // OAuth2TokenService::TokenServiceProvider implementation. scoped_refptr<base::SingleThreadTaskRunner> GetTokenServiceTaskRunner() diff --git a/sync/internal_api/attachments/fake_attachment_downloader_unittest.cc b/sync/internal_api/attachments/fake_attachment_downloader_unittest.cc index 762da44..63d491e 100644 --- a/sync/internal_api/attachments/fake_attachment_downloader_unittest.cc +++ b/sync/internal_api/attachments/fake_attachment_downloader_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/attachments/fake_attachment_downloader.h" +#include <vector> + #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" diff --git a/sync/internal_api/attachments/in_memory_attachment_store.cc b/sync/internal_api/attachments/in_memory_attachment_store.cc index 340daae..99f6030 100644 --- a/sync/internal_api/attachments/in_memory_attachment_store.cc +++ b/sync/internal_api/attachments/in_memory_attachment_store.cc @@ -121,7 +121,7 @@ void InMemoryAttachmentStore::ReadMetadataById( result_code = AttachmentStore::UNSPECIFIED_ERROR; continue; } - DCHECK(iter->second.components.size() > 0); + DCHECK_GT(iter->second.components.size(), 0u); if (iter->second.components.count(component) == 0) { result_code = AttachmentStore::UNSPECIFIED_ERROR; continue; @@ -141,7 +141,7 @@ void InMemoryAttachmentStore::ReadMetadata( for (AttachmentEntryMap::const_iterator iter = attachments_.begin(); iter != attachments_.end(); ++iter) { - DCHECK(iter->second.components.size() > 0); + DCHECK_GT(iter->second.components.size(), 0u); if (iter->second.components.count(component) > 0) { AppendMetadata(metadata_list.get(), iter->second.attachment); } diff --git a/sync/internal_api/attachments/on_disk_attachment_store.cc b/sync/internal_api/attachments/on_disk_attachment_store.cc index a297323..a9bab47 100644 --- a/sync/internal_api/attachments/on_disk_attachment_store.cc +++ b/sync/internal_api/attachments/on_disk_attachment_store.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/attachments/on_disk_attachment_store.h" +#include <string> + #include "base/bind.h" #include "base/callback.h" #include "base/location.h" @@ -334,7 +336,7 @@ void OnDiskAttachmentStore::ReadMetadata( result_code = AttachmentStore::UNSPECIFIED_ERROR; continue; } - DCHECK(record_metadata.component_size() > 0); + DCHECK_GT(record_metadata.component_size(), 0); if (AttachmentHasReferenceFromComponent(record_metadata, proto_component)) metadata_list->push_back(MakeAttachmentMetadata(id, record_metadata)); } @@ -496,7 +498,7 @@ bool OnDiskAttachmentStore::ReadSingleRecordMetadata( DVLOG(1) << "RecordMetadata::ParseFromString failed"; return false; } - DCHECK(record_metadata->component_size() > 0); + DCHECK_GT(record_metadata->component_size(), 0); return true; } diff --git a/sync/internal_api/attachments/on_disk_attachment_store_unittest.cc b/sync/internal_api/attachments/on_disk_attachment_store_unittest.cc index e145172..1f3ede6 100644 --- a/sync/internal_api/attachments/on_disk_attachment_store_unittest.cc +++ b/sync/internal_api/attachments/on_disk_attachment_store_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/attachments/on_disk_attachment_store.h" +#include <string> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" diff --git a/sync/internal_api/change_record.cc b/sync/internal_api/change_record.cc index d6c7d36..18fb825 100644 --- a/sync/internal_api/change_record.cc +++ b/sync/internal_api/change_record.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/change_record.h" +#include <string> + #include "base/strings/string_number_conversions.h" #include "base/values.h" #include "sync/internal_api/public/base_node.h" diff --git a/sync/internal_api/delete_journal.cc b/sync/internal_api/delete_journal.cc index edd10ae..5db0963 100644 --- a/sync/internal_api/delete_journal.cc +++ b/sync/internal_api/delete_journal.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/delete_journal.h" +#include <set> +#include <string> + #include "sync/internal_api/public/base_transaction.h" #include "sync/syncable/directory.h" #include "sync/syncable/syncable_base_transaction.h" diff --git a/sync/internal_api/events/commit_request_event.cc b/sync/internal_api/events/commit_request_event.cc index 0a1de1f..df55c7b 100644 --- a/sync/internal_api/events/commit_request_event.cc +++ b/sync/internal_api/events/commit_request_event.cc @@ -13,12 +13,12 @@ namespace syncer { CommitRequestEvent::CommitRequestEvent( base::Time timestamp, size_t num_items, - ModelTypeSet contributing_types_, + ModelTypeSet contributing_types, const sync_pb::ClientToServerMessage& request) - : timestamp_(timestamp), - num_items_(num_items), - contributing_types_(contributing_types_), - request_(request) {} + : timestamp_(timestamp), + num_items_(num_items), + contributing_types_(contributing_types), + request_(request) {} CommitRequestEvent::~CommitRequestEvent() {} diff --git a/sync/internal_api/events/normal_get_updates_request_event.cc b/sync/internal_api/events/normal_get_updates_request_event.cc index f5d6cd4..cbece53 100644 --- a/sync/internal_api/events/normal_get_updates_request_event.cc +++ b/sync/internal_api/events/normal_get_updates_request_event.cc @@ -98,4 +98,4 @@ NormalGetUpdatesRequestEvent::NormalGetUpdatesRequestEvent( is_retry_(is_retry), request_(request) {} -} // namespace +} // namespace syncer diff --git a/sync/internal_api/events/poll_get_updates_request_event.cc b/sync/internal_api/events/poll_get_updates_request_event.cc index c6eecb9..863c086 100644 --- a/sync/internal_api/events/poll_get_updates_request_event.cc +++ b/sync/internal_api/events/poll_get_updates_request_event.cc @@ -41,4 +41,4 @@ scoped_ptr<ProtocolEvent> PollGetUpdatesRequestEvent::Clone() const { request_)); } -} // namespace +} // namespace syncer diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc index 68d2762f..133a509 100644 --- a/sync/internal_api/http_bridge.cc +++ b/sync/internal_api/http_bridge.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/http_bridge.h" +#include <vector> + #include "base/message_loop/message_loop.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram_macros.h" diff --git a/sync/internal_api/http_bridge_unittest.cc b/sync/internal_api/http_bridge_unittest.cc index 7ac3769..13c9142 100644 --- a/sync/internal_api/http_bridge_unittest.cc +++ b/sync/internal_api/http_bridge_unittest.cc @@ -226,6 +226,7 @@ class ShuntedHttpBridge : public HttpBridge { test_->GetIOThreadLoop()->PostTask(FROM_HERE, base::Bind(&ShuntedHttpBridge::CallOnURLFetchComplete, this)); } + private: ~ShuntedHttpBridge() override {} @@ -619,11 +620,11 @@ TEST_F(MAYBE_SyncHttpBridgeTest, RequestContextGetterReleaseOrder) { // Create bridge factory and factory on sync thread and wait for the creation // to finish. - sync_thread.message_loop()->PostTask(FROM_HERE, - base::Bind(&HttpBridgeRunOnSyncThread, - base::Unretained(baseline_context_getter.get()), - &release_request_context_signal ,&factory, &bridge, - &signal_when_created, &wait_for_shutdown)); + sync_thread.message_loop()->PostTask( + FROM_HERE, base::Bind(&HttpBridgeRunOnSyncThread, + base::Unretained(baseline_context_getter.get()), + &release_request_context_signal, &factory, &bridge, + &signal_when_created, &wait_for_shutdown)); signal_when_created.Wait(); // Simulate sync shutdown by aborting bridge and shutting down factory on @@ -680,6 +681,6 @@ TEST_F(MAYBE_SyncHttpBridgeTest, EarlyAbortFactory) { // At this point, attempting to use the factory would trigger a crash. Both // this test and the real world code should make sure this never happens. -}; +} } // namespace syncer diff --git a/sync/internal_api/internal_components_factory_impl.cc b/sync/internal_api/internal_components_factory_impl.cc index dbc4243..4f2f32e 100644 --- a/sync/internal_api/internal_components_factory_impl.cc +++ b/sync/internal_api/internal_components_factory_impl.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/internal_components_factory_impl.h" +#include <string> +#include <vector> + #include "sync/engine/backoff_delay_provider.h" #include "sync/engine/syncer.h" #include "sync/engine/sync_scheduler_impl.h" diff --git a/sync/internal_api/js_sync_manager_observer_unittest.cc b/sync/internal_api/js_sync_manager_observer_unittest.cc index 3c65e29..ec5c4a3 100644 --- a/sync/internal_api/js_sync_manager_observer_unittest.cc +++ b/sync/internal_api/js_sync_manager_observer_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/js_sync_manager_observer.h" +#include <vector> + #include "base/basictypes.h" #include "base/location.h" #include "base/run_loop.h" diff --git a/sync/internal_api/protocol_event_buffer_unittest.cc b/sync/internal_api/protocol_event_buffer_unittest.cc index b197ec0..7aa924a 100644 --- a/sync/internal_api/protocol_event_buffer_unittest.cc +++ b/sync/internal_api/protocol_event_buffer_unittest.cc @@ -70,7 +70,6 @@ TEST_F(ProtocolEventBufferTest, AddThenOverflowThenReturnEvents) { EXPECT_TRUE( HasId(*(buffered_events[i-1]), static_cast<int64>(i))); } - } diff --git a/sync/internal_api/public/attachments/attachment_downloader.h b/sync/internal_api/public/attachments/attachment_downloader.h index 1b2e922..5facce2 100644 --- a/sync/internal_api/public/attachments/attachment_downloader.h +++ b/sync/internal_api/public/attachments/attachment_downloader.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ +#include <string> + #include "base/callback.h" #include "base/memory/scoped_ptr.h" #include "google_apis/gaia/oauth2_token_service_request.h" diff --git a/sync/internal_api/public/attachments/attachment_service_proxy.h b/sync/internal_api/public/attachments/attachment_service_proxy.h index c62a206b..9953b8d 100644 --- a/sync/internal_api/public/attachments/attachment_service_proxy.h +++ b/sync/internal_api/public/attachments/attachment_service_proxy.h @@ -72,7 +72,7 @@ class SYNC_EXPORT AttachmentServiceProxy : public AttachmentService { public base::RefCountedThreadSafe<Core> { public: // Construct an AttachmentServiceProxyCore that forwards calls to |wrapped|. - Core(const base::WeakPtr<syncer::AttachmentService>& wrapped); + explicit Core(const base::WeakPtr<syncer::AttachmentService>& wrapped); // AttachmentService implementation. void GetOrDownloadAttachments( diff --git a/sync/internal_api/public/attachments/attachment_uploader_impl.h b/sync/internal_api/public/attachments/attachment_uploader_impl.h index 2a41499..bada41e 100644 --- a/sync/internal_api/public/attachments/attachment_uploader_impl.h +++ b/sync/internal_api/public/attachments/attachment_uploader_impl.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ +#include <string> + #include "base/containers/scoped_ptr_hash_map.h" #include "base/threading/non_thread_safe.h" #include "google_apis/gaia/oauth2_token_service_request.h" diff --git a/sync/internal_api/public/attachments/in_memory_attachment_store.h b/sync/internal_api/public/attachments/in_memory_attachment_store.h index d0c7643..5f74d8c 100644 --- a/sync/internal_api/public/attachments/in_memory_attachment_store.h +++ b/sync/internal_api/public/attachments/in_memory_attachment_store.h @@ -5,6 +5,9 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_ +#include <map> +#include <set> + #include "base/memory/ref_counted.h" #include "base/threading/non_thread_safe.h" #include "sync/api/attachments/attachment.h" diff --git a/sync/internal_api/public/attachments/on_disk_attachment_store.h b/sync/internal_api/public/attachments/on_disk_attachment_store.h index 77159f8..0906f50 100644 --- a/sync/internal_api/public/attachments/on_disk_attachment_store.h +++ b/sync/internal_api/public/attachments/on_disk_attachment_store.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_ +#include <string> + #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/threading/non_thread_safe.h" diff --git a/sync/internal_api/public/base/attachment_id_proto.cc b/sync/internal_api/public/base/attachment_id_proto.cc index b457fc6..7d9cc59 100644 --- a/sync/internal_api/public/base/attachment_id_proto.cc +++ b/sync/internal_api/public/base/attachment_id_proto.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/base/attachment_id_proto.h" +#include <string> + #include "base/guid.h" #include "base/logging.h" #include "base/strings/string_util.h" diff --git a/sync/internal_api/public/base/cancelation_signal_unittest.cc b/sync/internal_api/public/base/cancelation_signal_unittest.cc index 244c925..320fe95 100644 --- a/sync/internal_api/public/base/cancelation_signal_unittest.cc +++ b/sync/internal_api/public/base/cancelation_signal_unittest.cc @@ -17,7 +17,7 @@ namespace syncer { class BlockingTask : public CancelationObserver { public: - BlockingTask(CancelationSignal* cancel_signal); + explicit BlockingTask(CancelationSignal* cancel_signal); ~BlockingTask() override; // Starts the |exec_thread_| and uses it to execute DoRun(). diff --git a/sync/internal_api/public/base/invalidation_interface.h b/sync/internal_api/public/base/invalidation_interface.h index d7dbbe8..2efddd6 100644 --- a/sync/internal_api/public/base/invalidation_interface.h +++ b/sync/internal_api/public/base/invalidation_interface.h @@ -52,4 +52,4 @@ class SYNC_EXPORT InvalidationInterface { } // namespace syncer -#endif +#endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_INTERFACE_H_ diff --git a/sync/internal_api/public/base/model_type_test_util.h b/sync/internal_api/public/base/model_type_test_util.h index cd347cb..f051462 100644 --- a/sync/internal_api/public/base/model_type_test_util.h +++ b/sync/internal_api/public/base/model_type_test_util.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_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_TEST_UTIL_H_ -#define SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_TEST_UTIL_H_ +#ifndef SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_TEST_UTIL_H_ +#define SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_TEST_UTIL_H_ #include <ostream> @@ -22,4 +22,4 @@ void PrintTo(ModelTypeSet model_types, ::std::ostream* os); } // namespace syncer -#endif // SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_TEST_UTIL_H_ +#endif // SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_TEST_UTIL_H_ diff --git a/sync/internal_api/public/base/node_ordinal.cc b/sync/internal_api/public/base/node_ordinal.cc index 1b5c42c..446486f 100644 --- a/sync/internal_api/public/base/node_ordinal.cc +++ b/sync/internal_api/public/base/node_ordinal.cc @@ -5,6 +5,7 @@ #include "sync/internal_api/public/base/node_ordinal.h" #include <algorithm> +#include <string> namespace syncer { diff --git a/sync/internal_api/public/base/node_ordinal_unittest.cc b/sync/internal_api/public/base/node_ordinal_unittest.cc index 21bceb4..05961d3 100644 --- a/sync/internal_api/public/base/node_ordinal_unittest.cc +++ b/sync/internal_api/public/base/node_ordinal_unittest.cc @@ -8,7 +8,9 @@ #include <algorithm> #include <cstddef> +#include <functional> #include <limits> +#include <vector> #include "testing/gtest/include/gtest/gtest.h" @@ -100,7 +102,7 @@ TEST(NodeOrdinalTest, PositionToOrdinalToPosition) { template <typename T, typename LessThan = std::less<T> > class IndexedLessThan { public: - IndexedLessThan(const T* values) : values_(values) {} + explicit IndexedLessThan(const T* values) : values_(values) {} bool operator()(int i1, int i2) { return less_than_(values_[i1], values_[i2]); diff --git a/sync/internal_api/public/base/ordinal_unittest.cc b/sync/internal_api/public/base/ordinal_unittest.cc index f4296cc..02d7732 100644 --- a/sync/internal_api/public/base/ordinal_unittest.cc +++ b/sync/internal_api/public/base/ordinal_unittest.cc @@ -349,7 +349,7 @@ TEST(Ordinal, EqualsFn) { EXPECT_FALSE(equals(ordinal1, ordinal2)); EXPECT_FALSE(equals(ordinal2, ordinal1)); - EXPECT_TRUE(equals(ordinal2,ordinal2)); + EXPECT_TRUE(equals(ordinal2, ordinal2)); } // Create some Ordinals and shuffle them. Sorting them using diff --git a/sync/internal_api/public/base/progress_marker_map.cc b/sync/internal_api/public/base/progress_marker_map.cc index ea1f177..f86b194 100644 --- a/sync/internal_api/public/base/progress_marker_map.cc +++ b/sync/internal_api/public/base/progress_marker_map.cc @@ -23,4 +23,4 @@ scoped_ptr<base::DictionaryValue> ProgressMarkerMapToValue( return value.Pass(); } -} // namespace syncer +} // namespace syncer diff --git a/sync/internal_api/public/base/unique_position.cc b/sync/internal_api/public/base/unique_position.cc index 30d40e3..5576215 100644 --- a/sync/internal_api/public/base/unique_position.cc +++ b/sync/internal_api/public/base/unique_position.cc @@ -4,6 +4,7 @@ #include "sync/internal_api/public/base/unique_position.h" +#include <algorithm> #include <limits> #include "base/logging.h" @@ -87,7 +88,7 @@ UniquePosition UniquePosition::FromProto(const sync_pb::UniquePosition& proto) { // static. UniquePosition UniquePosition::FromInt64(int64_t x, const std::string& suffix) { uint64_t y = static_cast<uint64_t>(x); - y ^= 0x8000000000000000ULL; // Make it non-negative. + y ^= 0x8000000000000000ULL; // Make it non-negative. std::string bytes(8, 0); for (int i = 7; i >= 0; --i) { bytes[i] = static_cast<uint8_t>(y); diff --git a/sync/internal_api/public/base/unique_position_unittest.cc b/sync/internal_api/public/base/unique_position_unittest.cc index 698dd45..6b3fb8c 100644 --- a/sync/internal_api/public/base/unique_position_unittest.cc +++ b/sync/internal_api/public/base/unique_position_unittest.cc @@ -7,7 +7,9 @@ #include <stdint.h> #include <algorithm> +#include <functional> #include <string> +#include <vector> #include "base/base64.h" #include "base/basictypes.h" @@ -221,7 +223,6 @@ TEST_F(RelativePositioningTest, SortPositions) { << positions[i].ToDebugString() << " != " << kSortedPositionArray[i].ToDebugString(); } - } // Some more exercise for the comparison function. @@ -580,7 +581,7 @@ TEST_F(PositionFromIntTest, RoundTripConversion) { template <typename T, typename LessThan = std::less<T> > class IndexedLessThan { public: - IndexedLessThan(const T* values) : values_(values) {} + explicit IndexedLessThan(const T* values) : values_(values) {} bool operator()(int i1, int i2) { return less_than_(values_[i1], values_[i2]); @@ -613,22 +614,26 @@ TEST_F(PositionFromIntTest, ConsistentOrdering) { class CompressedPositionTest : public UniquePositionTest { public: CompressedPositionTest() { - positions_.push_back( - MakePosition( // Prefix starts with 256 0x00s - std::string("\x00\x00\x00\x00\xFF\xFF\xFE\xFF" "\x01", 9), - MakeSuffix('\x04'))); - positions_.push_back( - MakePosition( // Prefix starts with four 0x00s - std::string("\x00\x00\x00\x00\xFF\xFF\xFF\xFB" "\x01", 9), - MakeSuffix('\x03'))); - positions_.push_back( - MakePosition( // Prefix starts with four 0xFFs - std::string("\xFF\xFF\xFF\xFF\x00\x00\x00\x04" "\x01", 9), - MakeSuffix('\x01'))); - positions_.push_back( - MakePosition( // Prefix starts with 256 0xFFs - std::string("\xFF\xFF\xFF\xFF\x00\x00\x01\x00" "\x01", 9), - MakeSuffix('\x02'))); + positions_.push_back(MakePosition( // Prefix starts with 256 0x00s + std::string("\x00\x00\x00\x00\xFF\xFF\xFE\xFF" + "\x01", + 9), + MakeSuffix('\x04'))); + positions_.push_back(MakePosition( // Prefix starts with four 0x00s + std::string("\x00\x00\x00\x00\xFF\xFF\xFF\xFB" + "\x01", + 9), + MakeSuffix('\x03'))); + positions_.push_back(MakePosition( // Prefix starts with four 0xFFs + std::string("\xFF\xFF\xFF\xFF\x00\x00\x00\x04" + "\x01", + 9), + MakeSuffix('\x01'))); + positions_.push_back(MakePosition( // Prefix starts with 256 0xFFs + std::string("\xFF\xFF\xFF\xFF\x00\x00\x01\x00" + "\x01", + 9), + MakeSuffix('\x02'))); } private: diff --git a/sync/internal_api/public/base_node.h b/sync/internal_api/public/base_node.h index 93ede5b..9f29ffd 100644 --- a/sync/internal_api/public/base_node.h +++ b/sync/internal_api/public/base_node.h @@ -37,7 +37,7 @@ class PreferenceSpecifics; class PasswordSpecificsData; class ThemeSpecifics; class TypedUrlSpecifics; -} +} // namespace sync_pb namespace syncer { diff --git a/sync/internal_api/public/change_record_unittest.cc b/sync/internal_api/public/change_record_unittest.cc index f12974e..b68831a 100644 --- a/sync/internal_api/public/change_record_unittest.cc +++ b/sync/internal_api/public/change_record_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/change_record.h" +#include <string> + #include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/test/values_test_util.h" diff --git a/sync/internal_api/public/delete_journal.h b/sync/internal_api/public/delete_journal.h index ecf84fe..f6d43ca 100644 --- a/sync/internal_api/public/delete_journal.h +++ b/sync/internal_api/public/delete_journal.h @@ -5,6 +5,7 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ #define SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ +#include <set> #include <vector> #include "sync/base/sync_export.h" diff --git a/sync/internal_api/public/engine/sync_status.cc b/sync/internal_api/public/engine/sync_status.cc index 6ac894e..bd01406 100644 --- a/sync/internal_api/public/engine/sync_status.cc +++ b/sync/internal_api/public/engine/sync_status.cc @@ -28,8 +28,7 @@ SyncStatus::SyncStatus() has_keystore_key(false), passphrase_type(IMPLICIT_PASSPHRASE), num_entries_by_type(MODEL_TYPE_COUNT, 0), - num_to_delete_entries_by_type(MODEL_TYPE_COUNT, 0){ -} + num_to_delete_entries_by_type(MODEL_TYPE_COUNT, 0) {} SyncStatus::~SyncStatus() { } diff --git a/sync/internal_api/public/engine/sync_status.h b/sync/internal_api/public/engine/sync_status.h index 1c284ce..60bb961 100644 --- a/sync/internal_api/public/engine/sync_status.h +++ b/sync/internal_api/public/engine/sync_status.h @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SYNC_INTERNAL_API_PUBLIC_ENGINE_STATUS_SUMMARY_H_ -#define SYNC_INTERNAL_API_PUBLIC_ENGINE_STATUS_SUMMARY_H_ +#ifndef SYNC_INTERNAL_API_PUBLIC_ENGINE_SYNC_STATUS_H_ +#define SYNC_INTERNAL_API_PUBLIC_ENGINE_SYNC_STATUS_H_ #include <string> +#include <vector> #include "base/time/time.h" #include "sync/base/sync_export.h" @@ -95,4 +96,4 @@ struct SYNC_EXPORT SyncStatus { } // namespace syncer -#endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_STATUS_SUMMARY_H_ +#endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_SYNC_STATUS_H_ diff --git a/sync/internal_api/public/events/protocol_event.h b/sync/internal_api/public/events/protocol_event.h index fc69e00..6859df3 100644 --- a/sync/internal_api/public/events/protocol_event.h +++ b/sync/internal_api/public/events/protocol_event.h @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SYNC_INTERNAL_API_PUBLIC_EVENTS_PROTOCOL_EVENT_H -#define SYNC_INTERNAL_API_PUBLIC_EVENTS_PROTOCOL_EVENT_H +#ifndef SYNC_INTERNAL_API_PUBLIC_EVENTS_PROTOCOL_EVENT_H_ +#define SYNC_INTERNAL_API_PUBLIC_EVENTS_PROTOCOL_EVENT_H_ + +#include <string> #include "base/memory/scoped_ptr.h" #include "base/time/time.h" @@ -56,4 +58,4 @@ class SYNC_EXPORT ProtocolEvent { } // namespace syncer -#endif // SYNC_INTERNAL_API_PUBLIC_EVENTS_PROTOCOL_EVENT_H +#endif // SYNC_INTERNAL_API_PUBLIC_EVENTS_PROTOCOL_EVENT_H_ diff --git a/sync/internal_api/public/http_bridge_network_resources.h b/sync/internal_api/public/http_bridge_network_resources.h index bd97da1..eb322cb 100644 --- a/sync/internal_api/public/http_bridge_network_resources.h +++ b/sync/internal_api/public/http_bridge_network_resources.h @@ -20,15 +20,15 @@ class CancelationSignal; class HttpPostProviderFactory; class SYNC_EXPORT HttpBridgeNetworkResources : public NetworkResources { - public: - ~HttpBridgeNetworkResources() override; - - // NetworkResources - scoped_ptr<HttpPostProviderFactory> GetHttpPostProviderFactory( - const scoped_refptr<net::URLRequestContextGetter>& - baseline_context_getter, - const NetworkTimeUpdateCallback& network_time_update_callback, - CancelationSignal* cancelation_signal) override; + public: + ~HttpBridgeNetworkResources() override; + + // NetworkResources + scoped_ptr<HttpPostProviderFactory> GetHttpPostProviderFactory( + const scoped_refptr<net::URLRequestContextGetter>& + baseline_context_getter, + const NetworkTimeUpdateCallback& network_time_update_callback, + CancelationSignal* cancelation_signal) override; }; } // namespace syncer diff --git a/sync/internal_api/public/internal_components_factory_impl.h b/sync/internal_api/public/internal_components_factory_impl.h index e29fa85f..fec1da6 100644 --- a/sync/internal_api/public/internal_components_factory_impl.h +++ b/sync/internal_api/public/internal_components_factory_impl.h @@ -8,6 +8,9 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_INTERNAL_COMPONENTS_FACTORY_IMPL_H_ #define SYNC_INTERNAL_API_PUBLIC_INTERNAL_COMPONENTS_FACTORY_IMPL_H_ +#include <string> +#include <vector> + #include "sync/base/sync_export.h" #include "sync/internal_api/public/internal_components_factory.h" @@ -16,7 +19,7 @@ namespace syncer { class SYNC_EXPORT InternalComponentsFactoryImpl : public InternalComponentsFactory { public: - InternalComponentsFactoryImpl(const Switches& switches); + explicit InternalComponentsFactoryImpl(const Switches& switches); ~InternalComponentsFactoryImpl() override; scoped_ptr<SyncScheduler> BuildScheduler( diff --git a/sync/internal_api/public/model_type_processor.cc b/sync/internal_api/public/model_type_processor.cc index 47c3ba9..d891f53 100644 --- a/sync/internal_api/public/model_type_processor.cc +++ b/sync/internal_api/public/model_type_processor.cc @@ -10,4 +10,4 @@ ModelTypeProcessor::ModelTypeProcessor() {} ModelTypeProcessor::~ModelTypeProcessor() {} -} // namespace syncer +} // namespace syncer_v2 diff --git a/sync/internal_api/public/network_resources.h b/sync/internal_api/public/network_resources.h index 575b0b8..e910574 100644 --- a/sync/internal_api/public/network_resources.h +++ b/sync/internal_api/public/network_resources.h @@ -11,7 +11,7 @@ namespace net { class URLRequestContextGetter; -} // namespace net +} // namespace net namespace syncer { diff --git a/sync/internal_api/public/non_blocking_sync_common.cc b/sync/internal_api/public/non_blocking_sync_common.cc index 3ce8aa2..f76895c 100644 --- a/sync/internal_api/public/non_blocking_sync_common.cc +++ b/sync/internal_api/public/non_blocking_sync_common.cc @@ -22,4 +22,4 @@ UpdateResponseData::UpdateResponseData() {} UpdateResponseData::~UpdateResponseData() {} -} // namespace syncer +} // namespace syncer_v2 diff --git a/sync/internal_api/public/read_transaction.h b/sync/internal_api/public/read_transaction.h index bdb92cb..e79669b 100644 --- a/sync/internal_api/public/read_transaction.h +++ b/sync/internal_api/public/read_transaction.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_READ_TRANSACTION_H_ #define SYNC_INTERNAL_API_PUBLIC_READ_TRANSACTION_H_ +#include <string> + #include "base/compiler_specific.h" #include "sync/api/attachments/attachment_id.h" #include "sync/base/sync_export.h" diff --git a/sync/internal_api/public/sessions/model_neutral_state.h b/sync/internal_api/public/sessions/model_neutral_state.h index 8d97f89..870f79e 100644 --- a/sync/internal_api/public/sessions/model_neutral_state.h +++ b/sync/internal_api/public/sessions/model_neutral_state.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_SESSIONS_MODEL_NEUTRAL_STATE_H -#define SYNC_SESSIONS_MODEL_NEUTRAL_STATE_H +#ifndef SYNC_INTERNAL_API_PUBLIC_SESSIONS_MODEL_NEUTRAL_STATE_H_ +#define SYNC_INTERNAL_API_PUBLIC_SESSIONS_MODEL_NEUTRAL_STATE_H_ #include "base/basictypes.h" #include "sync/base/sync_export.h" @@ -60,4 +60,4 @@ bool HasSyncerError(const ModelNeutralState& state); } // namespace sessions } // namespace syncer -#endif // SYNC_SESSIONS_MODEL_NEUTRAL_STATE_H_ +#endif // SYNC_INTERNAL_API_PUBLIC_SESSIONS_MODEL_NEUTRAL_STATE_H_ diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.h b/sync/internal_api/public/sessions/sync_session_snapshot.h index c47b3c6..335700b 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.h +++ b/sync/internal_api/public/sessions/sync_session_snapshot.h @@ -6,6 +6,7 @@ #define SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ #include <string> +#include <vector> #include "base/basictypes.h" #include "base/time/time.h" diff --git a/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc b/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc index 475a9c9..ce6a92a 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc +++ b/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/sessions/sync_session_snapshot.h" +#include <vector> + #include "base/memory/scoped_ptr.h" #include "base/test/values_test_util.h" #include "base/values.h" @@ -42,17 +44,11 @@ TEST_F(SyncSessionSnapshotTest, SyncSessionSnapshotToValue) { const int kNumHierarchyConflicts = 1055; const int kNumServerConflicts = 1057; - SyncSessionSnapshot snapshot(model_neutral, - download_progress_markers, - kIsSilenced, - kNumEncryptionConflicts, - kNumHierarchyConflicts, - kNumServerConflicts, - false, - 0, - base::Time::Now(), - base::Time::Now(), - std::vector<int>(MODEL_TYPE_COUNT,0), + SyncSessionSnapshot snapshot(model_neutral, download_progress_markers, + kIsSilenced, kNumEncryptionConflicts, + kNumHierarchyConflicts, kNumServerConflicts, + false, 0, base::Time::Now(), base::Time::Now(), + std::vector<int>(MODEL_TYPE_COUNT, 0), std::vector<int>(MODEL_TYPE_COUNT, 0), sync_pb::GetUpdatesCallerInfo::UNKNOWN); scoped_ptr<base::DictionaryValue> value(snapshot.ToValue()); diff --git a/sync/internal_api/public/sync_auth_provider.h b/sync/internal_api/public/sync_auth_provider.h index 77980ba..4c62b12 100644 --- a/sync/internal_api/public/sync_auth_provider.h +++ b/sync/internal_api/public/sync_auth_provider.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_AUTH_PROVIDER_H_ #define SYNC_INTERNAL_API_PUBLIC_SYNC_AUTH_PROVIDER_H_ +#include <string> + #include "base/callback.h" class GoogleServiceAuthError; diff --git a/sync/internal_api/public/sync_manager_factory.h b/sync/internal_api/public/sync_manager_factory.h index e38afb1..5a5dc63 100644 --- a/sync/internal_api/public/sync_manager_factory.h +++ b/sync/internal_api/public/sync_manager_factory.h @@ -23,7 +23,7 @@ class SYNC_EXPORT SyncManagerFactory { ROLLBACK, // Rollback sync manager }; - SyncManagerFactory(MANAGER_TYPE type); + explicit SyncManagerFactory(MANAGER_TYPE type); virtual ~SyncManagerFactory(); virtual scoped_ptr<SyncManager> CreateSyncManager(const std::string& name); diff --git a/sync/internal_api/public/test/fake_model_type_service.h b/sync/internal_api/public/test/fake_model_type_service.h index b64ed5d..9361483 100644 --- a/sync/internal_api/public/test/fake_model_type_service.h +++ b/sync/internal_api/public/test/fake_model_type_service.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_MODEL_TYPE_SERVICE_H_ #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_MODEL_TYPE_SERVICE_H_ +#include <string> + #include "sync/api/data_batch.h" #include "sync/api/metadata_batch.h" #include "sync/api/metadata_change_list.h" diff --git a/sync/internal_api/public/test/null_sync_context_proxy.h b/sync/internal_api/public/test/null_sync_context_proxy.h index b41d963a..aae38e9 100644 --- a/sync/internal_api/public/test/null_sync_context_proxy.h +++ b/sync/internal_api/public/test/null_sync_context_proxy.h @@ -24,6 +24,6 @@ class NullSyncContextProxy : public SyncContextProxy { scoped_ptr<SyncContextProxy> Clone() const override; }; -} // namespace syncer +} // namespace syncer_v2 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_NULL_SYNC_CONTEXT_PROXY_H_ diff --git a/sync/internal_api/public/test/sync_manager_factory_for_profile_sync_test.h b/sync/internal_api/public/test/sync_manager_factory_for_profile_sync_test.h index 8eb053f..613a848 100644 --- a/sync/internal_api/public/test/sync_manager_factory_for_profile_sync_test.h +++ b/sync/internal_api/public/test/sync_manager_factory_for_profile_sync_test.h @@ -15,7 +15,7 @@ namespace syncer { class SyncManagerFactoryForProfileSyncTest : public syncer::SyncManagerFactory { public: - SyncManagerFactoryForProfileSyncTest(base::Closure init_callback); + explicit SyncManagerFactoryForProfileSyncTest(base::Closure init_callback); ~SyncManagerFactoryForProfileSyncTest() override; scoped_ptr<syncer::SyncManager> CreateSyncManager( const std::string& name) override; diff --git a/sync/internal_api/public/test/test_entry_factory.h b/sync/internal_api/public/test/test_entry_factory.h index 97ff25e..138338b 100644 --- a/sync/internal_api/public/test/test_entry_factory.h +++ b/sync/internal_api/public/test/test_entry_factory.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_TEST_TEST_ENTRY_FACTORY_H_ -#define SYNC_TEST_TEST_ENTRY_FACTORY_H_ +#ifndef SYNC_INTERNAL_API_PUBLIC_TEST_TEST_ENTRY_FACTORY_H_ +#define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_ENTRY_FACTORY_H_ #include <string> @@ -130,4 +130,4 @@ class TestEntryFactory { } // namespace syncer -#endif // SYNC_TEST_TEST_ENTRY_FACTORY_H_ +#endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_ENTRY_FACTORY_H_ diff --git a/sync/internal_api/public/test/test_internal_components_factory.h b/sync/internal_api/public/test/test_internal_components_factory.h index c8f6148..f4de596 100644 --- a/sync/internal_api/public/test/test_internal_components_factory.h +++ b/sync/internal_api/public/test/test_internal_components_factory.h @@ -5,6 +5,9 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ #define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ +#include <string> +#include <vector> + #include "sync/internal_api/public/internal_components_factory.h" namespace syncer { diff --git a/sync/internal_api/public/test/test_user_share.h b/sync/internal_api/public/test/test_user_share.h index 2823fed..0e6ed2f 100644 --- a/sync/internal_api/public/test/test_user_share.h +++ b/sync/internal_api/public/test/test_user_share.h @@ -40,7 +40,7 @@ class SyncEncryptionHandler; class TestDirectorySetterUpper; namespace syncable { - class TestTransactionObserver; +class TestTransactionObserver; } class TestUserShare { diff --git a/sync/internal_api/public/util/experiments.h b/sync/internal_api/public/util/experiments.h index 16fa149..f105723 100644 --- a/sync/internal_api/public/util/experiments.h +++ b/sync/internal_api/public/util/experiments.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_UTIL_EXPERIMENTS_ -#define SYNC_UTIL_EXPERIMENTS_ +#ifndef SYNC_INTERNAL_API_PUBLIC_UTIL_EXPERIMENTS_H_ +#define SYNC_INTERNAL_API_PUBLIC_UTIL_EXPERIMENTS_H_ #include <string> @@ -51,4 +51,4 @@ struct Experiments { } // namespace syncer -#endif // SYNC_UTIL_EXPERIMENTS_ +#endif // SYNC_INTERNAL_API_PUBLIC_UTIL_EXPERIMENTS_H_ diff --git a/sync/internal_api/public/util/immutable.h b/sync/internal_api/public/util/immutable.h index 683a5e6..23ac696 100644 --- a/sync/internal_api/public/util/immutable.h +++ b/sync/internal_api/public/util/immutable.h @@ -61,8 +61,8 @@ // with forward-declared types. See comments on traits below for // details. -#ifndef SYNC_UTIL_IMMUTABLE_H_ -#define SYNC_UTIL_IMMUTABLE_H_ +#ifndef SYNC_INTERNAL_API_PUBLIC_UTIL_IMMUTABLE_H_ +#define SYNC_INTERNAL_API_PUBLIC_UTIL_IMMUTABLE_H_ // For std::swap(). #include <algorithm> @@ -257,4 +257,4 @@ Immutable<T> MakeImmutable(T* t) { } // namespace syncer -#endif // SYNC_UTIL_IMMUTABLE_H_ +#endif // SYNC_INTERNAL_API_PUBLIC_UTIL_IMMUTABLE_H_ diff --git a/sync/internal_api/public/util/immutable_unittest.cc b/sync/internal_api/public/util/immutable_unittest.cc index 247325f..954a08f 100644 --- a/sync/internal_api/public/util/immutable_unittest.cc +++ b/sync/internal_api/public/util/immutable_unittest.cc @@ -113,7 +113,7 @@ void swap(syncer::SpecializationToken& t1, t1.Swap(&t2); } -} // namespace +} // namespace std namespace syncer { namespace { diff --git a/sync/internal_api/public/util/sync_db_util.h b/sync/internal_api/public/util/sync_db_util.h index 3784a10..1deaae6 100644 --- a/sync/internal_api/public/util/sync_db_util.h +++ b/sync/internal_api/public/util/sync_db_util.h @@ -25,6 +25,6 @@ SYNC_EXPORT void CheckSyncDbLastModifiedTime( scoped_refptr<base::SingleThreadTaskRunner> callback_runner, base::Callback<void(base::Time)> callback); -} // namesapce syncer +} // namespace syncer #endif // SYNC_INTERNAL_API_PUBLIC_UTIL_SYNC_DB_UTIL_H_ diff --git a/sync/internal_api/public/util/sync_string_conversions.h b/sync/internal_api/public/util/sync_string_conversions.h index 9d45572..3084c52 100644 --- a/sync/internal_api/public/util/sync_string_conversions.h +++ b/sync/internal_api/public/util/sync_string_conversions.h @@ -20,6 +20,6 @@ SYNC_EXPORT const char* PassphraseRequiredReasonToString( SYNC_EXPORT const char* PassphraseTypeToString(PassphraseType type); const char* BootstrapTokenTypeToString(BootstrapTokenType type); -} +} // namespace syncer #endif // SYNC_INTERNAL_API_PUBLIC_UTIL_SYNC_STRING_CONVERSIONS_H_ diff --git a/sync/internal_api/public/util/unrecoverable_error_handler.h b/sync/internal_api/public/util/unrecoverable_error_handler.h index 2bd2475..f63b916 100644 --- a/sync/internal_api/public/util/unrecoverable_error_handler.h +++ b/sync/internal_api/public/util/unrecoverable_error_handler.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_UTIL_UNRECOVERABLE_ERROR_HANDLER_H_ -#define SYNC_UTIL_UNRECOVERABLE_ERROR_HANDLER_H_ +#ifndef SYNC_INTERNAL_API_PUBLIC_UTIL_UNRECOVERABLE_ERROR_HANDLER_H_ +#define SYNC_INTERNAL_API_PUBLIC_UTIL_UNRECOVERABLE_ERROR_HANDLER_H_ #include <string> @@ -24,4 +24,4 @@ class UnrecoverableErrorHandler { } // namespace syncer -#endif // SYNC_UTIL_UNRECOVERABLE_ERROR_HANDLER_H_ +#endif // SYNC_INTERNAL_API_PUBLIC_UTIL_UNRECOVERABLE_ERROR_HANDLER_H_ diff --git a/sync/internal_api/public/util/unrecoverable_error_info.h b/sync/internal_api/public/util/unrecoverable_error_info.h index 1fb9832..4eb12c9 100644 --- a/sync/internal_api/public/util/unrecoverable_error_info.h +++ b/sync/internal_api/public/util/unrecoverable_error_info.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_UTIL_UNRECOVERABLE_ERROR_INFO_H_ -#define SYNC_UTIL_UNRECOVERABLE_ERROR_INFO_H_ +#ifndef SYNC_INTERNAL_API_PUBLIC_UTIL_UNRECOVERABLE_ERROR_INFO_H_ +#define SYNC_INTERNAL_API_PUBLIC_UTIL_UNRECOVERABLE_ERROR_INFO_H_ // TODO(lipalani): Figure out the right location for this class so it is // accessible outside of sync engine as well. @@ -37,4 +37,4 @@ class UnrecoverableErrorInfo { } // namespace syncer -#endif // SYNC_UTIL_UNRECOVERABLE_ERROR_INFO_H_ +#endif // SYNC_INTERNAL_API_PUBLIC_UTIL_UNRECOVERABLE_ERROR_INFO_H_ diff --git a/sync/internal_api/public/util/weak_handle.h b/sync/internal_api/public/util/weak_handle.h index 7a11a15..d5160f2 100644 --- a/sync/internal_api/public/util/weak_handle.h +++ b/sync/internal_api/public/util/weak_handle.h @@ -44,8 +44,8 @@ // void OnIOError(IOError err) { DCHECK(CalledOnValidThread(); ... } // }; -#ifndef SYNC_UTIL_WEAK_HANDLE_H_ -#define SYNC_UTIL_WEAK_HANDLE_H_ +#ifndef SYNC_INTERNAL_API_PUBLIC_UTIL_WEAK_HANDLE_H_ +#define SYNC_INTERNAL_API_PUBLIC_UTIL_WEAK_HANDLE_H_ #include <cstddef> @@ -373,4 +373,4 @@ WeakHandle<T> MakeWeakHandle(const base::WeakPtr<T>& ptr) { } // namespace syncer -#endif // SYNC_UTIL_WEAK_HANDLE_H_ +#endif // SYNC_INTERNAL_API_PUBLIC_UTIL_WEAK_HANDLE_H_ diff --git a/sync/internal_api/public/write_transaction.h b/sync/internal_api/public/write_transaction.h index 8d8d101..8a1e35a 100644 --- a/sync/internal_api/public/write_transaction.h +++ b/sync/internal_api/public/write_transaction.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ #define SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ +#include <string> + #include "base/basictypes.h" #include "base/compiler_specific.h" #include "sync/api/sync_change_processor.h" diff --git a/sync/internal_api/sync_backup_manager.cc b/sync/internal_api/sync_backup_manager.cc index 147da32..76edd2c 100644 --- a/sync/internal_api/sync_backup_manager.cc +++ b/sync/internal_api/sync_backup_manager.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/sync_backup_manager.h" +#include <vector> + #include "sync/internal_api/public/read_node.h" #include "sync/internal_api/public/write_transaction.h" #include "sync/syncable/directory.h" diff --git a/sync/internal_api/sync_backup_manager_unittest.cc b/sync/internal_api/sync_backup_manager_unittest.cc index 6dd20db..74132dd 100644 --- a/sync/internal_api/sync_backup_manager_unittest.cc +++ b/sync/internal_api/sync_backup_manager_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/sync_backup_manager.h" +#include <string> + #include "base/files/scoped_temp_dir.h" #include "base/run_loop.h" #include "sync/internal_api/public/read_node.h" diff --git a/sync/internal_api/sync_context.cc b/sync/internal_api/sync_context.cc index ba709fa..5e7326c 100644 --- a/sync/internal_api/sync_context.cc +++ b/sync/internal_api/sync_context.cc @@ -12,4 +12,4 @@ SyncContext::SyncContext() { SyncContext::~SyncContext() { } -} // namespace syncer +} // namespace syncer_v2 diff --git a/sync/internal_api/sync_context_proxy.cc b/sync/internal_api/sync_context_proxy.cc index e3125fe..8f90122 100644 --- a/sync/internal_api/sync_context_proxy.cc +++ b/sync/internal_api/sync_context_proxy.cc @@ -12,4 +12,4 @@ SyncContextProxy::SyncContextProxy() { SyncContextProxy::~SyncContextProxy() { } -} // namespace syncer +} // namespace syncer_v2 diff --git a/sync/internal_api/sync_context_proxy_impl.cc b/sync/internal_api/sync_context_proxy_impl.cc index 605b8a0..0f1fd22 100644 --- a/sync/internal_api/sync_context_proxy_impl.cc +++ b/sync/internal_api/sync_context_proxy_impl.cc @@ -42,4 +42,4 @@ scoped_ptr<SyncContextProxy> SyncContextProxyImpl::Clone() const { new SyncContextProxyImpl(sync_task_runner_, sync_context_)); } -} // namespace syncer +} // namespace syncer_v2 diff --git a/sync/internal_api/sync_context_proxy_impl_unittest.cc b/sync/internal_api/sync_context_proxy_impl_unittest.cc index 171d9b2..e0f0a81d 100644 --- a/sync/internal_api/sync_context_proxy_impl_unittest.cc +++ b/sync/internal_api/sync_context_proxy_impl_unittest.cc @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "sync/internal_api/sync_context_proxy_impl.h" + +#include <vector> + #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -12,7 +16,6 @@ #include "sync/internal_api/public/shared_model_type_processor.h" #include "sync/internal_api/public/sync_context.h" #include "sync/internal_api/public/test/fake_model_type_service.h" -#include "sync/internal_api/sync_context_proxy_impl.h" #include "sync/sessions/model_type_registry.h" #include "sync/test/engine/mock_nudge_handler.h" #include "sync/test/engine/test_directory_setter_upper.h" @@ -117,4 +120,4 @@ TEST_F(SyncContextProxyImplTest, SyncDisconnectsFirst) { DisableSync(); } -} // namespace syncer +} // namespace syncer_v2 diff --git a/sync/internal_api/sync_encryption_handler_impl.cc b/sync/internal_api/sync_encryption_handler_impl.cc index b408065..b2c4b8b 100644 --- a/sync/internal_api/sync_encryption_handler_impl.cc +++ b/sync/internal_api/sync_encryption_handler_impl.cc @@ -90,7 +90,7 @@ bool IsNigoriMigratedToKeystore(const sync_pb::NigoriSpecifics& nigori) { PassphraseType ProtoPassphraseTypeToEnum( sync_pb::NigoriSpecifics::PassphraseType type) { - switch(type) { + switch (type) { case sync_pb::NigoriSpecifics::IMPLICIT_PASSPHRASE: return IMPLICIT_PASSPHRASE; case sync_pb::NigoriSpecifics::KEYSTORE_PASSPHRASE: @@ -102,12 +102,12 @@ PassphraseType ProtoPassphraseTypeToEnum( default: NOTREACHED(); return IMPLICIT_PASSPHRASE; - }; + } } sync_pb::NigoriSpecifics::PassphraseType EnumPassphraseTypeToProto(PassphraseType type) { - switch(type) { + switch (type) { case IMPLICIT_PASSPHRASE: return sync_pb::NigoriSpecifics::IMPLICIT_PASSPHRASE; case KEYSTORE_PASSPHRASE: @@ -119,7 +119,7 @@ EnumPassphraseTypeToProto(PassphraseType type) { default: NOTREACHED(); return sync_pb::NigoriSpecifics::IMPLICIT_PASSPHRASE; - }; + } } bool IsExplicitPassphrase(PassphraseType type) { @@ -826,11 +826,11 @@ void SyncEncryptionHandlerImpl::ReEncryptEverything( UnlockVault(trans->GetWrappedTrans()).encrypted_types.First(); iter.Good(); iter.Inc()) { if (iter.Get() == PASSWORDS || IsControlType(iter.Get())) - continue; // These types handle encryption differently. + continue; // These types handle encryption differently. ReadNode type_root(trans); if (type_root.InitTypeRoot(iter.Get()) != BaseNode::INIT_OK) - continue; // Don't try to reencrypt if the type's data is unavailable. + continue; // Don't try to reencrypt if the type's data is unavailable. // Iterate through all children of this datatype. std::queue<int64> to_visit; @@ -1697,4 +1697,4 @@ base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime() const { return base::Time(); } -} // namespace browser_sync +} // namespace syncer diff --git a/sync/internal_api/sync_encryption_handler_impl_unittest.cc b/sync/internal_api/sync_encryption_handler_impl_unittest.cc index 31ae061..7fd105b 100644 --- a/sync/internal_api/sync_encryption_handler_impl_unittest.cc +++ b/sync/internal_api/sync_encryption_handler_impl_unittest.cc @@ -2497,7 +2497,6 @@ TEST_F(SyncEncryptionHandlerImplTest, MissingKeystoreMigrationTime) { encryption_handler()->SetKeystoreKeys(BuildEncryptionKeyProto( kRawKeystoreKey), trans.GetWrappedTrans()); - } } diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc index 86033ee..95c30de1 100644 --- a/sync/internal_api/sync_manager_impl.cc +++ b/sync/internal_api/sync_manager_impl.cc @@ -784,9 +784,8 @@ void SyncManagerImpl::HandleCalculateChangesChangeEventFromSyncer( else if (!exists_now && existed_before) change_buffers[type].PushDeletedItem(handle); else if (exists_now && existed_before && - VisiblePropertiesDiffer(it->second, crypto)) { + VisiblePropertiesDiffer(it->second, crypto)) change_buffers[type].PushUpdatedItem(handle); - } SetExtraChangeRecordData(handle, type, &change_buffers[type], crypto, it->second.original, existed_before, exists_now); diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index 27791ff..0d51577 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -1515,7 +1515,7 @@ TEST_F(SyncManagerTest, SupplyPendingOldGAIAPass) { EXPECT_CALL(encryption_observer_, OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN)) .WillOnce(SaveArg<0>(&bootstrap_token)); - EXPECT_CALL(encryption_observer_, OnPassphraseRequired(_,_)); + EXPECT_CALL(encryption_observer_, OnPassphraseRequired(_, _)); EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_)); SetImplicitPassphraseAndCheck("new_gaia"); EXPECT_FALSE(IsEncryptEverythingEnabledForTest()); diff --git a/sync/internal_api/sync_rollback_manager.cc b/sync/internal_api/sync_rollback_manager.cc index e0efb38..3ec76ce 100644 --- a/sync/internal_api/sync_rollback_manager.cc +++ b/sync/internal_api/sync_rollback_manager.cc @@ -43,7 +43,8 @@ void SyncRollbackManager::Init(InitArgs* args) { } void SyncRollbackManager::StartSyncingNormally( - const ModelSafeRoutingInfo& routing_info, base::Time last_poll_time){ + const ModelSafeRoutingInfo& routing_info, + base::Time last_poll_time) { if (rollback_ready_types_.Empty()) { NotifyRollbackDone(); return; diff --git a/sync/internal_api/sync_rollback_manager_base.cc b/sync/internal_api/sync_rollback_manager_base.cc index 0134422..2de9686 100644 --- a/sync/internal_api/sync_rollback_manager_base.cc +++ b/sync/internal_api/sync_rollback_manager_base.cc @@ -85,8 +85,8 @@ void SyncRollbackManagerBase::UpdateCredentials( } void SyncRollbackManagerBase::StartSyncingNormally( - const ModelSafeRoutingInfo& routing_info, base::Time last_poll_time){ -} + const ModelSafeRoutingInfo& routing_info, + base::Time last_poll_time) {} void SyncRollbackManagerBase::ConfigureSyncer( ConfigureReason reason, @@ -165,7 +165,6 @@ SyncEncryptionHandler* SyncRollbackManagerBase::GetEncryptionHandler() { } void SyncRollbackManagerBase::RefreshTypes(ModelTypeSet types) { - } void SyncRollbackManagerBase::HandleTransactionCompleteChangeEvent( diff --git a/sync/internal_api/sync_rollback_manager_unittest.cc b/sync/internal_api/sync_rollback_manager_unittest.cc index 2cc0015..4a90a316 100644 --- a/sync/internal_api/sync_rollback_manager_unittest.cc +++ b/sync/internal_api/sync_rollback_manager_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/sync_rollback_manager.h" +#include <set> + #include "base/files/scoped_temp_dir.h" #include "base/run_loop.h" #include "sync/internal_api/public/read_node.h" diff --git a/sync/internal_api/test/null_sync_context_proxy.cc b/sync/internal_api/test/null_sync_context_proxy.cc index 17e1314..3695b1c 100644 --- a/sync/internal_api/test/null_sync_context_proxy.cc +++ b/sync/internal_api/test/null_sync_context_proxy.cc @@ -28,4 +28,4 @@ scoped_ptr<SyncContextProxy> NullSyncContextProxy::Clone() const { return scoped_ptr<SyncContextProxy>(new NullSyncContextProxy()); } -} // namespace syncer +} // namespace syncer_v2 diff --git a/sync/internal_api/test/sync_manager_for_profile_sync_test.cc b/sync/internal_api/test/sync_manager_for_profile_sync_test.cc index e552c2f..b054226 100644 --- a/sync/internal_api/test/sync_manager_for_profile_sync_test.cc +++ b/sync/internal_api/test/sync_manager_for_profile_sync_test.cc @@ -38,4 +38,4 @@ void SyncManagerForProfileSyncTest::NotifyInitializationSuccess() { SyncManagerImpl::NotifyInitializationSuccess(); } -}; +} // namespace syncer diff --git a/sync/internal_api/test/sync_manager_for_profile_sync_test.h b/sync/internal_api/test/sync_manager_for_profile_sync_test.h index c10312d..40234ce 100644 --- a/sync/internal_api/test/sync_manager_for_profile_sync_test.h +++ b/sync/internal_api/test/sync_manager_for_profile_sync_test.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_INTERNAL_API_PUBLIC_TEST_SYNC_MANAGER_FOR_PROFILE_SYNC_TEST_H_ -#define SYNC_INTERNAL_API_PUBLIC_TEST_SYNC_MANAGER_FOR_PROFILE_SYNC_TEST_H_ +#ifndef SYNC_INTERNAL_API_TEST_SYNC_MANAGER_FOR_PROFILE_SYNC_TEST_H_ +#define SYNC_INTERNAL_API_TEST_SYNC_MANAGER_FOR_PROFILE_SYNC_TEST_H_ #include <string> @@ -29,4 +29,4 @@ class SyncManagerForProfileSyncTest } // namespace syncer -#endif // SYNC_INTERNAL_API_PUBLIC_TEST_SYNC_MANAGER_FOR_PROFILE_SYNC_TEST_H_ +#endif // SYNC_INTERNAL_API_TEST_SYNC_MANAGER_FOR_PROFILE_SYNC_TEST_H_ diff --git a/sync/internal_api/test/test_entry_factory.cc b/sync/internal_api/test/test_entry_factory.cc index 8941040..3dfb10c 100644 --- a/sync/internal_api/test/test_entry_factory.cc +++ b/sync/internal_api/test/test_entry_factory.cc @@ -79,7 +79,7 @@ int64 TestEntryFactory::CreateUnappliedNewItem( entry.PutServerParentId(syncable::Id::GetRoot()); entry.PutServerIsDir(is_unique); entry.PutServerSpecifics(specifics); - if (is_unique) { // For top-level nodes. + if (is_unique) { // For top-level nodes. entry.PutUniqueServerTag( ModelTypeToRootTag(GetModelTypeFromSpecifics(specifics))); } @@ -250,7 +250,6 @@ bool TestEntryFactory::SetServerAttachmentMetadataForItem( entry.PutServerAttachmentMetadata(metadata); entry.PutIsUnappliedUpdate(true); return true; - } bool TestEntryFactory::SetLocalAttachmentMetadataForItem( diff --git a/sync/internal_api/test/test_internal_components_factory.cc b/sync/internal_api/test/test_internal_components_factory.cc index 34c678b..1e26b4e 100644 --- a/sync/internal_api/test/test_internal_components_factory.cc +++ b/sync/internal_api/test/test_internal_components_factory.cc @@ -52,7 +52,6 @@ TestInternalComponentsFactory::BuildContext( switches_.pre_commit_updates_policy == FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE, invalidator_client_id)); - } scoped_ptr<syncable::DirectoryBackingStore> |