diff options
author | avi <avi@chromium.org> | 2015-12-21 19:14:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-22 03:15:12 +0000 |
commit | 4856ced07dfda549a142df3a5fa28cbb73bf1865 (patch) | |
tree | a81aceedc8ee5507d9f22fb4f163d847bfae6d28 /sync | |
parent | 5af9dfc5f6ed2163b13d8c20d679bdb44c783769 (diff) | |
download | chromium_src-4856ced07dfda549a142df3a5fa28cbb73bf1865.zip chromium_src-4856ced07dfda549a142df3a5fa28cbb73bf1865.tar.gz chromium_src-4856ced07dfda549a142df3a5fa28cbb73bf1865.tar.bz2 |
Switch to standard integer types in sync/.
BUG=138542
TBR=zea@chromium.org
Review URL: https://codereview.chromium.org/1545553003
Cr-Commit-Position: refs/heads/master@{#366533}
Diffstat (limited to 'sync')
303 files changed, 1597 insertions, 1129 deletions
diff --git a/sync/android/sync_jni_registrar.cc b/sync/android/sync_jni_registrar.cc index 58e15eb..6523107 100644 --- a/sync/android/sync_jni_registrar.cc +++ b/sync/android/sync_jni_registrar.cc @@ -6,7 +6,7 @@ #include "base/android/jni_android.h" #include "base/android/jni_registrar.h" -#include "base/basictypes.h" +#include "base/macros.h" #include "sync/android/model_type_helper.h" namespace syncer { diff --git a/sync/api/attachments/attachment.cc b/sync/api/attachments/attachment.cc index 32a514a..28e4e08 100644 --- a/sync/api/attachments/attachment.cc +++ b/sync/api/attachments/attachment.cc @@ -4,6 +4,8 @@ #include "sync/api/attachments/attachment.h" +#include <stdint.h> + #include "base/logging.h" #include "sync/internal_api/public/attachments/attachment_util.h" diff --git a/sync/api/attachments/attachment.h b/sync/api/attachments/attachment.h index 7999269..2f2bde0 100644 --- a/sync/api/attachments/attachment.h +++ b/sync/api/attachments/attachment.h @@ -5,10 +5,11 @@ #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_H_ #define SYNC_API_ATTACHMENTS_ATTACHMENT_H_ +#include <stdint.h> + #include <map> #include <vector> -#include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/memory/ref_counted_memory.h" #include "base/memory/scoped_ptr.h" diff --git a/sync/api/attachments/attachment_id.cc b/sync/api/attachments/attachment_id.cc index 07f3410..7ebaeaf 100644 --- a/sync/api/attachments/attachment_id.cc +++ b/sync/api/attachments/attachment_id.cc @@ -4,6 +4,9 @@ #include "sync/api/attachments/attachment_id.h" +#include <stddef.h> +#include <stdint.h> + #include "base/logging.h" #include "sync/internal_api/public/base/attachment_id_proto.h" #include "sync/protocol/sync.pb.h" diff --git a/sync/api/attachments/attachment_id.h b/sync/api/attachments/attachment_id.h index 835011a..3d2242c 100644 --- a/sync/api/attachments/attachment_id.h +++ b/sync/api/attachments/attachment_id.h @@ -5,6 +5,9 @@ #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_ID_H_ #define SYNC_API_ATTACHMENTS_ATTACHMENT_ID_H_ +#include <stddef.h> +#include <stdint.h> + #include <set> #include <string> #include <vector> diff --git a/sync/api/attachments/attachment_metadata.cc b/sync/api/attachments/attachment_metadata.cc index 202de23..860af0f 100644 --- a/sync/api/attachments/attachment_metadata.cc +++ b/sync/api/attachments/attachment_metadata.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include "sync/api/attachments/attachment_metadata.h" namespace syncer { diff --git a/sync/api/attachments/attachment_metadata.h b/sync/api/attachments/attachment_metadata.h index 6eef6c6..43343db 100644 --- a/sync/api/attachments/attachment_metadata.h +++ b/sync/api/attachments/attachment_metadata.h @@ -5,9 +5,10 @@ #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_METADATA_H_ #define SYNC_API_ATTACHMENTS_ATTACHMENT_METADATA_H_ +#include <stddef.h> + #include <vector> -#include "base/basictypes.h" #include "sync/api/attachments/attachment_id.h" #include "sync/base/sync_export.h" diff --git a/sync/api/attachments/attachment_metadata_unittest.cc b/sync/api/attachments/attachment_metadata_unittest.cc index a736b7e..99ab8d3 100644 --- a/sync/api/attachments/attachment_metadata_unittest.cc +++ b/sync/api/attachments/attachment_metadata_unittest.cc @@ -4,6 +4,9 @@ #include "sync/api/attachments/attachment_metadata.h" +#include <stddef.h> +#include <stdint.h> + #include "testing/gtest/include/gtest/gtest.h" namespace syncer { diff --git a/sync/api/attachments/attachment_store.h b/sync/api/attachments/attachment_store.h index 5ddac1e..0e4d9bb 100644 --- a/sync/api/attachments/attachment_store.h +++ b/sync/api/attachments/attachment_store.h @@ -6,6 +6,7 @@ #define SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "sync/api/attachments/attachment.h" diff --git a/sync/api/attachments/attachment_store_backend.h b/sync/api/attachments/attachment_store_backend.h index 14f1de7..697923e 100644 --- a/sync/api/attachments/attachment_store_backend.h +++ b/sync/api/attachments/attachment_store_backend.h @@ -6,6 +6,7 @@ #define SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_BACKEND_H_ #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "sync/api/attachments/attachment.h" #include "sync/api/attachments/attachment_id.h" diff --git a/sync/api/attachments/attachment_unittest.cc b/sync/api/attachments/attachment_unittest.cc index cd1e3e4..3b45fbe 100644 --- a/sync/api/attachments/attachment_unittest.cc +++ b/sync/api/attachments/attachment_unittest.cc @@ -4,6 +4,8 @@ #include "sync/api/attachments/attachment.h" +#include <stdint.h> + #include <string> #include "base/memory/ref_counted.h" diff --git a/sync/api/fake_sync_change_processor.h b/sync/api/fake_sync_change_processor.h index 7271edf..d34c4fc 100644 --- a/sync/api/fake_sync_change_processor.h +++ b/sync/api/fake_sync_change_processor.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "sync/api/sync_change_processor.h" namespace syncer { diff --git a/sync/api/string_ordinal.h b/sync/api/string_ordinal.h index 8fe9986..f2a0873 100644 --- a/sync/api/string_ordinal.h +++ b/sync/api/string_ordinal.h @@ -5,7 +5,9 @@ #ifndef SYNC_API_STRING_ORDINAL_H_ #define SYNC_API_STRING_ORDINAL_H_ -#include "base/basictypes.h" +#include <stddef.h> +#include <stdint.h> + #include "sync/internal_api/public/base/ordinal.h" namespace syncer { @@ -20,8 +22,8 @@ namespace syncer { // to store as a string in a protobuf. struct StringOrdinalTraits { - static const uint8 kZeroDigit = 'a'; - static const uint8 kMaxDigit = 'z'; + static const uint8_t kZeroDigit = 'a'; + static const uint8_t kMaxDigit = 'z'; static const size_t kMinLength = 1; }; diff --git a/sync/api/sync_change_processor_wrapper_for_test.h b/sync/api/sync_change_processor_wrapper_for_test.h index d7ca77a..73378cb 100644 --- a/sync/api/sync_change_processor_wrapper_for_test.h +++ b/sync/api/sync_change_processor_wrapper_for_test.h @@ -5,6 +5,7 @@ #ifndef SYNC_API_SYNC_CHANGE_PROCESSOR_WRAPPER_FOR_TEST_H_ #define SYNC_API_SYNC_CHANGE_PROCESSOR_WRAPPER_FOR_TEST_H_ +#include "base/macros.h" #include "sync/api/sync_change_processor.h" namespace syncer { diff --git a/sync/api/sync_data.cc b/sync/api/sync_data.cc index 17b54dc..e40e7c3 100644 --- a/sync/api/sync_data.cc +++ b/sync/api/sync_data.cc @@ -4,6 +4,8 @@ #include "sync/api/sync_data.h" +#include <stdint.h> + #include <algorithm> #include <ostream> @@ -65,7 +67,7 @@ void SyncData::ImmutableSyncEntityTraits::Swap(sync_pb::SyncEntity* t1, SyncData::SyncData() : id_(kInvalidId), is_valid_(false) {} -SyncData::SyncData(int64 id, +SyncData::SyncData(int64_t id, sync_pb::SyncEntity* entity, const base::Time& remote_modification_time, const syncer::AttachmentServiceProxy& attachment_service) @@ -117,7 +119,7 @@ SyncData SyncData::CreateLocalDataWithAttachments( // Static. SyncData SyncData::CreateRemoteData( - int64 id, + int64_t id, const sync_pb::EntitySpecifics& specifics, const base::Time& modification_time, const AttachmentIdList& attachment_ids, @@ -208,7 +210,7 @@ const base::Time& SyncDataRemote::GetModifiedTime() const { return remote_modification_time_; } -int64 SyncDataRemote::GetId() const { +int64_t SyncDataRemote::GetId() const { return id_; } diff --git a/sync/api/sync_data.h b/sync/api/sync_data.h index e3885291..a516eab 100644 --- a/sync/api/sync_data.h +++ b/sync/api/sync_data.h @@ -5,11 +5,12 @@ #ifndef SYNC_API_SYNC_DATA_H_ #define SYNC_API_SYNC_DATA_H_ +#include <stdint.h> + #include <iosfwd> #include <string> #include <vector> -#include "base/basictypes.h" #include "base/callback.h" #include "base/memory/ref_counted.h" #include "base/stl_util.h" @@ -71,7 +72,7 @@ class SYNC_EXPORT SyncData { // Helper method for creating SyncData objects originating from the syncer. static SyncData CreateRemoteData( - int64 id, + int64_t id, const sync_pb::EntitySpecifics& specifics, const base::Time& last_modified_time, const AttachmentIdList& attachment_ids, @@ -128,7 +129,7 @@ class SYNC_EXPORT SyncData { ImmutableSyncEntity; // Equal to kInvalidId iff this is local. - int64 id_; + int64_t id_; // This may be null if the SyncData represents a deleted item. base::Time remote_modification_time_; @@ -143,7 +144,7 @@ class SYNC_EXPORT SyncData { bool is_valid_; // Clears |entity| and |attachments|. - SyncData(int64 id, + SyncData(int64_t id, sync_pb::SyncEntity* entity, const base::Time& remote_modification_time, const syncer::AttachmentServiceProxy& attachment_service); @@ -176,7 +177,7 @@ class SYNC_EXPORT SyncDataRemote : public SyncData { // if the SyncData represents a deleted item. const base::Time& GetModifiedTime() const; - int64 GetId() const; + int64_t GetId() const; // Retrieve the attachments indentified by |attachment_ids|. Invoke // |callback| with the requested attachments. diff --git a/sync/api/sync_data_unittest.cc b/sync/api/sync_data_unittest.cc index 9d676c0..020adec 100644 --- a/sync/api/sync_data_unittest.cc +++ b/sync/api/sync_data_unittest.cc @@ -4,6 +4,8 @@ #include "sync/api/sync_data.h" +#include <stdint.h> + #include <string> #include "base/memory/ref_counted_memory.h" @@ -26,7 +28,7 @@ namespace { const char kSyncTag[] = "3984729834"; const ModelType kDatatype = syncer::PREFERENCES; const char kNonUniqueTitle[] = "my preference"; -const int64 kId = 439829; +const int64_t kId = 439829; const base::Time kLastModifiedTime = base::Time(); class SyncDataTest : public testing::Test { diff --git a/sync/api/sync_merge_result.cc b/sync/api/sync_merge_result.cc index 601c577..0231acb0 100644 --- a/sync/api/sync_merge_result.cc +++ b/sync/api/sync_merge_result.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + #include "sync/api/sync_merge_result.h" namespace syncer { @@ -47,7 +49,7 @@ void SyncMergeResult::set_num_items_modified(int num_items_modified) { num_items_modified_ = num_items_modified; } -void SyncMergeResult::set_pre_association_version(int64 version) { +void SyncMergeResult::set_pre_association_version(int64_t version) { pre_association_version_ = version; } @@ -79,7 +81,7 @@ int SyncMergeResult::num_items_modified() const { return num_items_modified_; } -int64 SyncMergeResult::pre_association_version() const { +int64_t SyncMergeResult::pre_association_version() const { return pre_association_version_; } diff --git a/sync/api/sync_merge_result.h b/sync/api/sync_merge_result.h index 712f4bd..f164a4f 100644 --- a/sync/api/sync_merge_result.h +++ b/sync/api/sync_merge_result.h @@ -5,6 +5,8 @@ #ifndef SYNC_API_SYNC_MERGE_RESULT_H_ #define SYNC_API_SYNC_MERGE_RESULT_H_ +#include <stdint.h> + #include "sync/api/sync_error.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" @@ -34,7 +36,7 @@ class SYNC_EXPORT SyncMergeResult { void set_num_items_added(int num_items_added); void set_num_items_deleted(int num_items_deleted); void set_num_items_modified(int num_items_modified); - void set_pre_association_version(int64 version); + void set_pre_association_version(int64_t version); // Getters. ModelType model_type() const; @@ -44,7 +46,7 @@ class SYNC_EXPORT SyncMergeResult { int num_items_added() const; int num_items_deleted() const; int num_items_modified() const; - int64 pre_association_version() const; + int64_t pre_association_version() const; private: // Make |this| into a copy of |other|. @@ -70,7 +72,7 @@ class SYNC_EXPORT SyncMergeResult { int num_items_modified_; // Version of model before association. - int64 pre_association_version_; + int64_t pre_association_version_; }; } // namespace syncer diff --git a/sync/engine/all_status.h b/sync/engine/all_status.h index 95d9545..1fc0801 100644 --- a/sync/engine/all_status.h +++ b/sync/engine/all_status.h @@ -12,12 +12,13 @@ #include <string> #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/synchronization/lock.h" +#include "sync/engine/nudge_source.h" #include "sync/engine/sync_engine_event_listener.h" #include "sync/engine/syncer_types.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/engine/sync_status.h" -#include "sync/engine/nudge_source.h" namespace syncer { diff --git a/sync/engine/apply_control_data_updates.cc b/sync/engine/apply_control_data_updates.cc index ce6c6c5..0f5ae39 100644 --- a/sync/engine/apply_control_data_updates.cc +++ b/sync/engine/apply_control_data_updates.cc @@ -4,6 +4,8 @@ #include "sync/engine/apply_control_data_updates.h" +#include <stdint.h> + #include <vector> #include "base/metrics/histogram.h" @@ -22,7 +24,7 @@ namespace syncer { void ApplyControlDataUpdates(syncable::Directory* dir) { syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir); - std::vector<int64> handles; + std::vector<int64_t> handles; dir->GetUnappliedUpdateMetaHandles( &trans, ToFullModelTypeSet(ControlTypes()), &handles); @@ -67,7 +69,7 @@ void ApplyControlDataUpdates(syncable::Directory* dir) { // Go through the rest of the unapplied control updates, skipping over any // top level folders. - for (std::vector<int64>::const_iterator iter = handles.begin(); + for (std::vector<int64_t>::const_iterator iter = handles.begin(); iter != handles.end(); ++iter) { syncable::MutableEntry entry(&trans, syncable::GET_BY_HANDLE, *iter); CHECK(entry.good()); diff --git a/sync/engine/apply_control_data_updates_unittest.cc b/sync/engine/apply_control_data_updates_unittest.cc index 405ae0e..505678f 100644 --- a/sync/engine/apply_control_data_updates_unittest.cc +++ b/sync/engine/apply_control_data_updates_unittest.cc @@ -4,10 +4,14 @@ #include "sync/engine/apply_control_data_updates.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include "base/format_macros.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/strings/stringprintf.h" @@ -330,10 +334,8 @@ TEST_F(ApplyControlDataUpdatesTest, other_cryptographer.GetKeys(server_nigori->mutable_encryption_keybag()); server_nigori->set_encrypt_everything(true); server_nigori->set_keybag_is_frozen(true); - int64 nigori_handle = - entry_factory_->CreateUnappliedNewItem(kNigoriTag, - server_specifics, - true); + int64_t nigori_handle = entry_factory_->CreateUnappliedNewItem( + kNigoriTag, server_specifics, true); // Initialize the local cryptographer with the local keys. cryptographer->AddKey(local_params); @@ -408,10 +410,8 @@ TEST_F(ApplyControlDataUpdatesTest, other_cryptographer.GetKeys(server_nigori->mutable_encryption_keybag()); server_nigori->set_encrypt_everything(false); server_nigori->set_keybag_is_frozen(false); - int64 nigori_handle = - entry_factory_->CreateUnappliedNewItem(kNigoriTag, - server_specifics, - true); + int64_t nigori_handle = entry_factory_->CreateUnappliedNewItem( + kNigoriTag, server_specifics, true); // Initialize the local cryptographer with the local keys. cryptographer->AddKey(local_params); @@ -483,10 +483,8 @@ TEST_F(ApplyControlDataUpdatesTest, sync_pb::NigoriSpecifics* server_nigori = server_specifics.mutable_nigori(); cryptographer->GetKeys(server_nigori->mutable_encryption_keybag()); server_nigori->set_encrypt_everything(true); - int64 nigori_handle = - entry_factory_->CreateUnappliedNewItem(kNigoriTag, - server_specifics, - true); + int64_t nigori_handle = entry_factory_->CreateUnappliedNewItem( + kNigoriTag, server_specifics, true); // Add the new keys to the cryptogrpaher cryptographer->AddKey(new_params); @@ -558,10 +556,8 @@ TEST_F(ApplyControlDataUpdatesTest, server_nigori->set_passphrase_type( sync_pb::NigoriSpecifics::KEYSTORE_PASSPHRASE); server_nigori->mutable_keystore_decryptor_token(); - int64 nigori_handle = - entry_factory_->CreateUnappliedNewItem(kNigoriTag, - server_specifics, - true); + int64_t nigori_handle = entry_factory_->CreateUnappliedNewItem( + kNigoriTag, server_specifics, true); // Add the new keys to the cryptographer. cryptographer->AddKey(old_params); @@ -640,10 +636,8 @@ TEST_F(ApplyControlDataUpdatesTest, server_nigori->set_keybag_is_frozen(true); server_nigori->set_passphrase_type( sync_pb::NigoriSpecifics::CUSTOM_PASSPHRASE); - int64 nigori_handle = - entry_factory_->CreateUnappliedNewItem(kNigoriTag, - server_specifics, - true); + int64_t nigori_handle = entry_factory_->CreateUnappliedNewItem( + kNigoriTag, server_specifics, true); // Add the old keys to the cryptographer. cryptographer->AddKey(old_params); @@ -720,10 +714,8 @@ TEST_F(ApplyControlDataUpdatesTest, other_cryptographer.GetKeys(server_nigori->mutable_encryption_keybag()); server_nigori->set_encrypt_everything(true); server_nigori->set_keybag_is_frozen(false); - int64 nigori_handle = - entry_factory_->CreateUnappliedNewItem(kNigoriTag, - server_specifics, - true); + int64_t nigori_handle = entry_factory_->CreateUnappliedNewItem( + kNigoriTag, server_specifics, true); // Add the old keys to the cryptographer. cryptographer->AddKey(old_params); @@ -802,10 +794,8 @@ TEST_F(ApplyControlDataUpdatesTest, server_nigori->set_passphrase_type( sync_pb::NigoriSpecifics::KEYSTORE_PASSPHRASE); server_nigori->mutable_keystore_decryptor_token(); - int64 nigori_handle = - entry_factory_->CreateUnappliedNewItem(kNigoriTag, - server_specifics, - true); + int64_t nigori_handle = entry_factory_->CreateUnappliedNewItem( + kNigoriTag, server_specifics, true); // Add the old keys to the cryptographer. cryptographer->AddKey(old_params); @@ -864,8 +854,8 @@ TEST_F(ApplyControlDataUpdatesTest, ControlApply) { sync_pb::EntitySpecifics specifics; specifics.mutable_experiments()->mutable_keystore_encryption()-> set_enabled(true); - int64 experiment_handle = entry_factory_->CreateUnappliedNewItem( - experiment_id, specifics, false); + int64_t experiment_handle = + entry_factory_->CreateUnappliedNewItem(experiment_id, specifics, false); ApplyControlDataUpdates(directory()); EXPECT_FALSE(entry_factory_->GetIsUnappliedForItem(experiment_handle)); @@ -881,10 +871,10 @@ TEST_F(ApplyControlDataUpdatesTest, ControlApplyParentBeforeChild) { sync_pb::EntitySpecifics specifics; specifics.mutable_experiments()->mutable_keystore_encryption()-> set_enabled(true); - int64 experiment_handle = entry_factory_->CreateUnappliedNewItemWithParent( + int64_t experiment_handle = entry_factory_->CreateUnappliedNewItemWithParent( experiment_id, specifics, parent_id); - int64 parent_handle = entry_factory_->CreateUnappliedNewItem( - parent_id, specifics, true); + int64_t parent_handle = + entry_factory_->CreateUnappliedNewItem(parent_id, specifics, true); ApplyControlDataUpdates(directory()); EXPECT_FALSE(entry_factory_->GetIsUnappliedForItem(parent_handle)); @@ -903,8 +893,8 @@ TEST_F(ApplyControlDataUpdatesTest, ControlConflict) { set_enabled(true); local_specifics.mutable_experiments()->mutable_keystore_encryption()-> set_enabled(false); - int64 experiment_handle = entry_factory_->CreateSyncedItem( - experiment_id, EXPERIMENTS, false); + int64_t experiment_handle = + entry_factory_->CreateSyncedItem(experiment_id, EXPERIMENTS, false); entry_factory_->SetServerSpecificsForItem(experiment_handle, server_specifics); entry_factory_->SetLocalSpecificsForItem(experiment_handle, diff --git a/sync/engine/backoff_delay_provider.cc b/sync/engine/backoff_delay_provider.cc index ddd90ed..cb8b0f1 100644 --- a/sync/engine/backoff_delay_provider.cc +++ b/sync/engine/backoff_delay_provider.cc @@ -4,6 +4,8 @@ #include "sync/engine/backoff_delay_provider.h" +#include <stdint.h> + #include <algorithm> #include "base/rand_util.h" @@ -43,8 +45,8 @@ TimeDelta BackoffDelayProvider::GetDelay(const base::TimeDelta& last_delay) { return TimeDelta::FromSeconds(kMaxBackoffSeconds); // This calculates approx. base_delay_seconds * 2 +/- base_delay_seconds / 2 - int64 backoff_s = - std::max(static_cast<int64>(1), + int64_t backoff_s = + std::max(static_cast<int64_t>(1), last_delay.InSeconds() * kBackoffRandomizationFactor); // Flip a coin to randomize backoff interval by +/- 50%. @@ -55,7 +57,7 @@ TimeDelta BackoffDelayProvider::GetDelay(const base::TimeDelta& last_delay) { (rand_sign * (last_delay.InSeconds() / kBackoffRandomizationFactor)); // Cap the backoff interval. - backoff_s = std::max(static_cast<int64>(1), + backoff_s = std::max(static_cast<int64_t>(1), std::min(backoff_s, kMaxBackoffSeconds)); return TimeDelta::FromSeconds(backoff_s); diff --git a/sync/engine/backoff_delay_provider.h b/sync/engine/backoff_delay_provider.h index 7863e2b..75cc71b 100644 --- a/sync/engine/backoff_delay_provider.h +++ b/sync/engine/backoff_delay_provider.h @@ -5,6 +5,7 @@ #ifndef SYNC_ENGINE_BACKOFF_DELAY_PROVIDER_H_ #define SYNC_ENGINE_BACKOFF_DELAY_PROVIDER_H_ +#include "base/macros.h" #include "base/time/time.h" #include "sync/base/sync_export.h" diff --git a/sync/engine/commit.cc b/sync/engine/commit.cc index c089cc9..a1c1737 100644 --- a/sync/engine/commit.cc +++ b/sync/engine/commit.cc @@ -4,6 +4,8 @@ #include "sync/engine/commit.h" +#include <stddef.h> + #include "base/metrics/sparse_histogram.h" #include "base/trace_event/trace_event.h" #include "sync/engine/commit_contribution.h" diff --git a/sync/engine/commit.h b/sync/engine/commit.h index 3baee67..b50d3f5 100644 --- a/sync/engine/commit.h +++ b/sync/engine/commit.h @@ -5,6 +5,8 @@ #ifndef SYNC_ENGINE_COMMIT_H_ #define SYNC_ENGINE_COMMIT_H_ +#include <stddef.h> + #include <map> #include <string> diff --git a/sync/engine/commit_contribution.h b/sync/engine/commit_contribution.h index fa440f8..3189957 100644 --- a/sync/engine/commit_contribution.h +++ b/sync/engine/commit_contribution.h @@ -5,6 +5,8 @@ #ifndef SYNC_ENGINE_COMMIT_CONTRIBUTION_H_ #define SYNC_ENGINE_COMMIT_CONTRIBUTION_H_ +#include <stddef.h> + #include "sync/base/sync_export.h" #include "sync/internal_api/public/util/syncer_error.h" #include "sync/protocol/sync.pb.h" diff --git a/sync/engine/commit_processor.cc b/sync/engine/commit_processor.cc index 4624fa4..c3208e1 100644 --- a/sync/engine/commit_processor.cc +++ b/sync/engine/commit_processor.cc @@ -4,6 +4,8 @@ #include "sync/engine/commit_processor.h" +#include <stddef.h> + #include <utility> #include "sync/engine/commit_contribution.h" diff --git a/sync/engine/commit_processor.h b/sync/engine/commit_processor.h index 67ebe56..79bc643 100644 --- a/sync/engine/commit_processor.h +++ b/sync/engine/commit_processor.h @@ -5,10 +5,12 @@ #ifndef SYNC_ENGINE_COMMIT_PROCESSOR_H_ #define SYNC_ENGINE_COMMIT_PROCESSOR_H_ +#include <stddef.h> + #include <map> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/engine/commit.h" #include "sync/internal_api/public/base/model_type.h" diff --git a/sync/engine/commit_util.cc b/sync/engine/commit_util.cc index 2515216..f2ac076 100644 --- a/sync/engine/commit_util.cc +++ b/sync/engine/commit_util.cc @@ -4,6 +4,8 @@ #include "sync/engine/commit_util.h" +#include <stdint.h> + #include <limits> #include <set> #include <string> @@ -152,7 +154,7 @@ void BuildCommitItem( sync_entry->set_old_parent_id(SyncableIdToProto(server_parent_id)); } - int64 version = meta_entry.GetBaseVersion(); + int64_t version = meta_entry.GetBaseVersion(); if (syncable::CHANGES_VERSION == version || 0 == version) { // Undeletions are only supported for items that have a client tag. DCHECK(!id.ServerKnows() || @@ -232,8 +234,8 @@ bool UpdateVersionAfterCommit( const sync_pb::CommitResponse_EntryResponse& entry_response, const syncable::Id& pre_commit_id, syncable::ModelNeutralMutableEntry* local_entry) { - int64 old_version = local_entry->GetBaseVersion(); - int64 new_version = entry_response.version(); + int64_t old_version = local_entry->GetBaseVersion(); + int64_t new_version = entry_response.version(); bool bad_commit_version = false; if (committed_entry.deleted() && !local_entry->GetUniqueClientTag().empty()) { @@ -391,12 +393,11 @@ void ProcessSuccessfulCommitResponse( } // namespace -sync_pb::CommitResponse::ResponseType -ProcessSingleCommitResponse( +sync_pb::CommitResponse::ResponseType ProcessSingleCommitResponse( syncable::BaseWriteTransaction* trans, const sync_pb::CommitResponse_EntryResponse& server_entry, const sync_pb::SyncEntity& commit_request_entry, - int64 metahandle, + int64_t metahandle, set<syncable::Id>* deleted_folders) { syncable::ModelNeutralMutableEntry local_entry( trans, diff --git a/sync/engine/commit_util.h b/sync/engine/commit_util.h index d6a1b49..6a42ebf 100644 --- a/sync/engine/commit_util.h +++ b/sync/engine/commit_util.h @@ -5,6 +5,8 @@ #ifndef SYNC_ENGINE_COMMIT_UTIL_H_ #define SYNC_ENGINE_COMMIT_UTIL_H_ +#include <stdint.h> + #include <set> #include "sync/base/sync_export.h" @@ -55,7 +57,7 @@ sync_pb::CommitResponse::ResponseType ProcessSingleCommitResponse( syncable::BaseWriteTransaction* trans, const sync_pb::CommitResponse_EntryResponse& server_entry, const sync_pb::SyncEntity& commit_request_entry, - int64 metahandle, + int64_t metahandle, std::set<syncable::Id>* deleted_folders); } // namespace commit_util diff --git a/sync/engine/conflict_resolver.h b/sync/engine/conflict_resolver.h index 3266afb..b4df599 100644 --- a/sync/engine/conflict_resolver.h +++ b/sync/engine/conflict_resolver.h @@ -10,8 +10,8 @@ #include <set> -#include "base/basictypes.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "sync/engine/syncer_types.h" namespace syncer { diff --git a/sync/engine/directory_commit_contribution.cc b/sync/engine/directory_commit_contribution.cc index a65e3da..00af906 100644 --- a/sync/engine/directory_commit_contribution.cc +++ b/sync/engine/directory_commit_contribution.cc @@ -4,6 +4,9 @@ #include "sync/engine/directory_commit_contribution.h" +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <set> @@ -31,7 +34,7 @@ scoped_ptr<DirectoryCommitContribution> DirectoryCommitContribution::Build( DirectoryTypeDebugInfoEmitter* debug_info_emitter) { DCHECK(debug_info_emitter); - std::vector<int64> metahandles; + std::vector<int64_t> metahandles; syncable::ModelNeutralWriteTransaction trans(FROM_HERE, SYNCER, dir); GetCommitIdsForType(&trans, type, max_entries, &metahandles); @@ -40,7 +43,7 @@ scoped_ptr<DirectoryCommitContribution> DirectoryCommitContribution::Build( return scoped_ptr<DirectoryCommitContribution>(); google::protobuf::RepeatedPtrField<sync_pb::SyncEntity> entities; - for (std::vector<int64>::iterator it = metahandles.begin(); + for (std::vector<int64_t>::iterator it = metahandles.begin(); it != metahandles.end(); ++it) { sync_pb::SyncEntity* entity = entities.Add(); syncable::ModelNeutralMutableEntry entry(&trans, GET_BY_HANDLE, *it); @@ -169,7 +172,7 @@ size_t DirectoryCommitContribution::GetNumEntries() const { } DirectoryCommitContribution::DirectoryCommitContribution( - const std::vector<int64>& metahandles, + const std::vector<int64_t>& metahandles, const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, const sync_pb::DataTypeContext& context, syncable::Directory* dir, @@ -184,7 +187,7 @@ DirectoryCommitContribution::DirectoryCommitContribution( void DirectoryCommitContribution::UnsetSyncingBits() { syncable::ModelNeutralWriteTransaction trans(FROM_HERE, SYNCER, dir_); - for (std::vector<int64>::const_iterator it = metahandles_.begin(); + for (std::vector<int64_t>::const_iterator it = metahandles_.begin(); it != metahandles_.end(); ++it) { syncable::ModelNeutralMutableEntry entry(&trans, GET_BY_HANDLE, *it); // TODO(sync): this seems like it could be harmful if a sync cycle doesn't diff --git a/sync/engine/directory_commit_contribution.h b/sync/engine/directory_commit_contribution.h index dabb7d9..b0ed9c8 100644 --- a/sync/engine/directory_commit_contribution.h +++ b/sync/engine/directory_commit_contribution.h @@ -5,9 +5,13 @@ #ifndef SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTION_H_ #define SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTION_H_ +#include <stddef.h> +#include <stdint.h> + #include <vector> #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "sync/base/sync_export.h" #include "sync/engine/commit_contribution.h" @@ -81,7 +85,7 @@ class SYNC_EXPORT DirectoryCommitContribution : public CommitContribution { GatherAndTruncate); DirectoryCommitContribution( - const std::vector<int64>& metahandles, + const std::vector<int64_t>& metahandles, const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, const sync_pb::DataTypeContext& context, syncable::Directory* directory, @@ -90,7 +94,7 @@ class SYNC_EXPORT DirectoryCommitContribution : public CommitContribution { void UnsetSyncingBits(); syncable::Directory* dir_; - const std::vector<int64> metahandles_; + const std::vector<int64_t> metahandles_; const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity> entities_; sync_pb::DataTypeContext context_; size_t entries_start_index_; diff --git a/sync/engine/directory_commit_contribution_unittest.cc b/sync/engine/directory_commit_contribution_unittest.cc index 3789bee..6425284 100644 --- a/sync/engine/directory_commit_contribution_unittest.cc +++ b/sync/engine/directory_commit_contribution_unittest.cc @@ -4,6 +4,8 @@ #include "sync/engine/directory_commit_contribution.h" +#include <stdint.h> + #include <set> #include <string> @@ -36,7 +38,7 @@ class DirectoryCommitContributionTest : public ::testing::Test { void TearDown() override { dir_maker_.TearDown(); } protected: - int64 CreateUnsyncedItemWithAttachments( + int64_t CreateUnsyncedItemWithAttachments( syncable::WriteTransaction* trans, ModelType type, const std::string& tag, @@ -57,16 +59,16 @@ class DirectoryCommitContributionTest : public ::testing::Test { return entry.GetMetahandle(); } - int64 CreateUnsyncedItem(syncable::WriteTransaction* trans, - ModelType type, - const std::string& tag) { + int64_t CreateUnsyncedItem(syncable::WriteTransaction* trans, + ModelType type, + const std::string& tag) { return CreateUnsyncedItemWithAttachments( trans, type, tag, sync_pb::AttachmentMetadata()); } - int64 CreateSyncedItem(syncable::WriteTransaction* trans, - ModelType type, - const std::string& tag) { + int64_t CreateSyncedItem(syncable::WriteTransaction* trans, + ModelType type, + const std::string& tag) { syncable::Entry parent_entry(trans, syncable::GET_TYPE_ROOT, type); syncable::MutableEntry entry( trans, @@ -118,7 +120,7 @@ class DirectoryCommitContributionTest : public ::testing::Test { // Verify that the DirectoryCommitContribution contains only entries of its // specified type. TEST_F(DirectoryCommitContributionTest, GatherByTypes) { - int64 pref1; + int64_t pref1; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); pref1 = CreateUnsyncedItem(&trans, PREFERENCES, "pref1"); @@ -131,7 +133,7 @@ TEST_F(DirectoryCommitContributionTest, GatherByTypes) { DirectoryCommitContribution::Build(dir(), PREFERENCES, 5, &emitter)); ASSERT_EQ(2U, cc->GetNumEntries()); - const std::vector<int64>& metahandles = cc->metahandles_; + const std::vector<int64_t>& metahandles = cc->metahandles_; EXPECT_TRUE(std::find(metahandles.begin(), metahandles.end(), pref1) != metahandles.end()); EXPECT_TRUE(std::find(metahandles.begin(), metahandles.end(), pref1) != @@ -143,8 +145,8 @@ TEST_F(DirectoryCommitContributionTest, GatherByTypes) { // Verify that the DirectoryCommitContributionTest builder function // truncates if necessary. TEST_F(DirectoryCommitContributionTest, GatherAndTruncate) { - int64 pref1; - int64 pref2; + int64_t pref1; + int64_t pref2; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); pref1 = CreateUnsyncedItem(&trans, PREFERENCES, "pref1"); @@ -157,7 +159,7 @@ TEST_F(DirectoryCommitContributionTest, GatherAndTruncate) { DirectoryCommitContribution::Build(dir(), PREFERENCES, 1, &emitter)); ASSERT_EQ(1U, cc->GetNumEntries()); - int64 only_metahandle = cc->metahandles_[0]; + int64_t only_metahandle = cc->metahandles_[0]; EXPECT_TRUE(only_metahandle == pref1 || only_metahandle == pref2); cc->CleanUp(); @@ -220,7 +222,7 @@ TEST_F(DirectoryCommitContributionTest, PrepareCommit) { // This was not always the case, but was implemented to allow us to loosen some // other restrictions in the protocol. TEST_F(DirectoryCommitContributionTest, DeletedItemsWithSpecifics) { - int64 pref1; + int64_t pref1; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); pref1 = CreateSyncedItem(&trans, PREFERENCES, "pref1"); @@ -249,7 +251,7 @@ TEST_F(DirectoryCommitContributionTest, DeletedItemsWithSpecifics) { // Deleted bookmarks include a valid "is folder" bit and their full specifics // (especially the meta info, which is what server really wants). TEST_F(DirectoryCommitContributionTest, DeletedBookmarksWithSpecifics) { - int64 bm1; + int64_t bm1; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); bm1 = CreateSyncedItem(&trans, BOOKMARKS, "bm1"); @@ -295,7 +297,7 @@ TEST_F(DirectoryCommitContributionTest, DeletedBookmarksWithSpecifics) { // Test that bookmarks support hierarchy. TEST_F(DirectoryCommitContributionTest, HierarchySupport_Bookmark) { // Create a normal-looking bookmark item. - int64 bm1; + int64_t bm1; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); bm1 = CreateSyncedItem(&trans, BOOKMARKS, "bm1"); @@ -330,7 +332,7 @@ TEST_F(DirectoryCommitContributionTest, HierarchySupport_Bookmark) { // Test that preferences do not support hierarchy. TEST_F(DirectoryCommitContributionTest, HierarchySupport_Preferences) { // Create a normal-looking prefs item. - int64 pref1; + int64_t pref1; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); pref1 = CreateUnsyncedItem(&trans, PREFERENCES, "pref1"); @@ -364,9 +366,9 @@ void AddAttachment(sync_pb::AttachmentMetadata* metadata, bool is_on_server) { // specially crafted response to the syncer in order to test commit response // processing. The response simulates a succesful commit scenario. TEST_F(DirectoryCommitContributionTest, ProcessCommitResponse) { - int64 pref1_handle; - int64 pref2_handle; - int64 ext1_handle; + int64_t pref1_handle; + int64_t pref2_handle; + int64_t ext1_handle; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); pref1_handle = CreateUnsyncedItem(&trans, PREFERENCES, "pref1"); @@ -431,9 +433,9 @@ TEST_F(DirectoryCommitContributionTest, ProcessCommitResponse) { // where all attachments have been uploaded to the server are eligible to be // committed. TEST_F(DirectoryCommitContributionTest, ProcessCommitResponseWithAttachments) { - int64 art1_handle; - int64 art2_handle; - int64 art3_handle; + int64_t art1_handle; + int64_t art2_handle; + int64_t art3_handle; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); diff --git a/sync/engine/directory_commit_contributor.cc b/sync/engine/directory_commit_contributor.cc index f6c2726..23633c5 100644 --- a/sync/engine/directory_commit_contributor.cc +++ b/sync/engine/directory_commit_contributor.cc @@ -4,6 +4,8 @@ #include "sync/engine/directory_commit_contributor.h" +#include <stddef.h> + #include "sync/engine/directory_commit_contribution.h" #include "sync/sessions/directory_type_debug_info_emitter.h" diff --git a/sync/engine/directory_commit_contributor.h b/sync/engine/directory_commit_contributor.h index 430bcaf..285bb14 100644 --- a/sync/engine/directory_commit_contributor.h +++ b/sync/engine/directory_commit_contributor.h @@ -5,8 +5,11 @@ #ifndef SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_ #define SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_ +#include <stddef.h> + #include <map> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "sync/engine/commit_contributor.h" #include "sync/engine/directory_commit_contribution.h" diff --git a/sync/engine/directory_update_handler.cc b/sync/engine/directory_update_handler.cc index 60b08c5..87e5e10 100644 --- a/sync/engine/directory_update_handler.cc +++ b/sync/engine/directory_update_handler.cc @@ -4,6 +4,8 @@ #include "sync/engine/directory_update_handler.h" +#include <stdint.h> + #include <vector> #include "sync/engine/conflict_resolver.h" @@ -146,7 +148,7 @@ SyncerError DirectoryUpdateHandler::ApplyUpdatesImpl( sessions::StatusController* status) { syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir_); - std::vector<int64> handles; + std::vector<int64_t> handles; dir_->GetUnappliedUpdateMetaHandles( &trans, FullModelTypeSet(type_), diff --git a/sync/engine/directory_update_handler.h b/sync/engine/directory_update_handler.h index 442ac54..85601e9 100644 --- a/sync/engine/directory_update_handler.h +++ b/sync/engine/directory_update_handler.h @@ -7,7 +7,7 @@ #include <map> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "sync/base/sync_export.h" diff --git a/sync/engine/directory_update_handler_unittest.cc b/sync/engine/directory_update_handler_unittest.cc index 3a29d1c..68f3cad 100644 --- a/sync/engine/directory_update_handler_unittest.cc +++ b/sync/engine/directory_update_handler_unittest.cc @@ -4,11 +4,14 @@ #include "sync/engine/directory_update_handler.h" +#include <stdint.h> + #include <set> #include <string> #include <utility> #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "sync/engine/syncer_proto_util.h" @@ -36,7 +39,7 @@ namespace syncer { using syncable::Id; using syncable::UNITTEST; -static const int64 kDefaultVersion = 1000; +static const int64_t kDefaultVersion = 1000; // A test harness for tests that focus on processing updates. // @@ -542,10 +545,10 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, SimpleBookmark) { sessions::StatusController status; std::string root_server_id = Id::GetRoot().GetServerId(); - int64 parent_handle = + int64_t parent_handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( "parent", DefaultBookmarkSpecifics(), root_server_id); - int64 child_handle = + int64_t child_handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( "child", DefaultBookmarkSpecifics(), "parent"); @@ -580,9 +583,9 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, BookmarkChildrenBeforeParent) { // Start with some bookmarks whose parents are unknown. std::string root_server_id = Id::GetRoot().GetServerId(); - int64 a_handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( + int64_t a_handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( "a_child_created_first", DefaultBookmarkSpecifics(), "parent"); - int64 x_handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( + int64_t x_handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( "x_child_created_first", DefaultBookmarkSpecifics(), "parent"); // Update application will fail. @@ -635,7 +638,7 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, // Try to apply changes on an item that is both IS_UNSYNCED and // IS_UNAPPLIED_UPDATE. Conflict resolution should be performed. TEST_F(DirectoryUpdateHandlerApplyUpdateTest, SimpleBookmarkConflict) { - int64 handle = entry_factory()->CreateUnappliedAndUnsyncedBookmarkItem("x"); + int64_t handle = entry_factory()->CreateUnappliedAndUnsyncedBookmarkItem("x"); int original_server_version = -10; { @@ -674,7 +677,7 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, SimpleBookmarkConflict) { // the update to be applied. The item must remain in the conflict state. TEST_F(DirectoryUpdateHandlerApplyUpdateTest, HierarchyAndSimpleConflict) { // Create a simply-conflicting item. It will start with valid parent ids. - int64 handle = entry_factory()->CreateUnappliedAndUnsyncedBookmarkItem( + int64_t handle = entry_factory()->CreateUnappliedAndUnsyncedBookmarkItem( "orphaned_by_server"); { // Manually set the SERVER_PARENT_ID to bad value. @@ -710,7 +713,7 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, BookmarkFolderLoop) { // parent of 'Y'. // Create it as a child of root node. - int64 handle = entry_factory()->CreateSyncedItem("X", BOOKMARKS, true); + int64_t handle = entry_factory()->CreateSyncedItem("X", BOOKMARKS, true); { syncable::WriteTransaction trans(FROM_HERE, UNITTEST, directory()); @@ -754,7 +757,7 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, BookmarkFolderLoop) { TEST_F(DirectoryUpdateHandlerApplyUpdateTest, HierarchyConflictDeletedParent) { // Create a locally deleted parent item. - int64 parent_handle; + int64_t parent_handle; entry_factory()->CreateUnsyncedItem( Id::CreateFromServerId("parent"), TestIdFactory::root(), "parent", true, BOOKMARKS, &parent_handle); @@ -767,7 +770,7 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, } // Create an incoming child from the server. - int64 child_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t child_handle = entry_factory()->CreateUnappliedNewItemWithParent( "child", DefaultBookmarkSpecifics(), "parent"); // The server's update may seem valid to some other client, but on this client @@ -793,7 +796,7 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, TEST_F(DirectoryUpdateHandlerApplyUpdateTest, HierarchyConflictDeleteNonEmptyDirectory) { // Create a server-deleted folder as a child of root node. - int64 parent_handle = + int64_t parent_handle = entry_factory()->CreateSyncedItem("parent", BOOKMARKS, true); { syncable::WriteTransaction trans(FROM_HERE, UNITTEST, directory()); @@ -838,9 +841,9 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, TEST_F(DirectoryUpdateHandlerApplyUpdateTest, HierarchyConflictUnknownParent) { // We shouldn't be able to do anything with either of these items. - int64 x_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t x_handle = entry_factory()->CreateUnappliedNewItemWithParent( "some_item", DefaultBookmarkSpecifics(), "unknown_parent"); - int64 y_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t y_handle = entry_factory()->CreateUnappliedNewItemWithParent( "some_other_item", DefaultBookmarkSpecifics(), "some_item"); sessions::StatusController status; @@ -870,17 +873,17 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, TEST_F(DirectoryUpdateHandlerApplyUpdateTest, ItemsBothKnownAndUnknown) { // See what happens when there's a mixture of good and bad updates. std::string root_server_id = Id::GetRoot().GetServerId(); - int64 u1_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t u1_handle = entry_factory()->CreateUnappliedNewItemWithParent( "first_unknown_item", DefaultBookmarkSpecifics(), "unknown_parent"); - int64 k1_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t k1_handle = entry_factory()->CreateUnappliedNewItemWithParent( "first_known_item", DefaultBookmarkSpecifics(), root_server_id); - int64 u2_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t u2_handle = entry_factory()->CreateUnappliedNewItemWithParent( "second_unknown_item", DefaultBookmarkSpecifics(), "unknown_parent"); - int64 k2_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t k2_handle = entry_factory()->CreateUnappliedNewItemWithParent( "second_known_item", DefaultBookmarkSpecifics(), "first_known_item"); - int64 k3_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t k3_handle = entry_factory()->CreateUnappliedNewItemWithParent( "third_known_item", DefaultBookmarkSpecifics(), "fourth_known_item"); - int64 k4_handle = entry_factory()->CreateUnappliedNewItemWithParent( + int64_t k4_handle = entry_factory()->CreateUnappliedNewItemWithParent( "fourth_known_item", DefaultBookmarkSpecifics(), root_server_id); sessions::StatusController status; @@ -935,7 +938,7 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, DecryptablePassword) { cryptographer->Encrypt(data, specifics.mutable_password()->mutable_encrypted()); - int64 handle = + int64_t handle = entry_factory()->CreateUnappliedNewItem("item", specifics, false); sessions::StatusController status; @@ -961,20 +964,14 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, UndecryptableData) { encrypted_bookmark.mutable_encrypted(); AddDefaultFieldValue(BOOKMARKS, &encrypted_bookmark); std::string root_server_id = Id::GetRoot().GetServerId(); - int64 folder_handle = entry_factory()->CreateUnappliedNewItemWithParent( - "folder", - encrypted_bookmark, - root_server_id); - int64 bookmark_handle = entry_factory()->CreateUnappliedNewItem( - "item2", - encrypted_bookmark, - false); + int64_t folder_handle = entry_factory()->CreateUnappliedNewItemWithParent( + "folder", encrypted_bookmark, root_server_id); + int64_t bookmark_handle = entry_factory()->CreateUnappliedNewItem( + "item2", encrypted_bookmark, false); sync_pb::EntitySpecifics encrypted_password; encrypted_password.mutable_password(); - int64 password_handle = entry_factory()->CreateUnappliedNewItem( - "item3", - encrypted_password, - false); + int64_t password_handle = entry_factory()->CreateUnappliedNewItem( + "item3", encrypted_password, false); sessions::StatusController status; ApplyBookmarkUpdates(&status); @@ -1010,8 +1007,8 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, UndecryptableData) { TEST_F(DirectoryUpdateHandlerApplyUpdateTest, SomeUndecryptablePassword) { Cryptographer* cryptographer; - int64 decryptable_handle = -1; - int64 undecryptable_handle = -1; + int64_t decryptable_handle = -1; + int64_t undecryptable_handle = -1; // Only decryptable password updates should be applied. { @@ -1073,7 +1070,8 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, const bool is_folder = false; sync_pb::EntitySpecifics specifics; *specifics.mutable_article() = sync_pb::ArticleSpecifics(); - int64 handle = entry_factory()->CreateSyncedItem("art1", ARTICLES, is_folder); + int64_t handle = + entry_factory()->CreateSyncedItem("art1", ARTICLES, is_folder); sync_pb::AttachmentIdProto local_attachment_id = CreateAttachmentIdProto(0, 0); @@ -1117,7 +1115,8 @@ TEST_F(DirectoryUpdateHandlerApplyUpdateTest, const bool is_folder = false; sync_pb::EntitySpecifics specifics; *specifics.mutable_article() = sync_pb::ArticleSpecifics(); - int64 handle = entry_factory()->CreateSyncedItem("art1", ARTICLES, is_folder); + int64_t handle = + entry_factory()->CreateSyncedItem("art1", ARTICLES, is_folder); sync_pb::AttachmentIdProto id1 = CreateAttachmentIdProto(0, 0); sync_pb::AttachmentIdProto id2 = CreateAttachmentIdProto(0, 0); diff --git a/sync/engine/entity_tracker.cc b/sync/engine/entity_tracker.cc index 9728d67..a209c09 100644 --- a/sync/engine/entity_tracker.cc +++ b/sync/engine/entity_tracker.cc @@ -4,6 +4,8 @@ #include "sync/engine/entity_tracker.h" +#include <stdint.h> + #include "base/logging.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/non_blocking_sync_common.h" @@ -26,8 +28,8 @@ scoped_ptr<EntityTracker> EntityTracker::FromCommitRequest( EntityTracker::EntityTracker(const std::string& id, const std::string& client_tag_hash, - int64 highest_commit_response_version, - int64 highest_gu_response_version) + int64_t highest_commit_response_version, + int64_t highest_gu_response_version) : id_(id), client_tag_hash_(client_tag_hash), highest_commit_response_version_(highest_commit_response_version), @@ -42,7 +44,7 @@ bool EntityTracker::HasPendingCommit() const { } void EntityTracker::PrepareCommitProto(sync_pb::SyncEntity* commit_entity, - int64* sequence_number) const { + int64_t* sequence_number) const { DCHECK(HasPendingCommit()); DCHECK(!client_tag_hash_.empty()); @@ -115,8 +117,8 @@ void EntityTracker::RequestCommit(const CommitRequestData& data) { } void EntityTracker::ReceiveCommitResponse(const std::string& response_id, - int64 response_version, - int64 sequence_number) { + int64_t response_version, + int64_t sequence_number) { // Commit responses, especially after the first commit, can update our ID. id_ = response_id; @@ -139,7 +141,7 @@ void EntityTracker::ReceiveCommitResponse(const std::string& response_id, ClearPendingCommit(); } -void EntityTracker::ReceiveUpdate(int64 version) { +void EntityTracker::ReceiveUpdate(int64_t version) { if (version <= highest_gu_response_version_) return; diff --git a/sync/engine/entity_tracker.h b/sync/engine/entity_tracker.h index 39898cf..e0e66f6 100644 --- a/sync/engine/entity_tracker.h +++ b/sync/engine/entity_tracker.h @@ -5,9 +5,11 @@ #ifndef SYNC_ENGINE_ENTITY_TRACKER_H_ #define SYNC_ENGINE_ENTITY_TRACKER_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "sync/base/sync_export.h" @@ -47,7 +49,7 @@ class SYNC_EXPORT EntityTracker { // Populates a sync_pb::SyncEntity for a commit. Also sets the // |sequence_number|, so we can track it throughout the commit process. void PrepareCommitProto(sync_pb::SyncEntity* commit_entity, - int64* sequence_number) const; + int64_t* sequence_number) const; // Updates this entity with data from the latest version that the // model asked us to commit. May clobber state related to the @@ -60,11 +62,11 @@ class SYNC_EXPORT EntityTracker { // that our item's state at the end of the commit is the same as it was at // the start. void ReceiveCommitResponse(const std::string& response_id, - int64 response_version, - int64 sequence_number); + int64_t response_version, + int64_t sequence_number); // Handles receipt of an update from the server. - void ReceiveUpdate(int64 version); + void ReceiveUpdate(int64_t version); // Handles the receipt of an pending update from the server. // @@ -85,8 +87,8 @@ class SYNC_EXPORT EntityTracker { // related to a pending commit. EntityTracker(const std::string& id, const std::string& client_tag_hash, - int64 highest_commit_response_version, - int64 highest_gu_response_version); + int64_t highest_commit_response_version, + int64_t highest_gu_response_version); // Checks if the current state indicates a conflict. // @@ -107,18 +109,18 @@ class SYNC_EXPORT EntityTracker { std::string client_tag_hash_; // The highest version seen in a commit response for this entry. - int64 highest_commit_response_version_; + int64_t highest_commit_response_version_; // The highest version seen in a GU response for this entry. - int64 highest_gu_response_version_; + int64_t highest_gu_response_version_; // Used to track in-flight commit requests on the model thread. All we need // to do here is return it back to the model thread when the pending commit // is completed and confirmed. Not valid if no commit is pending. - int64 sequence_number_; + int64_t sequence_number_; // The server version on which this item is based. - int64 base_version_; + int64_t base_version_; // A commit for this entity waiting for a sync cycle to be committed. scoped_ptr<CommitRequestData> pending_commit_; diff --git a/sync/engine/entity_tracker_unittest.cc b/sync/engine/entity_tracker_unittest.cc index 5dd2d38..2589448 100644 --- a/sync/engine/entity_tracker_unittest.cc +++ b/sync/engine/entity_tracker_unittest.cc @@ -5,6 +5,8 @@ #include "sync/engine/entity_tracker.h" +#include <stdint.h> + #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "sync/internal_api/public/base/model_type.h" @@ -39,8 +41,8 @@ class EntityTrackerTest : public ::testing::Test { ~EntityTrackerTest() override {} - CommitRequestData MakeCommitRequestData(int64 sequence_number, - int64 base_version) { + CommitRequestData MakeCommitRequestData(int64_t sequence_number, + int64_t base_version) { EntityData data; data.id = kServerId; data.client_tag_hash = kClientTagHash; @@ -56,7 +58,7 @@ class EntityTrackerTest : public ::testing::Test { return request_data; } - UpdateResponseData MakeUpdateResponseData(int64 response_version) { + UpdateResponseData MakeUpdateResponseData(int64_t response_version) { EntityData data; data.id = kServerId; data.client_tag_hash = kClientTagHash; @@ -87,15 +89,15 @@ TEST_F(EntityTrackerTest, FromUpdateResponse) { // Construct a new entity from a commit request. Then serialize it. TEST_F(EntityTrackerTest, FromCommitRequest) { - const int64 kSequenceNumber = 22; - const int64 kBaseVersion = 33; + const int64_t kSequenceNumber = 22; + const int64_t kBaseVersion = 33; CommitRequestData data = MakeCommitRequestData(kSequenceNumber, kBaseVersion); scoped_ptr<EntityTracker> entity(EntityTracker::FromCommitRequest(data)); entity->RequestCommit(data); ASSERT_TRUE(entity->HasPendingCommit()); sync_pb::SyncEntity pb_entity; - int64 sequence_number = 0; + int64_t sequence_number = 0; entity->PrepareCommitProto(&pb_entity, &sequence_number); EXPECT_EQ(kSequenceNumber, sequence_number); EXPECT_EQ(kServerId, pb_entity.id_string()); diff --git a/sync/engine/get_commit_ids.cc b/sync/engine/get_commit_ids.cc index 5c4d111..85c14d8 100644 --- a/sync/engine/get_commit_ids.cc +++ b/sync/engine/get_commit_ids.cc @@ -4,10 +4,13 @@ #include "sync/engine/get_commit_ids.h" +#include <stddef.h> +#include <stdint.h> + #include <set> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "sync/engine/syncer_util.h" #include "sync/syncable/directory.h" #include "sync/syncable/entry.h" @@ -35,18 +38,17 @@ void FilterUnreadyEntries( ModelTypeSet encrypted_types, bool passphrase_missing, const syncable::Directory::Metahandles& unsynced_handles, - std::set<int64>* ready_unsynced_set); + std::set<int64_t>* ready_unsynced_set); // Given a set of commit metahandles that are ready for commit // (|ready_unsynced_set|), sorts these into commit order and places up to // |max_entries| of them in the output parameter |out|. // // See the header file for an explanation of commit ordering. -void OrderCommitIds( - syncable::BaseTransaction* trans, - size_t max_entries, - const std::set<int64>& ready_unsynced_set, - std::vector<int64>* out); +void OrderCommitIds(syncable::BaseTransaction* trans, + size_t max_entries, + const std::set<int64_t>& ready_unsynced_set, + std::vector<int64_t>* out); } // namespace @@ -59,7 +61,7 @@ void GetCommitIdsForType( // Gather the full set of unsynced items and store it in the session. They // are not in the correct order for commit. - std::set<int64> ready_unsynced_set; + std::set<int64_t> ready_unsynced_set; syncable::Directory::Metahandles all_unsynced_handles; GetUnsyncedEntries(trans, &all_unsynced_handles); @@ -192,7 +194,7 @@ void FilterUnreadyEntries( ModelTypeSet encrypted_types, bool passphrase_missing, const syncable::Directory::Metahandles& unsynced_handles, - std::set<int64>* ready_unsynced_set) { + std::set<int64_t>* ready_unsynced_set) { for (syncable::Directory::Metahandles::const_iterator iter = unsynced_handles.begin(); iter != unsynced_handles.end(); ++iter) { syncable::Entry entry(trans, syncable::GET_BY_HANDLE, *iter); @@ -215,30 +217,29 @@ void FilterUnreadyEntries( // the traversal reaches the desired size before the full traversal is complete. class Traversal { public: - Traversal( - syncable::BaseTransaction* trans, - int64 max_entries, - syncable::Directory::Metahandles* out); + Traversal(syncable::BaseTransaction* trans, + int64_t max_entries, + syncable::Directory::Metahandles* out); ~Traversal(); // First step of traversal building. Adds non-deleted items in order. - void AddCreatesAndMoves(const std::set<int64>& ready_unsynced_set); + void AddCreatesAndMoves(const std::set<int64_t>& ready_unsynced_set); // Second step of traverals building. Appends deleted items. - void AddDeletes(const std::set<int64>& ready_unsynced_set); + void AddDeletes(const std::set<int64_t>& ready_unsynced_set); private: // The following functions do not modify the traversal directly. They return // their results in the |result| vector instead. - bool AddUncommittedParents(const std::set<int64>& ready_unsynced_set, + bool AddUncommittedParents(const std::set<int64_t>& ready_unsynced_set, const syncable::Entry& item, syncable::Directory::Metahandles* result) const; - void TryAddItem(const std::set<int64>& ready_unsynced_set, + void TryAddItem(const std::set<int64_t>& ready_unsynced_set, const syncable::Entry& item, syncable::Directory::Metahandles* result) const; - bool AddDeletedParents(const std::set<int64>& ready_unsynced_set, + bool AddDeletedParents(const std::set<int64_t>& ready_unsynced_set, const syncable::Entry& item, const syncable::Directory::Metahandles& traversed, syncable::Directory::Metahandles* result) const; @@ -249,34 +250,31 @@ class Traversal { bool IsFull() const; // Returns true if the specified handle is already in the traversal. - bool HaveItem(int64 handle) const; + bool HaveItem(int64_t handle) const; // Adds the specified handles to the traversal. void AppendManyToTraversal(const syncable::Directory::Metahandles& handles); // Adds the specifed handle to the traversal. - void AppendToTraversal(int64 handle); + void AppendToTraversal(int64_t handle); syncable::Directory::Metahandles* out_; - std::set<int64> added_handles_; + std::set<int64_t> added_handles_; const size_t max_entries_; syncable::BaseTransaction* trans_; DISALLOW_COPY_AND_ASSIGN(Traversal); }; -Traversal::Traversal( - syncable::BaseTransaction* trans, - int64 max_entries, - syncable::Directory::Metahandles* out) - : out_(out), - max_entries_(max_entries), - trans_(trans) { } +Traversal::Traversal(syncable::BaseTransaction* trans, + int64_t max_entries, + syncable::Directory::Metahandles* out) + : out_(out), max_entries_(max_entries), trans_(trans) {} Traversal::~Traversal() {} bool Traversal::AddUncommittedParents( - const std::set<int64>& ready_unsynced_set, + const std::set<int64_t>& ready_unsynced_set, const syncable::Entry& item, syncable::Directory::Metahandles* result) const { DCHECK(SupportsHierarchy(item)); @@ -287,7 +285,7 @@ bool Traversal::AddUncommittedParents( while (!parent_id.ServerKnows()) { syncable::Entry parent(trans_, syncable::GET_BY_ID, parent_id); CHECK(parent.good()) << "Bad user-only parent in item path."; - int64 handle = parent.GetMetahandle(); + int64_t handle = parent.GetMetahandle(); if (HaveItem(handle)) { // We've already added this parent (and therefore all of its parents). // We can return early. @@ -309,11 +307,11 @@ bool Traversal::AddUncommittedParents( } // Adds the given item to the list if it is unsynced and ready for commit. -void Traversal::TryAddItem(const std::set<int64>& ready_unsynced_set, +void Traversal::TryAddItem(const std::set<int64_t>& ready_unsynced_set, const syncable::Entry& item, syncable::Directory::Metahandles* result) const { DCHECK(item.GetIsUnsynced()); - int64 item_handle = item.GetMetahandle(); + int64_t item_handle = item.GetMetahandle(); if (ready_unsynced_set.count(item_handle) != 0) { result->push_back(item_handle); } @@ -328,7 +326,7 @@ void Traversal::TryAddItem(const std::set<int64>& ready_unsynced_set, // traversal is in top to bottom order. Also note that this function appends // to the result list without clearing it. bool Traversal::AddDeletedParents( - const std::set<int64>& ready_unsynced_set, + const std::set<int64_t>& ready_unsynced_set, const syncable::Entry& item, const syncable::Directory::Metahandles& traversed, syncable::Directory::Metahandles* result) const { @@ -349,7 +347,7 @@ bool Traversal::AddDeletedParents( // needs to be committed first. break; } - int64 handle = parent.GetMetahandle(); + int64_t handle = parent.GetMetahandle(); if (!parent.GetIsUnsynced()) { // In some rare cases, our parent can be both deleted and unsynced. // (ie. the server-unknown parent case). @@ -384,7 +382,7 @@ bool Traversal::IsFull() const { return out_->size() >= max_entries_; } -bool Traversal::HaveItem(int64 handle) const { +bool Traversal::HaveItem(int64_t handle) const { return added_handles_.find(handle) != added_handles_.end(); } @@ -399,17 +397,17 @@ void Traversal::AppendManyToTraversal( added_handles_.insert(handles.begin(), handles.end()); } -void Traversal::AppendToTraversal(int64 metahandle) { +void Traversal::AppendToTraversal(int64_t metahandle) { out_->push_back(metahandle); added_handles_.insert(metahandle); } void Traversal::AddCreatesAndMoves( - const std::set<int64>& ready_unsynced_set) { + const std::set<int64_t>& ready_unsynced_set) { // Add moves and creates, and prepend their uncommitted parents. - for (std::set<int64>::const_iterator iter = ready_unsynced_set.begin(); + for (std::set<int64_t>::const_iterator iter = ready_unsynced_set.begin(); !IsFull() && iter != ready_unsynced_set.end(); ++iter) { - int64 metahandle = *iter; + int64_t metahandle = *iter; if (HaveItem(metahandle)) continue; @@ -439,15 +437,15 @@ void Traversal::AddCreatesAndMoves( out_->resize(max_entries_); } -void Traversal::AddDeletes(const std::set<int64>& ready_unsynced_set) { +void Traversal::AddDeletes(const std::set<int64_t>& ready_unsynced_set) { syncable::Directory::Metahandles deletion_list; // Note: we iterate over all the unsynced set, regardless of the max size. // The max size is only enforced after the top-to-bottom order has been // reversed, in order to ensure children are always deleted before parents. - for (std::set<int64>::const_iterator iter = ready_unsynced_set.begin(); + for (std::set<int64_t>::const_iterator iter = ready_unsynced_set.begin(); iter != ready_unsynced_set.end(); ++iter) { - int64 metahandle = *iter; + int64_t metahandle = *iter; if (HaveItem(metahandle)) continue; @@ -487,11 +485,10 @@ void Traversal::AddDeletes(const std::set<int64>& ready_unsynced_set) { out_->resize(max_entries_); } -void OrderCommitIds( - syncable::BaseTransaction* trans, - size_t max_entries, - const std::set<int64>& ready_unsynced_set, - syncable::Directory::Metahandles* out) { +void OrderCommitIds(syncable::BaseTransaction* trans, + size_t max_entries, + const std::set<int64_t>& ready_unsynced_set, + syncable::Directory::Metahandles* out) { // Commits follow these rules: // 1. Moves or creates are preceded by needed folder creates, from // root to leaf. diff --git a/sync/engine/get_commit_ids.h b/sync/engine/get_commit_ids.h index 4258ca7..9809341 100644 --- a/sync/engine/get_commit_ids.h +++ b/sync/engine/get_commit_ids.h @@ -5,6 +5,9 @@ #ifndef SYNC_ENGINE_GET_COMMIT_IDS_H_ #define SYNC_ENGINE_GET_COMMIT_IDS_H_ +#include <stddef.h> +#include <stdint.h> + #include <vector> #include "sync/base/sync_export.h" @@ -31,7 +34,7 @@ class BaseTransaction; SYNC_EXPORT void GetCommitIdsForType(syncable::BaseTransaction* trans, ModelType type, size_t max_entries, - std::vector<int64>* out); + std::vector<int64_t>* out); } // namespace syncer diff --git a/sync/engine/get_updates_processor.cc b/sync/engine/get_updates_processor.cc index 4fcd058..8bc701f 100644 --- a/sync/engine/get_updates_processor.cc +++ b/sync/engine/get_updates_processor.cc @@ -4,6 +4,8 @@ #include "sync/engine/get_updates_processor.h" +#include <stddef.h> + #include <map> #include "base/trace_event/trace_event.h" diff --git a/sync/engine/get_updates_processor.h b/sync/engine/get_updates_processor.h index 02e4482..519a13a 100644 --- a/sync/engine/get_updates_processor.h +++ b/sync/engine/get_updates_processor.h @@ -8,8 +8,8 @@ #include <map> #include <vector> -#include "base/basictypes.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/engine/model_safe_worker.h" diff --git a/sync/engine/get_updates_processor_unittest.cc b/sync/engine/get_updates_processor_unittest.cc index c89b57d..d6456a5 100644 --- a/sync/engine/get_updates_processor_unittest.cc +++ b/sync/engine/get_updates_processor_unittest.cc @@ -4,8 +4,11 @@ #include "sync/engine/get_updates_processor.h" +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/stl_util.h" #include "sync/engine/get_updates_delegate.h" @@ -26,7 +29,7 @@ namespace syncer { namespace { scoped_ptr<InvalidationInterface> BuildInvalidation( - int64 version, + int64_t version, const std::string& payload) { return MockInvalidation::Build(version, payload); } diff --git a/sync/engine/model_type_worker.cc b/sync/engine/model_type_worker.cc index 991ee82..fa60f91 100644 --- a/sync/engine/model_type_worker.cc +++ b/sync/engine/model_type_worker.cc @@ -4,6 +4,9 @@ #include "sync/engine/model_type_worker.h" +#include <stddef.h> +#include <stdint.h> + #include <utility> #include <vector> @@ -242,7 +245,7 @@ scoped_ptr<CommitContribution> ModelTypeWorker::GetContribution( DCHECK(CalledOnValidThread()); size_t space_remaining = max_entries; - std::vector<int64> sequence_numbers; + std::vector<int64_t> sequence_numbers; google::protobuf::RepeatedPtrField<sync_pb::SyncEntity> commit_entities; if (!CanCommitItems()) @@ -254,7 +257,7 @@ scoped_ptr<CommitContribution> ModelTypeWorker::GetContribution( EntityTracker* entity = it->second.get(); if (entity->HasPendingCommit()) { sync_pb::SyncEntity* commit_entity = commit_entities.Add(); - int64 sequence_number = -1; + int64_t sequence_number = -1; entity->PrepareCommitProto(commit_entity, &sequence_number); HelpInitializeCommitEntity(commit_entity); diff --git a/sync/engine/model_type_worker.h b/sync/engine/model_type_worker.h index a6a1ae8..ee6e3dc 100644 --- a/sync/engine/model_type_worker.h +++ b/sync/engine/model_type_worker.h @@ -5,6 +5,8 @@ #ifndef SYNC_ENGINE_MODEL_TYPE_WORKER_H_ #define SYNC_ENGINE_MODEL_TYPE_WORKER_H_ +#include <stddef.h> + #include <map> #include <string> diff --git a/sync/engine/model_type_worker_unittest.cc b/sync/engine/model_type_worker_unittest.cc index b0f7484..878757d 100644 --- a/sync/engine/model_type_worker_unittest.cc +++ b/sync/engine/model_type_worker_unittest.cc @@ -4,6 +4,9 @@ #include "sync/engine/model_type_worker.h" +#include <stddef.h> +#include <stdint.h> + #include "base/strings/stringprintf.h" #include "sync/engine/commit_contribution.h" #include "sync/internal_api/public/base/model_type.h" @@ -100,10 +103,11 @@ class ModelTypeWorkerTest : public ::testing::Test { // Pretends to receive update messages from the server. void TriggerTypeRootUpdateFromServer(); - void TriggerUpdateFromServer(int64 version_offset, + void TriggerUpdateFromServer(int64_t version_offset, const std::string& tag, const std::string& value); - void TriggerTombstoneFromServer(int64 version_offset, const std::string& tag); + void TriggerTombstoneFromServer(int64_t version_offset, + const std::string& tag); // Delivers specified protos as updates. // @@ -379,7 +383,7 @@ void ModelTypeWorkerTest::TriggerTypeRootUpdateFromServer() { worker_->ApplyUpdates(&dummy_status); } -void ModelTypeWorkerTest::TriggerUpdateFromServer(int64 version_offset, +void ModelTypeWorkerTest::TriggerUpdateFromServer(int64_t version_offset, const std::string& tag, const std::string& value) { sync_pb::SyncEntity entity = mock_server_.UpdateFromServer( @@ -409,7 +413,7 @@ void ModelTypeWorkerTest::DeliverRawUpdates(const SyncEntityList& list) { worker_->ApplyUpdates(&dummy_status); } -void ModelTypeWorkerTest::TriggerTombstoneFromServer(int64 version_offset, +void ModelTypeWorkerTest::TriggerTombstoneFromServer(int64_t version_offset, const std::string& tag) { sync_pb::SyncEntity entity = mock_server_.TombstoneFromServer(version_offset, GenerateTagHash(tag)); @@ -695,7 +699,7 @@ TEST_F(ModelTypeWorkerTest, SimpleDelete) { ASSERT_TRUE(HasCommitResponseOnModelThread("tag1")); const CommitResponseData& initial_commit_response = GetCommitResponseOnModelThread("tag1"); - int64 base_version = initial_commit_response.response_version; + int64_t base_version = initial_commit_response.response_version; // Now that we have an entity, we can delete it. DeleteRequest("tag1"); diff --git a/sync/engine/net/server_connection_manager.cc b/sync/engine/net/server_connection_manager.cc index 2531c97..83fbafe 100644 --- a/sync/engine/net/server_connection_manager.cc +++ b/sync/engine/net/server_connection_manager.cc @@ -5,6 +5,7 @@ #include "sync/engine/net/server_connection_manager.h" #include <errno.h> +#include <stdint.h> #include <ostream> #include <string> @@ -90,8 +91,8 @@ bool ServerConnectionManager::Connection::ReadBufferResponse( if (require_response && (1 > response->content_length)) return false; - const int64 bytes_read = ReadResponse(buffer_out, - static_cast<int>(response->content_length)); + const int64_t bytes_read = + ReadResponse(buffer_out, static_cast<int>(response->content_length)); if (bytes_read != response->content_length) { response->server_status = HttpResponse::IO_ERROR; return false; @@ -102,8 +103,8 @@ bool ServerConnectionManager::Connection::ReadBufferResponse( bool ServerConnectionManager::Connection::ReadDownloadResponse( HttpResponse* response, string* buffer_out) { - const int64 bytes_read = ReadResponse(buffer_out, - static_cast<int>(response->content_length)); + const int64_t bytes_read = + ReadResponse(buffer_out, static_cast<int>(response->content_length)); if (bytes_read != response->content_length) { LOG(ERROR) << "Mismatched content lengths, server claimed " << diff --git a/sync/engine/net/server_connection_manager.h b/sync/engine/net/server_connection_manager.h index f1145b4..6cb653f 100644 --- a/sync/engine/net/server_connection_manager.h +++ b/sync/engine/net/server_connection_manager.h @@ -5,10 +5,13 @@ #ifndef SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ #define SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ +#include <stdint.h> + #include <iosfwd> #include <string> #include "base/atomicops.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/strings/string_util.h" @@ -31,9 +34,9 @@ namespace syncable { class Directory; } -static const int32 kUnsetResponseCode = -1; -static const int32 kUnsetContentLength = -1; -static const int32 kUnsetPayloadLength = -1; +static const int32_t kUnsetResponseCode = -1; +static const int32_t kUnsetContentLength = -1; +static const int32_t kUnsetPayloadLength = -1; // HttpResponse gathers the relevant output properties of an HTTP request. // Depending on the value of the server_status code, response_code, and @@ -73,13 +76,13 @@ struct SYNC_EXPORT HttpResponse { }; // The HTTP Status code. - int64 response_code; + int64_t response_code; // The value of the Content-length header. - int64 content_length; + int64_t content_length; // The size of a download request's payload. - int64 payload_length; + int64_t payload_length; // Identifies the type of failure, if any. ServerConnectionCode server_status; diff --git a/sync/engine/net/url_translator.cc b/sync/engine/net/url_translator.cc index dd0b57e..a6fffdf 100644 --- a/sync/engine/net/url_translator.cc +++ b/sync/engine/net/url_translator.cc @@ -7,7 +7,6 @@ #include "sync/engine/net/url_translator.h" -#include "base/basictypes.h" #include "net/base/escape.h" using std::string; diff --git a/sync/engine/non_blocking_type_commit_contribution.cc b/sync/engine/non_blocking_type_commit_contribution.cc index 55b81e2..5216ed0 100644 --- a/sync/engine/non_blocking_type_commit_contribution.cc +++ b/sync/engine/non_blocking_type_commit_contribution.cc @@ -4,6 +4,9 @@ #include "sync/engine/non_blocking_type_commit_contribution.h" +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include "base/values.h" @@ -16,7 +19,7 @@ namespace syncer_v2 { NonBlockingTypeCommitContribution::NonBlockingTypeCommitContribution( const sync_pb::DataTypeContext& context, const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, - const std::vector<int64>& sequence_numbers, + const std::vector<int64_t>& sequence_numbers, ModelTypeWorker* worker) : worker_(worker), context_(context), diff --git a/sync/engine/non_blocking_type_commit_contribution.h b/sync/engine/non_blocking_type_commit_contribution.h index 41ee4de..f0fddcf 100644 --- a/sync/engine/non_blocking_type_commit_contribution.h +++ b/sync/engine/non_blocking_type_commit_contribution.h @@ -5,9 +5,12 @@ #ifndef SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_ #define SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_ +#include <stddef.h> +#include <stdint.h> + #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "sync/engine/commit_contribution.h" #include "sync/protocol/sync.pb.h" @@ -24,7 +27,7 @@ class NonBlockingTypeCommitContribution : public syncer::CommitContribution { NonBlockingTypeCommitContribution( const sync_pb::DataTypeContext& context, const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, - const std::vector<int64>& sequence_numbers, + const std::vector<int64_t>& sequence_numbers, ModelTypeWorker* worker); ~NonBlockingTypeCommitContribution() override; @@ -48,7 +51,7 @@ class NonBlockingTypeCommitContribution : public syncer::CommitContribution { // The sequence numbers associated with the pending commits. These match up // with the entities_ vector. - const std::vector<int64> sequence_numbers_; + const std::vector<int64_t> sequence_numbers_; // The index in the commit message where this contribution's entities are // added. Used to correlate per-item requests with per-item responses. diff --git a/sync/engine/process_updates_util.cc b/sync/engine/process_updates_util.cc index 1ad577a..d91d0eb 100644 --- a/sync/engine/process_updates_util.cc +++ b/sync/engine/process_updates_util.cc @@ -4,6 +4,9 @@ #include "sync/engine/process_updates_util.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include "base/location.h" @@ -51,7 +54,7 @@ namespace { // For more information, see FindLocalIdToUpdate(). bool UpdateContainsNewVersion(syncable::BaseTransaction *trans, const sync_pb::SyncEntity &update) { - int64 existing_version = -1; // The server always sends positive versions. + int64_t existing_version = -1; // The server always sends positive versions. syncable::Entry existing_entry(trans, GET_BY_ID, SyncableIdFromProto(update.id_string())); if (existing_entry.good()) @@ -319,7 +322,7 @@ void ProcessDownloadedUpdates( void ExpireEntriesByVersion(syncable::Directory* dir, syncable::ModelNeutralWriteTransaction* trans, ModelType type, - int64 version_watermark) { + int64_t version_watermark) { syncable::Directory::Metahandles handles; dir->GetMetaHandlesOfType(trans, type, &handles); for (size_t i = 0; i < handles.size(); ++i) { diff --git a/sync/engine/process_updates_util.h b/sync/engine/process_updates_util.h index 9564d86..48fa802 100644 --- a/sync/engine/process_updates_util.h +++ b/sync/engine/process_updates_util.h @@ -5,6 +5,8 @@ #ifndef SYNC_ENGINE_PROCESS_UPDATES_UTIL_H_ #define SYNC_ENGINE_PROCESS_UPDATES_UTIL_H_ +#include <stdint.h> + #include <vector> #include "sync/internal_api/public/base/model_type.h" @@ -42,7 +44,7 @@ void ProcessDownloadedUpdates( void ExpireEntriesByVersion(syncable::Directory* dir, syncable::ModelNeutralWriteTransaction* trans, ModelType type, - int64 version_watermark); + int64_t version_watermark); } // namespace syncer diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h index acfad93..ee8c4c71 100644 --- a/sync/engine/sync_scheduler_impl.h +++ b/sync/engine/sync_scheduler_impl.h @@ -12,6 +12,7 @@ #include "base/cancelable_callback.h" #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/linked_ptr.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc index ea07b4a..4d20717 100644 --- a/sync/engine/sync_scheduler_unittest.cc +++ b/sync/engine/sync_scheduler_unittest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include "base/bind.h" #include "base/callback.h" #include "base/compiler_specific.h" @@ -238,7 +241,7 @@ class SyncSchedulerTest : public testing::Test { } static scoped_ptr<InvalidationInterface> BuildInvalidation( - int64 version, + int64_t version, const std::string& payload) { return MockInvalidation::Build(version, payload); } diff --git a/sync/engine/syncer.h b/sync/engine/syncer.h index 9285967..926e0d6 100644 --- a/sync/engine/syncer.h +++ b/sync/engine/syncer.h @@ -5,12 +5,14 @@ #ifndef SYNC_ENGINE_SYNCER_H_ #define SYNC_ENGINE_SYNCER_H_ +#include <stdint.h> + #include <utility> #include <vector> -#include "base/basictypes.h" #include "base/callback.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/synchronization/lock.h" #include "sync/base/sync_export.h" #include "sync/engine/conflict_resolver.h" @@ -36,7 +38,7 @@ class GetUpdatesProcessor; // lock contention, or on tasks posted to other threads. class SYNC_EXPORT Syncer { public: - typedef std::vector<int64> UnsyncedMetaHandles; + typedef std::vector<int64_t> UnsyncedMetaHandles; explicit Syncer(CancelationSignal* cancelation_signal); virtual ~Syncer(); diff --git a/sync/engine/syncer_proto_util.h b/sync/engine/syncer_proto_util.h index 76082c7..3fbc821 100644 --- a/sync/engine/syncer_proto_util.h +++ b/sync/engine/syncer_proto_util.h @@ -8,6 +8,7 @@ #include <string> #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/time/time.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" diff --git a/sync/engine/syncer_proto_util_unittest.cc b/sync/engine/syncer_proto_util_unittest.cc index ae55378..3b40427 100644 --- a/sync/engine/syncer_proto_util_unittest.cc +++ b/sync/engine/syncer_proto_util_unittest.cc @@ -6,7 +6,6 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/message_loop/message_loop.h" #include "base/time/time.h" diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc index ccf3e2f..073ac51 100644 --- a/sync/engine/syncer_unittest.cc +++ b/sync/engine/syncer_unittest.cc @@ -5,6 +5,9 @@ // Syncer unit tests. Unfortunately a lot of these tests // are outdated and need to be reworked and updated. +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <limits> #include <list> @@ -17,6 +20,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_number_conversions.h" @@ -501,14 +505,14 @@ class SyncerTest : public testing::Test, return "kqyg7097kro6GSUod+GSg=="; } - int64 CreateUnsyncedDirectory(const string& entry_name, - const string& idstring) { + int64_t CreateUnsyncedDirectory(const string& entry_name, + const string& idstring) { return CreateUnsyncedDirectory(entry_name, syncable::Id::CreateFromServerId(idstring)); } - int64 CreateUnsyncedDirectory(const string& entry_name, - const syncable::Id& id) { + int64_t CreateUnsyncedDirectory(const string& entry_name, + const syncable::Id& id) { WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); MutableEntry entry( &wtrans, CREATE, BOOKMARKS, wtrans.root_id(), entry_name); @@ -1933,7 +1937,7 @@ TEST_F(SyncerTest, TestCommitListOrderingAndNewParentAndChild) { parent.PutBaseVersion(1); } - int64 meta_handle_b; + int64_t meta_handle_b; const Id parent2_local_id = ids_.NewLocalId(); const Id child_local_id = ids_.NewLocalId(); { @@ -2005,8 +2009,8 @@ TEST_F(SyncerTest, TestBasicUpdate) { string id = "some_id"; string parent_id = "0"; string name = "in_root"; - int64 version = 10; - int64 timestamp = 10; + int64_t version = 10; + int64_t timestamp = 10; mock_server_->AddUpdateDirectory(id, parent_id, name, version, timestamp, foreign_cache_guid(), "-1"); @@ -2178,7 +2182,7 @@ TEST_F(SyncerTest, IllegalAndLegalUpdates) { // its parent. TEST_F(SyncerTest, CommitReuniteUpdateAdjustsChildren) { // Create a folder in the root. - int64 metahandle_folder; + int64_t metahandle_folder; { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry( @@ -2192,7 +2196,7 @@ TEST_F(SyncerTest, CommitReuniteUpdateAdjustsChildren) { // Verify it and pull the ID out of the folder. syncable::Id folder_id; - int64 metahandle_entry; + int64_t metahandle_entry; { syncable::ReadTransaction trans(FROM_HERE, directory()); Entry entry(&trans, GET_BY_HANDLE, metahandle_folder); @@ -2224,8 +2228,8 @@ TEST_F(SyncerTest, CommitReuniteUpdateAdjustsChildren) { } // Now, to emulate a commit response failure, we just don't commit it. - int64 new_version = 150; // any larger value. - int64 timestamp = 20; // arbitrary value. + int64_t new_version = 150; // any larger value. + int64_t timestamp = 20; // arbitrary value. syncable::Id new_folder_id = syncable::Id::CreateFromServerId("folder_server_id"); @@ -2269,7 +2273,7 @@ TEST_F(SyncerTest, CommitReuniteUpdateAdjustsChildren) { // its parent. TEST_F(SyncerTest, CommitReuniteUpdate) { // Create an entry in the root. - int64 entry_metahandle; + int64_t entry_metahandle; { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&trans, CREATE, BOOKMARKS, trans.root_id(), "new_entry"); @@ -2291,8 +2295,8 @@ TEST_F(SyncerTest, CommitReuniteUpdate) { } // Now, to emulate a commit response failure, we just don't commit it. - int64 new_version = 150; // any larger value. - int64 timestamp = 20; // arbitrary value. + int64_t new_version = 150; // any larger value. + int64_t timestamp = 20; // arbitrary value. syncable::Id new_entry_id = syncable::Id::CreateFromServerId("server_id"); // Generate an update from the server with a relevant ID reassignment. @@ -2322,7 +2326,7 @@ TEST_F(SyncerTest, CommitReuniteUpdate) { // finish, that must be cleaned up on the server side after some time. TEST_F(SyncerTest, CommitReuniteUpdateDoesNotChokeOnDeletedLocalEntry) { // Create a entry in the root. - int64 entry_metahandle; + int64_t entry_metahandle; { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&trans, CREATE, BOOKMARKS, trans.root_id(), "new_entry"); @@ -2342,8 +2346,8 @@ TEST_F(SyncerTest, CommitReuniteUpdateDoesNotChokeOnDeletedLocalEntry) { } // Now, to emulate a commit response failure, we just don't commit it. - int64 new_version = 150; // any larger value. - int64 timestamp = 20; // arbitrary value. + int64_t new_version = 150; // any larger value. + int64_t timestamp = 20; // arbitrary value. syncable::Id new_entry_id = syncable::Id::CreateFromServerId("server_id"); // Generate an update from the server with a relevant ID reassignment. @@ -2541,7 +2545,7 @@ TEST_F(SyncerTest, NegativeIDInUpdate) { } TEST_F(SyncerTest, UnappliedUpdateOnCreatedItemItemDoesNotCrash) { - int64 metahandle_fred; + int64_t metahandle_fred; syncable::Id orig_id; { // Create an item. @@ -2624,7 +2628,7 @@ TEST_F(SyncerTest, DoublyChangedWithResolver) { TEST_F(SyncerTest, CommitsUpdateDoesntAlterEntry) { const base::Time& test_time = ProtoTimeToTime(123456); syncable::Id local_id; - int64 entry_metahandle; + int64_t entry_metahandle; { WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&wtrans, CREATE, BOOKMARKS, root_id_, "Pete"); @@ -2639,7 +2643,7 @@ TEST_F(SyncerTest, CommitsUpdateDoesntAlterEntry) { } EXPECT_TRUE(SyncShareNudge()); syncable::Id id; - int64 version; + int64_t version; { syncable::ReadTransaction trans(FROM_HERE, directory()); Entry entry(&trans, syncable::GET_BY_HANDLE, entry_metahandle); @@ -2713,7 +2717,7 @@ TEST_F(SyncerTest, ParentAndChildBothMatch) { EXPECT_EQ(1u, children.size()); directory()->GetChildHandlesById(&trans, parent_id, &children); EXPECT_EQ(1u, children.size()); - std::vector<int64> unapplied; + std::vector<int64_t> unapplied; directory()->GetUnappliedUpdateMetaHandles(&trans, all_types, &unapplied); EXPECT_EQ(0u, unapplied.size()); syncable::Directory::Metahandles unsynced; @@ -2773,7 +2777,7 @@ TEST_F(SyncerTest, UnappliedUpdateDuringCommit) { // if no syncing occured midway, bob will have an illegal parent TEST_F(SyncerTest, DeletingEntryInFolder) { // This test is a little fake. - int64 existing_metahandle; + int64_t existing_metahandle; { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&trans, CREATE, BOOKMARKS, trans.root_id(), "existing"); @@ -2849,7 +2853,7 @@ TEST_F(SyncerTest, ConflictWithImplicitParent) { } TEST_F(SyncerTest, DeletingEntryWithLocalEdits) { - int64 newfolder_metahandle; + int64_t newfolder_metahandle; mock_server_->AddUpdateDirectory(1, 0, "bob", 1, 10, foreign_cache_guid(), "-1"); @@ -2950,11 +2954,11 @@ TEST_F(SyncerTest, NameCollidingFolderSwapWorksFine) { // we post more than one commit command to the server. This test makes // sure that scenario works as expected. TEST_F(SyncerTest, CommitManyItemsInOneGo_Success) { - uint32 num_batches = 3; - uint32 items_to_commit = kDefaultMaxCommitBatchSize * num_batches; + uint32_t num_batches = 3; + uint32_t items_to_commit = kDefaultMaxCommitBatchSize * num_batches; { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); - for (uint32 i = 0; i < items_to_commit; i++) { + for (uint32_t i = 0; i < items_to_commit; i++) { string nameutf8 = base::UintToString(i); string name(nameutf8.begin(), nameutf8.end()); MutableEntry e(&trans, CREATE, BOOKMARKS, trans.root_id(), name); @@ -2973,11 +2977,11 @@ TEST_F(SyncerTest, CommitManyItemsInOneGo_Success) { // Test that a single failure to contact the server will cause us to exit the // commit loop immediately. TEST_F(SyncerTest, CommitManyItemsInOneGo_PostBufferFail) { - uint32 num_batches = 3; - uint32 items_to_commit = kDefaultMaxCommitBatchSize * num_batches; + uint32_t num_batches = 3; + uint32_t items_to_commit = kDefaultMaxCommitBatchSize * num_batches; { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); - for (uint32 i = 0; i < items_to_commit; i++) { + for (uint32_t i = 0; i < items_to_commit; i++) { string nameutf8 = base::UintToString(i); string name(nameutf8.begin(), nameutf8.end()); MutableEntry e(&trans, CREATE, BOOKMARKS, trans.root_id(), name); @@ -3003,11 +3007,11 @@ TEST_F(SyncerTest, CommitManyItemsInOneGo_PostBufferFail) { // Test that a single conflict response from the server will cause us to exit // the commit loop immediately. TEST_F(SyncerTest, CommitManyItemsInOneGo_CommitConflict) { - uint32 num_batches = 2; - uint32 items_to_commit = kDefaultMaxCommitBatchSize * num_batches; + uint32_t num_batches = 2; + uint32_t items_to_commit = kDefaultMaxCommitBatchSize * num_batches; { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); - for (uint32 i = 0; i < items_to_commit; i++) { + for (uint32_t i = 0; i < items_to_commit; i++) { string nameutf8 = base::UintToString(i); string name(nameutf8.begin(), nameutf8.end()); MutableEntry e(&trans, CREATE, BOOKMARKS, trans.root_id(), name); @@ -3254,7 +3258,7 @@ TEST_F(SyncerTest, NewEntryAndAlteredServerEntrySharePath) { mock_server_->AddUpdateBookmark(1, 0, "Foo.htm", 10, 10, foreign_cache_guid(), "-1"); EXPECT_TRUE(SyncShareNudge()); - int64 local_folder_handle; + int64_t local_folder_handle; syncable::Id local_folder_id; { WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); @@ -3321,7 +3325,7 @@ TEST_F(SyncerTest, NewEntryAndAlteredServerEntrySharePath_OldBookmarksProto) { mock_server_->AddUpdateBookmark(1, 0, "Foo.htm", 10, 10, foreign_cache_guid(), "-1"); EXPECT_TRUE(SyncShareNudge()); - int64 local_folder_handle; + int64_t local_folder_handle; syncable::Id local_folder_id; { WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); @@ -3467,7 +3471,7 @@ TEST_F(SyncerTest, DualDeletionWithNewItemNameClash) { // existing server id and preserve the old version, simply updating the server // version with the new non-deleted entity. TEST_F(SyncerTest, ResolveWeWroteTheyDeleted) { - int64 bob_metahandle; + int64_t bob_metahandle; mock_server_->AddUpdateBookmark(1, 0, "bob", 1, 10, foreign_cache_guid(), "-1"); @@ -3736,7 +3740,7 @@ TEST_F(SyncerTest, TestUndeleteUpdate) { mock_server_->SetLastUpdateDeleted(); EXPECT_TRUE(SyncShareNudge()); - int64 metahandle; + int64_t metahandle; { syncable::ReadTransaction trans(FROM_HERE, directory()); Entry entry(&trans, GET_BY_ID, ids_.FromNumber(2)); @@ -3830,8 +3834,8 @@ TEST_F(SyncerTest, DirectoryUpdateTest) { TEST_F(SyncerTest, DirectoryCommitTest) { syncable::Id in_root_id, in_dir_id; - int64 foo_metahandle; - int64 bar_metahandle; + int64_t foo_metahandle; + int64_t bar_metahandle; { WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); @@ -3989,11 +3993,11 @@ TEST_F(SyncerTest, EnsureWeSendUpOldParent) { } TEST_F(SyncerTest, Test64BitVersionSupport) { - int64 really_big_int = std::numeric_limits<int64>::max() - 12; + int64_t really_big_int = std::numeric_limits<int64_t>::max() - 12; const string name("ringo's dang orang ran rings around my o-ring"); - int64 item_metahandle; + int64_t item_metahandle; - // Try writing max int64 to the version fields of a meta entry. + // Try writing max int64_t to the version fields of a meta entry. { WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&wtrans, CREATE, BOOKMARKS, wtrans.root_id(), name); @@ -4003,7 +4007,7 @@ TEST_F(SyncerTest, Test64BitVersionSupport) { entry.PutId(ids_.NewServerId()); item_metahandle = entry.GetMetahandle(); } - // Now read it back out and make sure the value is max int64. + // Now read it back out and make sure the value is max int64_t. syncable::ReadTransaction rtrans(FROM_HERE, directory()); Entry entry(&rtrans, syncable::GET_BY_HANDLE, item_metahandle); ASSERT_TRUE(entry.good()); @@ -4210,7 +4214,7 @@ TEST_F(SyncerTest, ClientTagIllegalUpdateIgnored) { } TEST_F(SyncerTest, ClientTagUncommittedTagMatchesUpdate) { - int64 original_metahandle = 0; + int64_t original_metahandle = 0; { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); @@ -4323,8 +4327,8 @@ TEST_F(SyncerTest, ClientTagUpdateClashesWithLocalEntry) { mock_server_->set_conflict_all_commits(true); EXPECT_TRUE(SyncShareNudge()); - int64 tag1_metahandle = syncable::kInvalidMetaHandle; - int64 tag2_metahandle = syncable::kInvalidMetaHandle; + int64_t tag1_metahandle = syncable::kInvalidMetaHandle; + int64_t tag2_metahandle = syncable::kInvalidMetaHandle; // This should cause client tag overwrite. { syncable::ReadTransaction trans(FROM_HERE, directory()); @@ -4555,7 +4559,7 @@ TEST_F(SyncerTest, EntryWithParentIdUpdatedWithEntryWithoutParentId) { TEST_F(SyncerTest, UniqueServerTagUpdates) { // As a hurdle, introduce an item whose name is the same as the tag value // we'll use later. - int64 hurdle_handle = CreateUnsyncedDirectory("bob", "id_bob"); + int64_t hurdle_handle = CreateUnsyncedDirectory("bob", "id_bob"); { syncable::ReadTransaction trans(FROM_HERE, directory()); Entry hurdle(&trans, GET_BY_HANDLE, hurdle_handle); @@ -4642,7 +4646,7 @@ TEST_F(SyncerTest, UpdateThenCommit) { mock_server_->AddUpdateDirectory(to_receive, ids_.root(), "x", 1, 10, foreign_cache_guid(), "-1"); - int64 commit_handle = CreateUnsyncedDirectory("y", to_commit); + int64_t commit_handle = CreateUnsyncedDirectory("y", to_commit); EXPECT_TRUE(SyncShareNudge()); // The sync cycle should have included a GetUpdate, then a commit. By the @@ -4673,7 +4677,7 @@ TEST_F(SyncerTest, UpdateFailsThenDontCommit) { mock_server_->AddUpdateDirectory(to_receive, ids_.root(), "x", 1, 10, foreign_cache_guid(), "-1"); - int64 commit_handle = CreateUnsyncedDirectory("y", to_commit); + int64_t commit_handle = CreateUnsyncedDirectory("y", to_commit); mock_server_->FailNextPostBufferToPathCall(); EXPECT_FALSE(SyncShareNudge()); @@ -4877,7 +4881,7 @@ class SyncerBookmarksTest : public SyncerTest { entry.PutDirtySync(true); } - int64 GetMetahandleOfTag() { + int64_t GetMetahandleOfTag() { syncable::ReadTransaction trans(FROM_HERE, directory()); Entry entry(&trans, GET_BY_HANDLE, metahandle_); EXPECT_TRUE(entry.good()); @@ -4976,7 +4980,7 @@ class SyncerBookmarksTest : public SyncerTest { protected: syncable::Id local_id_; - int64 metahandle_; + int64_t metahandle_; }; TEST_F(SyncerBookmarksTest, CreateSyncThenDeleteSync) { @@ -5124,7 +5128,7 @@ class SyncerUndeletionTest : public SyncerTest { entry.PutDirtySync(true); } - int64 GetMetahandleOfTag() { + int64_t GetMetahandleOfTag() { syncable::ReadTransaction trans(FROM_HERE, directory()); Entry entry(&trans, GET_BY_CLIENT_TAG, client_tag_); EXPECT_TRUE(entry.good()); @@ -5214,7 +5218,7 @@ class SyncerUndeletionTest : public SyncerTest { protected: const std::string client_tag_; syncable::Id local_id_; - int64 metahandle_; + int64_t metahandle_; }; TEST_F(SyncerUndeletionTest, UndeleteDuringCommit) { diff --git a/sync/engine/syncer_util.cc b/sync/engine/syncer_util.cc index 6cd66b0..bb05885 100644 --- a/sync/engine/syncer_util.cc +++ b/sync/engine/syncer_util.cc @@ -4,6 +4,8 @@ #include "sync/engine/syncer_util.h" +#include <stdint.h> + #include <algorithm> #include <set> #include <string> @@ -138,8 +140,8 @@ syncable::Id FindLocalIdToUpdate( // If it exists, then our local client lost a commit response. Use // the local entry. if (local_entry.good() && !local_entry.GetIsDel()) { - int64 old_version = local_entry.GetBaseVersion(); - int64 new_version = update.version(); + int64_t old_version = local_entry.GetBaseVersion(); + int64_t new_version = update.version(); DCHECK_LE(old_version, 0); DCHECK_GT(new_version, 0); // Otherwise setting the base version could cause a consistency failure. diff --git a/sync/engine/syncer_util.h b/sync/engine/syncer_util.h index 9b84bae..f915ba7 100644 --- a/sync/engine/syncer_util.h +++ b/sync/engine/syncer_util.h @@ -8,6 +8,8 @@ #ifndef SYNC_ENGINE_SYNCER_UTIL_H_ #define SYNC_ENGINE_SYNCER_UTIL_H_ +#include <stdint.h> + #include <set> #include <string> #include <vector> @@ -53,7 +55,7 @@ UpdateAttemptResponse AttemptToUpdateEntry( // Returns the most accurate position information available in this update. It // prefers to use the unique_position() field, but will fall back to using the -// int64-based position_in_parent if necessary. +// int64_t-based position_in_parent if necessary. // // The suffix parameter is the unique bookmark tag for the item being updated. // diff --git a/sync/engine/syncer_util_unittest.cc b/sync/engine/syncer_util_unittest.cc index b4026d0..5551d82 100644 --- a/sync/engine/syncer_util_unittest.cc +++ b/sync/engine/syncer_util_unittest.cc @@ -4,6 +4,8 @@ #include "sync/engine/syncer_util.h" +#include <stdint.h> + #include "base/rand_util.h" #include "sync/internal_api/public/base/unique_position.h" #include "sync/internal_api/public/test/test_entry_factory.h" @@ -62,7 +64,7 @@ class GetUpdatePositionTest : public ::testing::Test { test_position.ToProto(update.mutable_unique_position()); } - void InitInt64Position(int64 pos_value) { + void InitInt64Position(int64_t pos_value) { update.set_position_in_parent(pos_value); } @@ -125,13 +127,13 @@ TEST_F(GetUpdatePositionTest, FromProto) { std::string suffix = GetUniqueBookmarkTagFromUpdate(update); - // The proto position is not set, so we should get one based on the int64. + // The proto position is not set, so we should get one based on the int64_t. // It should not match the proto we defined in the test harness. UniquePosition int64_pos = GetUpdatePosition(update, suffix); EXPECT_FALSE(int64_pos.Equals(test_position)); // Move the test harness' position value into the update proto. - // Expect that it takes precedence over the int64-based position. + // Expect that it takes precedence over the int64_t-based position. InitProtoPosition(); UniquePosition pos = GetUpdatePosition(update, suffix); EXPECT_TRUE(pos.Equals(test_position)); @@ -162,7 +164,7 @@ TEST_F(GetUpdatePositionTest, UpdateServerFieldsFromUpdateTest) { InitSuffixIngredients(); // Initialize update with valid data. std::string root_server_id = syncable::Id::GetRoot().GetServerId(); - int64 handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( + int64_t handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( "I", DefaultBookmarkSpecifics(), root_server_id); syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, directory()); @@ -185,7 +187,7 @@ TEST_F(GetUpdatePositionTest, UpdateServerFieldsFromInvalidUpdateTest) { // Do not initialize data in update, update is invalid. std::string root_server_id = syncable::Id::GetRoot().GetServerId(); - int64 handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( + int64_t handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( "I", DefaultBookmarkSpecifics(), root_server_id); syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, directory()); @@ -211,7 +213,7 @@ TEST_F(GetUpdatePositionTest, UpdateServerFieldsFromInvalidUniquePositionTest) { invalid_update.set_allocated_unique_position(invalid_position); std::string root_server_id = syncable::Id::GetRoot().GetServerId(); - int64 handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( + int64_t handle = entry_factory()->CreateUnappliedNewBookmarkItemWithParent( "I", DefaultBookmarkSpecifics(), root_server_id); syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, directory()); diff --git a/sync/engine/update_applicator.cc b/sync/engine/update_applicator.cc index e8731ce..5699639 100644 --- a/sync/engine/update_applicator.cc +++ b/sync/engine/update_applicator.cc @@ -4,6 +4,8 @@ #include "sync/engine/update_applicator.h" +#include <stdint.h> + #include <vector> #include "base/logging.h" @@ -45,14 +47,14 @@ UpdateApplicator::~UpdateApplicator() { // access to all the Nigori keys. There's nothing we can do about them here. void UpdateApplicator::AttemptApplications( syncable::WriteTransaction* trans, - const std::vector<int64>& handles) { - std::vector<int64> to_apply = handles; + const std::vector<int64_t>& handles) { + std::vector<int64_t> to_apply = handles; DVLOG(1) << "UpdateApplicator running over " << to_apply.size() << " items."; while (!to_apply.empty()) { - std::vector<int64> to_reapply; + std::vector<int64_t> to_reapply; - for (std::vector<int64>::iterator i = to_apply.begin(); + for (std::vector<int64_t>::iterator i = to_apply.begin(); i != to_apply.end(); ++i) { syncable::MutableEntry entry(trans, syncable::GET_BY_HANDLE, *i); UpdateAttemptResponse result = AttemptToUpdateEntry( diff --git a/sync/engine/update_applicator.h b/sync/engine/update_applicator.h index 1fc8bb8..4cb885a 100644 --- a/sync/engine/update_applicator.h +++ b/sync/engine/update_applicator.h @@ -11,13 +11,15 @@ #ifndef SYNC_ENGINE_UPDATE_APPLICATOR_H_ #define SYNC_ENGINE_UPDATE_APPLICATOR_H_ +#include <stdint.h> + #include <set> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "sync/internal_api/public/engine/model_safe_worker.h" -#include "sync/syncable/syncable_id.h" #include "sync/sessions/status_controller.h" +#include "sync/syncable/syncable_id.h" namespace syncer { @@ -40,7 +42,7 @@ class UpdateApplicator { // Attempt to apply the specified updates. void AttemptApplications(syncable::WriteTransaction* trans, - const std::vector<int64>& handles); + const std::vector<int64_t>& handles); int updates_applied() { return updates_applied_; diff --git a/sync/internal_api/attachments/attachment_downloader_impl.cc b/sync/internal_api/attachments/attachment_downloader_impl.cc index 2915296..b1e2153 100644 --- a/sync/internal_api/attachments/attachment_downloader_impl.cc +++ b/sync/internal_api/attachments/attachment_downloader_impl.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/attachments/attachment_downloader_impl.h" +#include <stdint.h> + #include "base/base64.h" #include "base/bind.h" #include "base/message_loop/message_loop.h" diff --git a/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc b/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc index 6574cb1..a2cb0b9 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 <stdint.h> + #include <map> #include "base/bind.h" diff --git a/sync/internal_api/attachments/attachment_service_impl.cc b/sync/internal_api/attachments/attachment_service_impl.cc index be5af27..6b0e606 100644 --- a/sync/internal_api/attachments/attachment_service_impl.cc +++ b/sync/internal_api/attachments/attachment_service_impl.cc @@ -7,6 +7,7 @@ #include <iterator> #include "base/bind.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/thread_task_runner_handle.h" #include "base/time/time.h" diff --git a/sync/internal_api/attachments/attachment_service_impl_unittest.cc b/sync/internal_api/attachments/attachment_service_impl_unittest.cc index f5fbdc8..a044a22 100644 --- a/sync/internal_api/attachments/attachment_service_impl_unittest.cc +++ b/sync/internal_api/attachments/attachment_service_impl_unittest.cc @@ -10,6 +10,7 @@ #include <vector> #include "base/bind.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" diff --git a/sync/internal_api/attachments/attachment_uploader_impl.cc b/sync/internal_api/attachments/attachment_uploader_impl.cc index d67a977..735af8c 100644 --- a/sync/internal_api/attachments/attachment_uploader_impl.cc +++ b/sync/internal_api/attachments/attachment_uploader_impl.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" +#include <stdint.h> + #include <string> #include <vector> diff --git a/sync/internal_api/attachments/attachment_util.cc b/sync/internal_api/attachments/attachment_util.cc index 08d7f99..c2debca 100644 --- a/sync/internal_api/attachments/attachment_util.cc +++ b/sync/internal_api/attachments/attachment_util.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/attachments/attachment_util.h" +#include <stdint.h> + #include "base/memory/ref_counted_memory.h" #include "third_party/leveldatabase/src/util/crc32c.h" diff --git a/sync/internal_api/attachments/on_disk_attachment_store.cc b/sync/internal_api/attachments/on_disk_attachment_store.cc index a9bab47..c579c45 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 <stdint.h> + #include <string> #include "base/bind.h" @@ -34,7 +36,7 @@ const char kMetadataPrefix[] = "metadata-"; const char kDatabaseMetadataKey[] = "database-metadata"; -const int32 kCurrentSchemaVersion = 1; +const int32_t kCurrentSchemaVersion = 1; const base::FilePath::CharType kLeveldbDirectory[] = FILE_PATH_LITERAL("leveldb"); 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 1f3ede6..09142e5 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 <stdint.h> + #include <string> #include "base/files/file_path.h" diff --git a/sync/internal_api/base_node.cc b/sync/internal_api/base_node.cc index caaf4ee..bde209f 100644 --- a/sync/internal_api/base_node.cc +++ b/sync/internal_api/base_node.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/base_node.h" +#include <stdint.h> + #include <stack> #include "base/strings/string_number_conversions.h" @@ -31,10 +33,10 @@ namespace syncer { using syncable::SPECIFICS; -// Helper function to look up the int64 metahandle of an object given the ID +// Helper function to look up the int64_t metahandle of an object given the ID // string. -static int64 IdToMetahandle(syncable::BaseTransaction* trans, - const syncable::Id& id) { +static int64_t IdToMetahandle(syncable::BaseTransaction* trans, + const syncable::Id& id) { if (id.IsNull()) return kInvalidId; syncable::Entry entry(trans, syncable::GET_BY_ID, id); @@ -140,12 +142,12 @@ const sync_pb::EntitySpecifics& BaseNode::GetUnencryptedSpecifics( } } -int64 BaseNode::GetParentId() const { +int64_t BaseNode::GetParentId() const { return IdToMetahandle(GetTransaction()->GetWrappedTrans(), GetEntry()->GetParentId()); } -int64 BaseNode::GetId() const { +int64_t BaseNode::GetId() const { return GetEntry()->GetMetahandle(); } @@ -186,28 +188,28 @@ bool BaseNode::HasChildren() const { return dir->HasChildren(trans, GetEntry()->GetId()); } -int64 BaseNode::GetPredecessorId() const { +int64_t BaseNode::GetPredecessorId() const { syncable::Id id_string = GetEntry()->GetPredecessorId(); if (id_string.IsNull()) return kInvalidId; return IdToMetahandle(GetTransaction()->GetWrappedTrans(), id_string); } -int64 BaseNode::GetSuccessorId() const { +int64_t BaseNode::GetSuccessorId() const { syncable::Id id_string = GetEntry()->GetSuccessorId(); if (id_string.IsNull()) return kInvalidId; return IdToMetahandle(GetTransaction()->GetWrappedTrans(), id_string); } -int64 BaseNode::GetFirstChildId() const { +int64_t BaseNode::GetFirstChildId() const { syncable::Id id_string = GetEntry()->GetFirstChildId(); if (id_string.IsNull()) return kInvalidId; return IdToMetahandle(GetTransaction()->GetWrappedTrans(), id_string); } -void BaseNode::GetChildIds(std::vector<int64>* result) const { +void BaseNode::GetChildIds(std::vector<int64_t>* result) const { GetEntry()->GetChildHandles(result); } @@ -223,7 +225,7 @@ base::DictionaryValue* BaseNode::ToValue() const { return GetEntry()->ToValue(GetTransaction()->GetCryptographer()); } -int64 BaseNode::GetExternalId() const { +int64_t BaseNode::GetExternalId() const { return GetEntry()->GetLocalExternalId(); } diff --git a/sync/internal_api/change_reorder_buffer.cc b/sync/internal_api/change_reorder_buffer.cc index c585bd78..72af337 100644 --- a/sync/internal_api/change_reorder_buffer.cc +++ b/sync/internal_api/change_reorder_buffer.cc @@ -4,11 +4,14 @@ #include "sync/internal_api/change_reorder_buffer.h" +#include <stdint.h> + #include <limits> #include <queue> #include <set> #include <utility> // for pair<> +#include "base/macros.h" #include "sync/internal_api/public/base_node.h" #include "sync/internal_api/public/base_transaction.h" #include "sync/syncable/entry.h" @@ -29,24 +32,23 @@ namespace syncer { // methods can be used to explore the nodes in root-to-leaf order. class ChangeReorderBuffer::Traversal { public: - typedef pair<int64, int64> ParentChildLink; + typedef pair<int64_t, int64_t> ParentChildLink; typedef set<ParentChildLink> LinkSet; Traversal() : top_(kInvalidId) { } // Expand the traversal so that it includes the node indicated by // |child_handle|. - void ExpandToInclude(syncable::BaseTransaction* trans, - int64 child_handle) { + void ExpandToInclude(syncable::BaseTransaction* trans, int64_t child_handle) { // If |top_| is invalid, this is the first insertion -- easy. if (top_ == kInvalidId) { top_ = child_handle; return; } - int64 node_to_include = child_handle; + int64_t node_to_include = child_handle; while (node_to_include != kInvalidId && node_to_include != top_) { - int64 node_parent = 0; + int64_t node_parent = 0; syncable::Entry node(trans, syncable::GET_BY_HANDLE, node_to_include); CHECK(node.good()); @@ -87,20 +89,20 @@ class ChangeReorderBuffer::Traversal { // Return the top node of the traversal. Use this as a starting point // for walking the tree. - int64 top() const { return top_; } + int64_t top() const { return top_; } // Return an iterator corresponding to the first child (in the traversal) // of the node specified by |parent_id|. Iterate this return value until // it is equal to the value returned by end_children(parent_id). The // enumeration thus provided is unordered. - LinkSet::const_iterator begin_children(int64 parent_id) const { + LinkSet::const_iterator begin_children(int64_t parent_id) const { return links_.upper_bound( - ParentChildLink(parent_id, numeric_limits<int64>::min())); + ParentChildLink(parent_id, numeric_limits<int64_t>::min())); } // Return an iterator corresponding to the last child in the traversal // of the node specified by |parent_id|. - LinkSet::const_iterator end_children(int64 parent_id) const { + LinkSet::const_iterator end_children(int64_t parent_id) const { return begin_children(parent_id + 1); } @@ -109,7 +111,7 @@ class ChangeReorderBuffer::Traversal { // and thus the first node to be traversed. If the traversal is empty, // this is kInvalidId. If the traversal contains exactly one member, |top_| // will be the solitary member, and |links_| will be empty. - int64 top_; + int64_t top_; // A set of single-level links that compose the traversal below |top_|. The // (parent, child) ordering of values enables efficient lookup of children // given the parent handle, which is used for top-down traversal. |links_| @@ -127,26 +129,26 @@ ChangeReorderBuffer::ChangeReorderBuffer() { ChangeReorderBuffer::~ChangeReorderBuffer() { } -void ChangeReorderBuffer::PushAddedItem(int64 id) { +void ChangeReorderBuffer::PushAddedItem(int64_t id) { operations_[id] = ChangeRecord::ACTION_ADD; } -void ChangeReorderBuffer::PushDeletedItem(int64 id) { +void ChangeReorderBuffer::PushDeletedItem(int64_t id) { operations_[id] = ChangeRecord::ACTION_DELETE; } -void ChangeReorderBuffer::PushUpdatedItem(int64 id) { +void ChangeReorderBuffer::PushUpdatedItem(int64_t id) { operations_[id] = ChangeRecord::ACTION_UPDATE; } void ChangeReorderBuffer::SetExtraDataForId( - int64 id, + int64_t id, ExtraPasswordChangeRecordData* extra) { extra_data_[id] = make_linked_ptr<ExtraPasswordChangeRecordData>(extra); } void ChangeReorderBuffer::SetSpecificsForId( - int64 id, + int64_t id, const sync_pb::EntitySpecifics& specifics) { specifics_[id] = specifics; } @@ -189,10 +191,10 @@ bool ChangeReorderBuffer::GetAllChangesInTreeOrder( } // Step 2: Breadth-first expansion of the traversal. - queue<int64> to_visit; + queue<int64_t> to_visit; to_visit.push(traversal.top()); while (!to_visit.empty()) { - int64 next = to_visit.front(); + int64_t next = to_visit.front(); to_visit.pop(); // If the node has an associated action, output a change record. diff --git a/sync/internal_api/change_reorder_buffer.h b/sync/internal_api/change_reorder_buffer.h index c1c577d..a1917f3 100644 --- a/sync/internal_api/change_reorder_buffer.h +++ b/sync/internal_api/change_reorder_buffer.h @@ -9,10 +9,13 @@ #ifndef SYNC_INTERNAL_API_CHANGE_REORDER_BUFFER_H_ #define SYNC_INTERNAL_API_CHANGE_REORDER_BUFFER_H_ +#include <stdint.h> + #include <map> #include <vector> #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/linked_ptr.h" #include "sync/internal_api/public/change_record.h" #include "sync/protocol/sync.pb.h" @@ -38,19 +41,19 @@ class ChangeReorderBuffer { // Insert an item, identified by the metahandle |id|, into the reorder buffer. // This item will appear in the output list as an ACTION_ADD ChangeRecord. - void PushAddedItem(int64 id); + void PushAddedItem(int64_t id); // Insert an item, identified by the metahandle |id|, into the reorder buffer. // This item will appear in the output list as an ACTION_DELETE ChangeRecord. - void PushDeletedItem(int64 id); + void PushDeletedItem(int64_t id); // Insert an item, identified by the metahandle |id|, into the reorder buffer. // This item will appear in the output list as an ACTION_UPDATE ChangeRecord. - void PushUpdatedItem(int64 id); + void PushUpdatedItem(int64_t id); - void SetExtraDataForId(int64 id, ExtraPasswordChangeRecordData* extra); + void SetExtraDataForId(int64_t id, ExtraPasswordChangeRecordData* extra); - void SetSpecificsForId(int64 id, const sync_pb::EntitySpecifics& specifics); + void SetSpecificsForId(int64_t id, const sync_pb::EntitySpecifics& specifics); // Reset the buffer, forgetting any pushed items, so that it can be used again // to reorder a new set of changes. @@ -68,9 +71,9 @@ class ChangeReorderBuffer { private: class Traversal; - typedef std::map<int64, ChangeRecord::Action> OperationMap; - typedef std::map<int64, sync_pb::EntitySpecifics> SpecificsMap; - typedef std::map<int64, linked_ptr<ExtraPasswordChangeRecordData> > + typedef std::map<int64_t, ChangeRecord::Action> OperationMap; + typedef std::map<int64_t, sync_pb::EntitySpecifics> SpecificsMap; + typedef std::map<int64_t, linked_ptr<ExtraPasswordChangeRecordData>> ExtraDataMap; // Stores the items that have been pushed into the buffer, and the type of diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc index 28965d2..8c73f21 100644 --- a/sync/internal_api/debug_info_event_listener.cc +++ b/sync/internal_api/debug_info_event_listener.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/debug_info_event_listener.h" +#include <stddef.h> + #include "sync/util/cryptographer.h" namespace syncer { diff --git a/sync/internal_api/debug_info_event_listener.h b/sync/internal_api/debug_info_event_listener.h index 952eedc..63548f2 100644 --- a/sync/internal_api/debug_info_event_listener.h +++ b/sync/internal_api/debug_info_event_listener.h @@ -11,6 +11,7 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/data_type_debug_info_listener.h" diff --git a/sync/internal_api/delete_journal.cc b/sync/internal_api/delete_journal.cc index 5db0963..6b8d955 100644 --- a/sync/internal_api/delete_journal.cc +++ b/sync/internal_api/delete_journal.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/delete_journal.h" +#include <stdint.h> + #include <set> #include <string> @@ -19,7 +21,7 @@ void DeleteJournal::GetBookmarkDeleteJournals( syncer::syncable::EntryKernelSet deleted_entries; trans->GetDirectory()->delete_journal()->GetDeleteJournals( trans->GetWrappedTrans(), BOOKMARKS, &deleted_entries); - std::set<int64> undecryptable_journal; + std::set<int64_t> undecryptable_journal; for (syncer::syncable::EntryKernelSet::const_iterator i = deleted_entries.begin(); i != deleted_entries.end(); ++i) { delete_journal_list->push_back(BookmarkDeleteJournal()); @@ -55,7 +57,7 @@ void DeleteJournal::GetBookmarkDeleteJournals( // static void DeleteJournal::PurgeDeleteJournals(BaseTransaction* trans, - const std::set<int64>& ids) { + const std::set<int64_t>& ids) { trans->GetDirectory()->delete_journal()->PurgeDeleteJournals( trans->GetWrappedTrans(), ids); } diff --git a/sync/internal_api/events/commit_request_event.cc b/sync/internal_api/events/commit_request_event.cc index df55c7b..808181c 100644 --- a/sync/internal_api/events/commit_request_event.cc +++ b/sync/internal_api/events/commit_request_event.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/events/commit_request_event.h" +#include <stddef.h> + #include "base/format_macros.h" #include "base/strings/stringprintf.h" #include "sync/protocol/proto_value_conversions.h" diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc index 133a509..842adf3 100644 --- a/sync/internal_api/http_bridge.cc +++ b/sync/internal_api/http_bridge.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/http_bridge.h" +#include <stddef.h> +#include <stdint.h> + #include <vector> #include "base/message_loop/message_loop.h" @@ -47,16 +50,17 @@ bool IsSyncHttpContentCompressionEnabled() { return StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE); } -void RecordSyncRequestContentLengthHistograms(int64 compressed_content_length, - int64 original_content_length) { +void RecordSyncRequestContentLengthHistograms(int64_t compressed_content_length, + int64_t original_content_length) { UMA_HISTOGRAM_COUNTS("Sync.RequestContentLength.Compressed", compressed_content_length); UMA_HISTOGRAM_COUNTS("Sync.RequestContentLength.Original", original_content_length); } -void RecordSyncResponseContentLengthHistograms(int64 compressed_content_length, - int64 original_content_length) { +void RecordSyncResponseContentLengthHistograms( + int64_t compressed_content_length, + int64_t original_content_length) { UMA_HISTOGRAM_COUNTS("Sync.ResponseContentLength.Compressed", compressed_content_length); UMA_HISTOGRAM_COUNTS("Sync.ResponseContentLength.Original", @@ -326,7 +330,7 @@ void HttpBridge::MakeAsynchronousPost() { fetch_state_.url_poster->SetRequestContext(request_context_getter_.get()); fetch_state_.url_poster->SetExtraRequestHeaders(extra_headers_); - int64 compressed_content_size = 0; + int64_t compressed_content_size = 0; if (IsSyncHttpContentCompressionEnabled()) { std::string compressed_request_content; GzipCompress(request_content_, &compressed_request_content); @@ -452,8 +456,8 @@ void HttpBridge::OnURLFetchComplete(const net::URLFetcher* source) { fetch_state_.response_headers = source->GetResponseHeaders(); UpdateNetworkTime(); - int64 compressed_content_length = fetch_state_.response_content.size(); - int64 original_content_length = compressed_content_length; + int64_t compressed_content_length = fetch_state_.response_content.size(); + int64_t original_content_length = compressed_content_length; if (fetch_state_.response_headers && fetch_state_.response_headers->HasHeaderValue("content-encoding", "gzip")) { @@ -475,7 +479,8 @@ void HttpBridge::OnURLFetchComplete(const net::URLFetcher* source) { } void HttpBridge::OnURLFetchDownloadProgress(const net::URLFetcher* source, - int64 current, int64 total) { + int64_t current, + int64_t total) { DCHECK(network_task_runner_->BelongsToCurrentThread()); // Reset the delay when forward progress is made. base::AutoLock lock(fetch_state_lock_); @@ -484,7 +489,8 @@ void HttpBridge::OnURLFetchDownloadProgress(const net::URLFetcher* source, } void HttpBridge::OnURLFetchUploadProgress(const net::URLFetcher* source, - int64 current, int64 total) { + int64_t current, + int64_t total) { DCHECK(network_task_runner_->BelongsToCurrentThread()); // Reset the delay when forward progress is made. base::AutoLock lock(fetch_state_lock_); @@ -537,7 +543,7 @@ void HttpBridge::UpdateNetworkTime() { return; } - int64 sane_time_ms = 0; + int64_t sane_time_ms = 0; if (base::StringToInt64(sane_time_str, &sane_time_ms)) { network_time_update_callback_.Run( base::Time::FromJsTime(sane_time_ms), diff --git a/sync/internal_api/http_bridge_unittest.cc b/sync/internal_api/http_bridge_unittest.cc index 13c9142..d61f644 100644 --- a/sync/internal_api/http_bridge_unittest.cc +++ b/sync/internal_api/http_bridge_unittest.cc @@ -2,11 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include "base/metrics/field_trial.h" #include "base/strings/stringprintf.h" #include "base/synchronization/waitable_event.h" #include "base/test/mock_entropy_provider.h" #include "base/threading/thread.h" +#include "build/build_config.h" #include "net/http/http_response_headers.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/url_request/test_url_fetcher_factory.h" @@ -79,9 +83,9 @@ int GzipUncompressHelper(Bytef* dest, } // Returns the uncompressed size from GZIP-compressed |compressed_data|. -uint32 GetUncompressedSize(const std::string& compressed_data) { +uint32_t GetUncompressedSize(const std::string& compressed_data) { // The uncompressed size is stored in the last 4 bytes of |input| in LE. - uint32 size; + uint32_t size; if (compressed_data.length() < sizeof(size)) return 0; memcpy(&size, &compressed_data[compressed_data.length() - sizeof(size)], diff --git a/sync/internal_api/js_mutation_event_observer.cc b/sync/internal_api/js_mutation_event_observer.cc index b40693b..857d723 100644 --- a/sync/internal_api/js_mutation_event_observer.cc +++ b/sync/internal_api/js_mutation_event_observer.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/js_mutation_event_observer.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include "base/location.h" @@ -45,7 +48,7 @@ const size_t kChangeLimit = 100; void JsMutationEventObserver::OnChangesApplied( ModelType model_type, - int64 write_transaction_id, + int64_t write_transaction_id, const ImmutableChangeRecordList& changes) { if (!event_handler_.IsInitialized()) { return; diff --git a/sync/internal_api/js_mutation_event_observer.h b/sync/internal_api/js_mutation_event_observer.h index e274c55..da8529d 100644 --- a/sync/internal_api/js_mutation_event_observer.h +++ b/sync/internal_api/js_mutation_event_observer.h @@ -5,10 +5,12 @@ #ifndef SYNC_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ #define SYNC_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" #include "sync/base/sync_export.h" @@ -44,7 +46,7 @@ class SYNC_EXPORT JsMutationEventObserver // SyncManager::ChangeObserver implementation. void OnChangesApplied(ModelType model_type, - int64 write_transaction_id, + int64_t write_transaction_id, const ImmutableChangeRecordList& changes) override; void OnChangesComplete(ModelType model_type) override; diff --git a/sync/internal_api/js_mutation_event_observer_unittest.cc b/sync/internal_api/js_mutation_event_observer_unittest.cc index fb7daf9..2f0ff5d 100644 --- a/sync/internal_api/js_mutation_event_observer_unittest.cc +++ b/sync/internal_api/js_mutation_event_observer_unittest.cc @@ -4,7 +4,7 @@ #include "sync/internal_api/js_mutation_event_observer.h" -#include "base/basictypes.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/values.h" #include "sync/internal_api/public/base/model_type.h" diff --git a/sync/internal_api/js_sync_encryption_handler_observer.h b/sync/internal_api/js_sync_encryption_handler_observer.h index 89ff9d0..1c29204 100644 --- a/sync/internal_api/js_sync_encryption_handler_observer.h +++ b/sync/internal_api/js_sync_encryption_handler_observer.h @@ -7,8 +7,8 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/sync_encryption_handler.h" #include "sync/internal_api/public/util/weak_handle.h" diff --git a/sync/internal_api/js_sync_encryption_handler_observer_unittest.cc b/sync/internal_api/js_sync_encryption_handler_observer_unittest.cc index 4232279..30d9b00 100644 --- a/sync/internal_api/js_sync_encryption_handler_observer_unittest.cc +++ b/sync/internal_api/js_sync_encryption_handler_observer_unittest.cc @@ -4,7 +4,6 @@ #include "sync/internal_api/js_sync_encryption_handler_observer.h" -#include "base/basictypes.h" #include "base/location.h" #include "base/run_loop.h" #include "base/values.h" diff --git a/sync/internal_api/js_sync_manager_observer.h b/sync/internal_api/js_sync_manager_observer.h index 4fa9e10..a8241fe 100644 --- a/sync/internal_api/js_sync_manager_observer.h +++ b/sync/internal_api/js_sync_manager_observer.h @@ -7,8 +7,8 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/sync_manager.h" #include "sync/internal_api/public/util/weak_handle.h" diff --git a/sync/internal_api/js_sync_manager_observer_unittest.cc b/sync/internal_api/js_sync_manager_observer_unittest.cc index ec5c4a3..4054b9f 100644 --- a/sync/internal_api/js_sync_manager_observer_unittest.cc +++ b/sync/internal_api/js_sync_manager_observer_unittest.cc @@ -6,7 +6,6 @@ #include <vector> -#include "base/basictypes.h" #include "base/location.h" #include "base/run_loop.h" #include "base/values.h" diff --git a/sync/internal_api/model_type_entity.cc b/sync/internal_api/model_type_entity.cc index cbfe00c..c489425 100644 --- a/sync/internal_api/model_type_entity.cc +++ b/sync/internal_api/model_type_entity.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/model_type_entity.h" +#include <stdint.h> + #include "base/base64.h" #include "base/sha1.h" #include "base/time/time.h" @@ -58,11 +60,11 @@ bool ModelTypeEntity::RequiresCommitRequest() const { return metadata_.sequence_number() > commit_requested_sequence_number_; } -bool ModelTypeEntity::UpdateIsReflection(int64 update_version) const { +bool ModelTypeEntity::UpdateIsReflection(int64_t update_version) const { return metadata_.server_version() >= update_version; } -bool ModelTypeEntity::UpdateIsInConflict(int64 update_version) const { +bool ModelTypeEntity::UpdateIsInConflict(int64_t update_version) const { return IsUnsynced() && !UpdateIsReflection(update_version); } @@ -154,8 +156,8 @@ void ModelTypeEntity::SetCommitRequestInProgress() { void ModelTypeEntity::ReceiveCommitResponse( const std::string& id, - int64 sequence_number, - int64 response_version, + int64_t sequence_number, + int64_t response_version, const std::string& encryption_key_name) { // The server can assign us a new ID in a commit response. metadata_.set_server_id(id); diff --git a/sync/internal_api/model_type_entity_unittest.cc b/sync/internal_api/model_type_entity_unittest.cc index 08de2fc..68390434 100644 --- a/sync/internal_api/model_type_entity_unittest.cc +++ b/sync/internal_api/model_type_entity_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/model_type_entity.h" +#include <stdint.h> + #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "sync/internal_api/public/base/model_type.h" @@ -69,7 +71,7 @@ class ModelTypeEntityTest : public ::testing::Test { } scoped_ptr<ModelTypeEntity> NewServerItem( - int64 version, + int64_t version, const sync_pb::EntitySpecifics& specifics) { scoped_ptr<ModelTypeEntity> entity(NewServerItem()); ApplyUpdateFromServer(entity.get(), version, specifics); @@ -77,13 +79,13 @@ class ModelTypeEntityTest : public ::testing::Test { } void ApplyUpdateFromServer(ModelTypeEntity* entity, - int64 version, + int64_t version, const sync_pb::EntitySpecifics& specifics) { ApplyUpdateFromServer(entity, version, specifics, kMtime); } void ApplyUpdateFromServer(ModelTypeEntity* entity, - int64 version, + int64_t version, const sync_pb::EntitySpecifics& specifics, base::Time mtime) { EntityData data; diff --git a/sync/internal_api/protocol_event_buffer.cc b/sync/internal_api/protocol_event_buffer.cc index 3d76bd9..962a0bd 100644 --- a/sync/internal_api/protocol_event_buffer.cc +++ b/sync/internal_api/protocol_event_buffer.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/protocol_event_buffer.h" +#include <stddef.h> + #include "sync/internal_api/public/events/protocol_event.h" namespace syncer { diff --git a/sync/internal_api/protocol_event_buffer.h b/sync/internal_api/protocol_event_buffer.h index 88efb41..71a9c64 100644 --- a/sync/internal_api/protocol_event_buffer.h +++ b/sync/internal_api/protocol_event_buffer.h @@ -5,8 +5,11 @@ #ifndef SYNC_INTERNAL_API_PROTOCOL_EVENT_BUFFER_H_ #define SYNC_INTERNAL_API_PROTOCOL_EVENT_BUFFER_H_ +#include <stddef.h> + #include <deque> +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "sync/base/sync_export.h" diff --git a/sync/internal_api/protocol_event_buffer_unittest.cc b/sync/internal_api/protocol_event_buffer_unittest.cc index 7aa924a..ced9a25c4 100644 --- a/sync/internal_api/protocol_event_buffer_unittest.cc +++ b/sync/internal_api/protocol_event_buffer_unittest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/time/time.h" @@ -18,8 +21,8 @@ class ProtocolEventBufferTest : public ::testing::Test { ProtocolEventBufferTest(); ~ProtocolEventBufferTest() override; - static scoped_ptr<ProtocolEvent> MakeTestEvent(int64 id); - static bool HasId(const ProtocolEvent& event, int64 id); + static scoped_ptr<ProtocolEvent> MakeTestEvent(int64_t id); + static bool HasId(const ProtocolEvent& event, int64_t id); protected: ProtocolEventBuffer buffer_; @@ -29,7 +32,7 @@ ProtocolEventBufferTest::ProtocolEventBufferTest() {} ProtocolEventBufferTest::~ProtocolEventBufferTest() {} -scoped_ptr<ProtocolEvent> ProtocolEventBufferTest::MakeTestEvent(int64 id) { +scoped_ptr<ProtocolEvent> ProtocolEventBufferTest::MakeTestEvent(int64_t id) { sync_pb::ClientToServerMessage message; return scoped_ptr<ProtocolEvent>( new PollGetUpdatesRequestEvent( @@ -37,7 +40,7 @@ scoped_ptr<ProtocolEvent> ProtocolEventBufferTest::MakeTestEvent(int64 id) { message)); } -bool ProtocolEventBufferTest::HasId(const ProtocolEvent& event, int64 id) { +bool ProtocolEventBufferTest::HasId(const ProtocolEvent& event, int64_t id) { return event.GetTimestamp() == base::Time::FromInternalValue(id); } @@ -58,7 +61,7 @@ TEST_F(ProtocolEventBufferTest, AddThenReturnEvents) { TEST_F(ProtocolEventBufferTest, AddThenOverflowThenReturnEvents) { for (size_t i = 0; i < ProtocolEventBuffer::kBufferSize+1; ++i) { - scoped_ptr<ProtocolEvent> e(MakeTestEvent(static_cast<int64>(i))); + scoped_ptr<ProtocolEvent> e(MakeTestEvent(static_cast<int64_t>(i))); buffer_.RecordProtocolEvent(*e); } @@ -67,8 +70,7 @@ TEST_F(ProtocolEventBufferTest, AddThenOverflowThenReturnEvents) { ASSERT_EQ(ProtocolEventBuffer::kBufferSize, buffered_events.size()); for (size_t i = 1; i < ProtocolEventBuffer::kBufferSize+1; ++i) { - EXPECT_TRUE( - HasId(*(buffered_events[i-1]), static_cast<int64>(i))); + EXPECT_TRUE(HasId(*(buffered_events[i - 1]), static_cast<int64_t>(i))); } } diff --git a/sync/internal_api/public/attachments/attachment_downloader_impl.h b/sync/internal_api/public/attachments/attachment_downloader_impl.h index d13fc5d..a78912f 100644 --- a/sync/internal_api/public/attachments/attachment_downloader_impl.h +++ b/sync/internal_api/public/attachments/attachment_downloader_impl.h @@ -5,11 +5,14 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ +#include <stdint.h> + #include <string> #include <vector> #include "base/containers/scoped_ptr_hash_map.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/threading/non_thread_safe.h" #include "google_apis/gaia/oauth2_token_service_request.h" #include "net/url_request/url_fetcher_delegate.h" diff --git a/sync/internal_api/public/attachments/attachment_service.h b/sync/internal_api/public/attachments/attachment_service.h index 6d061b6..e039c3a 100644 --- a/sync/internal_api/public/attachments/attachment_service.h +++ b/sync/internal_api/public/attachments/attachment_service.h @@ -5,7 +5,6 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_H_ -#include "base/basictypes.h" #include "base/callback.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" diff --git a/sync/internal_api/public/attachments/attachment_service_impl.h b/sync/internal_api/public/attachments/attachment_service_impl.h index 04b4121..a00fca5 100644 --- a/sync/internal_api/public/attachments/attachment_service_impl.h +++ b/sync/internal_api/public/attachments/attachment_service_impl.h @@ -7,6 +7,7 @@ #include <deque> +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" diff --git a/sync/internal_api/public/attachments/attachment_service_proxy.h b/sync/internal_api/public/attachments/attachment_service_proxy.h index f7d1b3c..107576b 100644 --- a/sync/internal_api/public/attachments/attachment_service_proxy.h +++ b/sync/internal_api/public/attachments/attachment_service_proxy.h @@ -5,8 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_H_ -#include "base/basictypes.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner.h" diff --git a/sync/internal_api/public/attachments/attachment_service_proxy_for_test.h b/sync/internal_api/public/attachments/attachment_service_proxy_for_test.h index 47a990b..811c97d 100644 --- a/sync/internal_api/public/attachments/attachment_service_proxy_for_test.h +++ b/sync/internal_api/public/attachments/attachment_service_proxy_for_test.h @@ -5,6 +5,7 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_FOR_TEST_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_FOR_TEST_H_ +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "sync/base/sync_export.h" diff --git a/sync/internal_api/public/attachments/attachment_store_frontend.h b/sync/internal_api/public/attachments/attachment_store_frontend.h index 051920d..49a447d 100644 --- a/sync/internal_api/public/attachments/attachment_store_frontend.h +++ b/sync/internal_api/public/attachments/attachment_store_frontend.h @@ -5,6 +5,7 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_STORE_FRONTEND_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_STORE_FRONTEND_H_ +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" diff --git a/sync/internal_api/public/attachments/attachment_uploader.h b/sync/internal_api/public/attachments/attachment_uploader.h index 0339e67..5362d22 100644 --- a/sync/internal_api/public/attachments/attachment_uploader.h +++ b/sync/internal_api/public/attachments/attachment_uploader.h @@ -5,7 +5,6 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_H_ -#include "base/basictypes.h" #include "base/callback.h" #include "base/memory/scoped_ptr.h" #include "sync/api/attachments/attachment.h" diff --git a/sync/internal_api/public/attachments/attachment_uploader_impl.h b/sync/internal_api/public/attachments/attachment_uploader_impl.h index bada41e..4f0fa83 100644 --- a/sync/internal_api/public/attachments/attachment_uploader_impl.h +++ b/sync/internal_api/public/attachments/attachment_uploader_impl.h @@ -5,9 +5,12 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ +#include <stdint.h> + #include <string> #include "base/containers/scoped_ptr_hash_map.h" +#include "base/macros.h" #include "base/threading/non_thread_safe.h" #include "google_apis/gaia/oauth2_token_service_request.h" #include "net/url_request/url_request_context_getter.h" diff --git a/sync/internal_api/public/attachments/attachment_util.h b/sync/internal_api/public/attachments/attachment_util.h index e0def04..4cda236 100644 --- a/sync/internal_api/public/attachments/attachment_util.h +++ b/sync/internal_api/public/attachments/attachment_util.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UTIL_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UTIL_H_ +#include <stdint.h> + #include "base/memory/ref_counted.h" #include "sync/base/sync_export.h" diff --git a/sync/internal_api/public/attachments/fake_attachment_downloader.h b/sync/internal_api/public/attachments/fake_attachment_downloader.h index 576d06b..f590711 100644 --- a/sync/internal_api/public/attachments/fake_attachment_downloader.h +++ b/sync/internal_api/public/attachments/fake_attachment_downloader.h @@ -5,6 +5,7 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_FAKE_ATTACHMENT_DOWNLOADER_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_FAKE_ATTACHMENT_DOWNLOADER_H_ +#include "base/macros.h" #include "base/threading/non_thread_safe.h" #include "sync/internal_api/public/attachments/attachment_downloader.h" diff --git a/sync/internal_api/public/attachments/fake_attachment_uploader.h b/sync/internal_api/public/attachments/fake_attachment_uploader.h index 74f2a1f..601f777 100644 --- a/sync/internal_api/public/attachments/fake_attachment_uploader.h +++ b/sync/internal_api/public/attachments/fake_attachment_uploader.h @@ -5,6 +5,7 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_FAKE_ATTACHMENT_UPLOADER_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_FAKE_ATTACHMENT_UPLOADER_H_ +#include "base/macros.h" #include "base/threading/non_thread_safe.h" #include "sync/internal_api/public/attachments/attachment_uploader.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 5f74d8c..7ae1f5d 100644 --- a/sync/internal_api/public/attachments/in_memory_attachment_store.h +++ b/sync/internal_api/public/attachments/in_memory_attachment_store.h @@ -8,6 +8,7 @@ #include <map> #include <set> +#include "base/macros.h" #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 0906f50..4e9fe8d 100644 --- a/sync/internal_api/public/attachments/on_disk_attachment_store.h +++ b/sync/internal_api/public/attachments/on_disk_attachment_store.h @@ -8,6 +8,7 @@ #include <string> #include "base/files/file_path.h" +#include "base/macros.h" #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/task_queue.h b/sync/internal_api/public/attachments/task_queue.h index c46ce85..0d76b91 100644 --- a/sync/internal_api/public/attachments/task_queue.h +++ b/sync/internal_api/public/attachments/task_queue.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_ +#include <stddef.h> + #include <deque> #include <set> diff --git a/sync/internal_api/public/base/attachment_id_proto.cc b/sync/internal_api/public/base/attachment_id_proto.cc index 7d9cc59..3166b10 100644 --- a/sync/internal_api/public/base/attachment_id_proto.cc +++ b/sync/internal_api/public/base/attachment_id_proto.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/base/attachment_id_proto.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include "base/guid.h" diff --git a/sync/internal_api/public/base/attachment_id_proto.h b/sync/internal_api/public/base/attachment_id_proto.h index bd2a346..f2b49b5 100644 --- a/sync/internal_api/public/base/attachment_id_proto.h +++ b/sync/internal_api/public/base/attachment_id_proto.h @@ -5,7 +5,9 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_ATTACHMENT_ID_PROTO_H_ #define SYNC_INTERNAL_API_PUBLIC_BASE_ATTACHMENT_ID_PROTO_H_ -#include "base/basictypes.h" +#include <stddef.h> +#include <stdint.h> + #include "sync/base/sync_export.h" #include "sync/protocol/sync.pb.h" diff --git a/sync/internal_api/public/base/enum_set.h b/sync/internal_api/public/base/enum_set.h index 4061a03..df5bcd0 100644 --- a/sync/internal_api/public/base/enum_set.h +++ b/sync/internal_api/public/base/enum_set.h @@ -9,7 +9,6 @@ #include <cstddef> #include <string> -#include "base/basictypes.h" #include "base/logging.h" namespace syncer { diff --git a/sync/internal_api/public/base/enum_set_unittest.cc b/sync/internal_api/public/base/enum_set_unittest.cc index d4692a60..1719226 100644 --- a/sync/internal_api/public/base/enum_set_unittest.cc +++ b/sync/internal_api/public/base/enum_set_unittest.cc @@ -4,7 +4,8 @@ #include "sync/internal_api/public/base/enum_set.h" -#include "base/basictypes.h" +#include <stddef.h> + #include "testing/gtest/include/gtest/gtest.h" namespace syncer { diff --git a/sync/internal_api/public/base/invalidation_interface.h b/sync/internal_api/public/base/invalidation_interface.h index 2efddd6..9726797 100644 --- a/sync/internal_api/public/base/invalidation_interface.h +++ b/sync/internal_api/public/base/invalidation_interface.h @@ -5,9 +5,10 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_INTERFACE_H_ #define SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_INTERFACE_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "sync/base/sync_export.h" namespace syncer { @@ -36,7 +37,7 @@ class SYNC_EXPORT InvalidationInterface { // // It is preferable to use the LessThan() function, which handles unknown // versions properly, rather than this function. - virtual int64 GetVersion() const = 0; + virtual int64_t GetVersion() const = 0; // This function will be called when the invalidation has been handled // successfully. diff --git a/sync/internal_api/public/base/model_type_test_util.cc b/sync/internal_api/public/base/model_type_test_util.cc index 8c1164b..d2924fa 100644 --- a/sync/internal_api/public/base/model_type_test_util.cc +++ b/sync/internal_api/public/base/model_type_test_util.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "sync/internal_api/public/base/model_type_test_util.h" namespace syncer { diff --git a/sync/internal_api/public/base/node_ordinal.cc b/sync/internal_api/public/base/node_ordinal.cc index 446486f..21ce8f2 100644 --- a/sync/internal_api/public/base/node_ordinal.cc +++ b/sync/internal_api/public/base/node_ordinal.cc @@ -4,13 +4,16 @@ #include "sync/internal_api/public/base/node_ordinal.h" +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <string> namespace syncer { -NodeOrdinal Int64ToNodeOrdinal(int64 x) { - uint64 y = static_cast<uint64>(x); +NodeOrdinal Int64ToNodeOrdinal(int64_t x) { + uint64_t y = static_cast<uint64_t>(x); y ^= 0x8000000000000000ULL; std::string bytes(NodeOrdinal::kMinLength, '\x00'); if (y == 0) { @@ -18,7 +21,7 @@ NodeOrdinal Int64ToNodeOrdinal(int64 x) { bytes.push_back('\x80'); } else { for (int i = 7; i >= 0; --i) { - bytes[i] = static_cast<uint8>(y); + bytes[i] = static_cast<uint8_t>(y); y >>= 8; } } @@ -27,8 +30,8 @@ NodeOrdinal Int64ToNodeOrdinal(int64 x) { return ordinal; } -int64 NodeOrdinalToInt64(const NodeOrdinal& ordinal) { - uint64 y = 0; +int64_t NodeOrdinalToInt64(const NodeOrdinal& ordinal) { + uint64_t y = 0; const std::string& s = ordinal.ToInternalValue(); size_t l = NodeOrdinal::kMinLength; if (s.length() < l) { @@ -36,13 +39,13 @@ int64 NodeOrdinalToInt64(const NodeOrdinal& ordinal) { l = s.length(); } for (size_t i = 0; i < l; ++i) { - const uint8 byte = s[l - i - 1]; - y |= static_cast<uint64>(byte) << (i * 8); + const uint8_t byte = s[l - i - 1]; + y |= static_cast<uint64_t>(byte) << (i * 8); } y ^= 0x8000000000000000ULL; // This is technically implementation-defined if y > INT64_MAX, so // we're assuming that we're on a twos-complement machine. - return static_cast<int64>(y); + return static_cast<int64_t>(y); } } // namespace syncer diff --git a/sync/internal_api/public/base/node_ordinal.h b/sync/internal_api/public/base/node_ordinal.h index e9a70c4..ce58daf 100644 --- a/sync/internal_api/public/base/node_ordinal.h +++ b/sync/internal_api/public/base/node_ordinal.h @@ -5,6 +5,7 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_NODE_ORDINAL_H_ #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_ORDINAL_H_ +#include <stddef.h> #include <stdint.h> #include "sync/base/sync_export.h" @@ -15,7 +16,7 @@ namespace syncer { // A NodeOrdinal is an Ordinal whose internal value comes from the // ordinal_in_parent field of SyncEntity (see sync.proto). It uses // the entire uint8_t range for backwards compatibility with the old -// int64-based positioning. +// int64_t-based positioning. struct NodeOrdinalTraits { static const uint8_t kZeroDigit = 0; @@ -40,7 +41,7 @@ static_assert(NodeOrdinal::kMaxDigitValue == 255, static_assert(NodeOrdinal::kRadix == 256, "NodeOrdinal has incorrect radix"); -// Converts an int64 position (usually from the position_in_parent +// Converts an int64_t position (usually from the position_in_parent // field of SyncEntity) to a NodeOrdinal. This transformation // preserves the ordering relation: a < b under integer ordering if // and only if Int64ToNodeOrdinal(a) < Int64ToNodeOrdinal(b). @@ -50,7 +51,7 @@ SYNC_EXPORT NodeOrdinal Int64ToNodeOrdinal(int64_t x); // lossy: NodeOrdinals can have arbitrary fidelity, while numeric // positions contain only 64 bits of information (in fact, this is the // reason we've moved away from them). -SYNC_EXPORT int64 NodeOrdinalToInt64(const NodeOrdinal& ordinal); +SYNC_EXPORT int64_t NodeOrdinalToInt64(const NodeOrdinal& ordinal); } // 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 05961d3..3ade983 100644 --- a/sync/internal_api/public/base/node_ordinal_unittest.cc +++ b/sync/internal_api/public/base/node_ordinal_unittest.cc @@ -12,6 +12,7 @@ #include <limits> #include <vector> +#include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" namespace syncer { diff --git a/sync/internal_api/public/base/ordinal.h b/sync/internal_api/public/base/ordinal.h index 32d2ff6..6c0f21f 100644 --- a/sync/internal_api/public/base/ordinal.h +++ b/sync/internal_api/public/base/ordinal.h @@ -5,11 +5,12 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_ORDINAL_H_ #define SYNC_INTERNAL_API_PUBLIC_BASE_ORDINAL_H_ +#include <stdint.h> + #include <algorithm> #include <cstddef> #include <string> -#include "base/basictypes.h" #include "base/json/string_escape.h" #include "base/logging.h" @@ -38,8 +39,8 @@ namespace syncer { // struct MyOrdinalTraits { // // There must be at least two distinct values greater than kZeroDigit // // and less than kMaxDigit. -// static const uint8 kZeroDigit = '0'; -// static const uint8 kMaxDigit = '9'; +// static const uint8_t kZeroDigit = '0'; +// static const uint8_t kMaxDigit = '9'; // // kMinLength must be positive. // static const size_t kMinLength = 1; // }; @@ -132,11 +133,11 @@ class Ordinal { // Use of copy constructor and default assignment for this class is allowed. // Constants for Ordinal digits. - static const uint8 kZeroDigit = Traits::kZeroDigit; - static const uint8 kMaxDigit = Traits::kMaxDigit; + static const uint8_t kZeroDigit = Traits::kZeroDigit; + static const uint8_t kMaxDigit = Traits::kMaxDigit; static const size_t kMinLength = Traits::kMinLength; - static const uint8 kOneDigit = kZeroDigit + 1; - static const uint8 kMidDigit = kOneDigit + (kMaxDigit - kOneDigit) / 2; + static const uint8_t kOneDigit = kZeroDigit + 1; + static const uint8_t kMidDigit = kOneDigit + (kMaxDigit - kOneDigit) / 2; static const unsigned int kMidDigitValue = kMidDigit - kZeroDigit; static const unsigned int kMaxDigitValue = kMaxDigit - kZeroDigit; static const unsigned int kRadix = kMaxDigitValue + 1; @@ -162,7 +163,7 @@ class Ordinal { // Returns the digit at position i, padding with zero digits if // required. - static uint8 GetDigit(const std::string& bytes, size_t i); + static uint8_t GetDigit(const std::string& bytes, size_t i); // Returns the digit value at position i, padding with 0 if required. static int GetDigitValue(const std::string& bytes, size_t i); @@ -197,11 +198,15 @@ class Ordinal { bool is_valid_; }; -template <typename Traits> const uint8 Ordinal<Traits>::kZeroDigit; -template <typename Traits> const uint8 Ordinal<Traits>::kMaxDigit; +template <typename Traits> +const uint8_t Ordinal<Traits>::kZeroDigit; +template <typename Traits> +const uint8_t Ordinal<Traits>::kMaxDigit; template <typename Traits> const size_t Ordinal<Traits>::kMinLength; -template <typename Traits> const uint8 Ordinal<Traits>::kOneDigit; -template <typename Traits> const uint8 Ordinal<Traits>::kMidDigit; +template <typename Traits> +const uint8_t Ordinal<Traits>::kOneDigit; +template <typename Traits> +const uint8_t Ordinal<Traits>::kMidDigit; template <typename Traits> const unsigned int Ordinal<Traits>::kMidDigitValue; template <typename Traits> const unsigned int Ordinal<Traits>::kMaxDigitValue; template <typename Traits> const unsigned int Ordinal<Traits>::kRadix; @@ -348,7 +353,7 @@ bool Ordinal<Traits>::IsValidOrdinalBytes(const std::string& bytes) { bool found_non_zero = false; for (size_t i = 0; i < length; ++i) { - const uint8 byte = bytes[i]; + const uint8_t byte = bytes[i]; if (byte < kZeroDigit || byte > kMaxDigit) return false; if (byte > kZeroDigit) @@ -358,7 +363,7 @@ bool Ordinal<Traits>::IsValidOrdinalBytes(const std::string& bytes) { return false; if (length > kMinLength) { - const uint8 last_byte = bytes[length - 1]; + const uint8_t last_byte = bytes[length - 1]; if (last_byte == kZeroDigit) return false; } @@ -384,7 +389,7 @@ size_t Ordinal<Traits>::GetLengthWithoutTrailingZeroDigits( } template <typename Traits> -uint8 Ordinal<Traits>::GetDigit(const std::string& bytes, size_t i) { +uint8_t Ordinal<Traits>::GetDigit(const std::string& bytes, size_t i) { return (i < bytes.length()) ? bytes[i] : kZeroDigit; } diff --git a/sync/internal_api/public/base/unique_position.cc b/sync/internal_api/public/base/unique_position.cc index 5576215..9924cb4 100644 --- a/sync/internal_api/public/base/unique_position.cc +++ b/sync/internal_api/public/base/unique_position.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/base/unique_position.h" +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <limits> diff --git a/sync/internal_api/public/base/unique_position.h b/sync/internal_api/public/base/unique_position.h index d425f9a..70e9b39 100644 --- a/sync/internal_api/public/base/unique_position.h +++ b/sync/internal_api/public/base/unique_position.h @@ -5,6 +5,7 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_ #define SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_ +#include <stddef.h> #include <stdint.h> #include <string> diff --git a/sync/internal_api/public/base/unique_position_unittest.cc b/sync/internal_api/public/base/unique_position_unittest.cc index 6b3fb8c..a666077 100644 --- a/sync/internal_api/public/base/unique_position_unittest.cc +++ b/sync/internal_api/public/base/unique_position_unittest.cc @@ -4,6 +4,7 @@ #include "sync/internal_api/public/base/unique_position.h" +#include <stddef.h> #include <stdint.h> #include <algorithm> @@ -12,8 +13,8 @@ #include <vector> #include "base/base64.h" -#include "base/basictypes.h" #include "base/logging.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/sha1.h" #include "base/strings/string_number_conversions.h" diff --git a/sync/internal_api/public/base_node.h b/sync/internal_api/public/base_node.h index fe3ca1b..709f423 100644 --- a/sync/internal_api/public/base_node.h +++ b/sync/internal_api/public/base_node.h @@ -5,11 +5,14 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "sync/api/attachments/attachment.h" @@ -50,13 +53,13 @@ class Id; } // A valid BaseNode will never have an ID of zero. -static const int64 kInvalidId = 0; +static const int64_t kInvalidId = 0; // BaseNode wraps syncable::Entry, and corresponds to a single object's state. // This, like syncable::Entry, is intended for use on the stack. A valid // transaction is necessary to create a BaseNode or any of its children. // Unlike syncable::Entry, a sync API BaseNode is identified primarily by its -// int64 metahandle, which we call an ID here. +// int64_t metahandle, which we call an ID here. class SYNC_EXPORT BaseNode { public: // Enumerates the possible outcomes of trying to initialize a sync node. @@ -76,7 +79,7 @@ class SYNC_EXPORT BaseNode { // All subclasses of BaseNode must provide a way to initialize themselves by // doing an ID lookup. Returns false on failure. An invalid or deleted // ID will result in failure. - virtual InitByLookupResult InitByIdLookup(int64 id) = 0; + virtual InitByLookupResult InitByIdLookup(int64_t id) = 0; // All subclasses of BaseNode must also provide a way to initialize themselves // by doing a client tag lookup. Returns false on failure. A deleted node @@ -89,7 +92,7 @@ class SYNC_EXPORT BaseNode { // metahandle). These ids are strictly local handles. They will persist // on this client, but the same object on a different client may have a // different ID value. - virtual int64 GetId() const; + virtual int64_t GetId() const; // Returns the modification time of the object. base::Time GetModificationTime() const; @@ -97,7 +100,7 @@ class SYNC_EXPORT BaseNode { // Nodes are hierarchically arranged into a single-rooted tree. // InitByRootLookup on ReadNode allows access to the root. GetParentId is // how you find a node's parent. - int64 GetParentId() const; + int64_t GetParentId() const; // Nodes are either folders or not. This corresponds to the IS_DIR property // of syncable::Entry. @@ -139,7 +142,7 @@ class SYNC_EXPORT BaseNode { const sync_pb::EntitySpecifics& GetEntitySpecifics() const; // Returns the local external ID associated with the node. - int64 GetExternalId() const; + int64_t GetExternalId() const; // Returns the internal syncable ID associated with the node. const syncable::Id& GetSyncId() const; @@ -149,20 +152,20 @@ class SYNC_EXPORT BaseNode { // Return the ID of the node immediately before this in the sibling order. // For the first node in the ordering, return 0. - int64 GetPredecessorId() const; + int64_t GetPredecessorId() const; // Return the ID of the node immediately after this in the sibling order. // For the last node in the ordering, return 0. - int64 GetSuccessorId() const; + int64_t GetSuccessorId() const; // Return the ID of the first child of this node. If this node has no // children, return 0. - int64 GetFirstChildId() const; + int64_t GetFirstChildId() const; // Returns the IDs of the children of this node. // If this type supports user-defined positions the returned IDs will be in // the correct order. - void GetChildIds(std::vector<int64>* result) const; + void GetChildIds(std::vector<int64_t>* result) const; // Returns the total number of nodes including and beneath this node. // Recursively iterates through all children. diff --git a/sync/internal_api/public/base_transaction.h b/sync/internal_api/public/base_transaction.h index c75086e..5002c72 100644 --- a/sync/internal_api/public/base_transaction.h +++ b/sync/internal_api/public/base_transaction.h @@ -5,6 +5,7 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_TRANSACTION_H_ #define SYNC_INTERNAL_API_PUBLIC_BASE_TRANSACTION_H_ +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/user_share.h" diff --git a/sync/internal_api/public/change_record.h b/sync/internal_api/public/change_record.h index 34e1a7d..0eb887b 100644 --- a/sync/internal_api/public/change_record.h +++ b/sync/internal_api/public/change_record.h @@ -5,9 +5,10 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_CHANGE_RECORD_H_ #define SYNC_INTERNAL_API_PUBLIC_CHANGE_RECORD_H_ +#include <stdint.h> + #include <vector> -#include "base/basictypes.h" #include "base/memory/linked_ptr.h" #include "base/memory/scoped_ptr.h" #include "sync/base/sync_export.h" @@ -52,7 +53,7 @@ struct SYNC_EXPORT ChangeRecord { scoped_ptr<base::DictionaryValue> ToValue() const; - int64 id; + int64_t id; Action action; sync_pb::EntitySpecifics specifics; linked_ptr<ExtraPasswordChangeRecordData> extra; diff --git a/sync/internal_api/public/change_record_unittest.cc b/sync/internal_api/public/change_record_unittest.cc index b68831a..a6b7a00 100644 --- a/sync/internal_api/public/change_record_unittest.cc +++ b/sync/internal_api/public/change_record_unittest.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/change_record.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include "base/memory/scoped_ptr.h" @@ -103,7 +106,7 @@ TEST_F(ChangeRecordTest, ChangeRecordToValue) { sync_pb::EntitySpecifics new_specifics; old_specifics.mutable_extension()->set_id("new"); - const int64 kTestId = 5; + const int64_t kTestId = 5; // Add { diff --git a/sync/internal_api/public/data_batch_impl.h b/sync/internal_api/public/data_batch_impl.h index 8b369ba..9313310 100644 --- a/sync/internal_api/public/data_batch_impl.h +++ b/sync/internal_api/public/data_batch_impl.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_DATA_BATCH_IMPL_H_ #define SYNC_INTERNAL_API_PUBLIC_DATA_BATCH_IMPL_H_ +#include <stddef.h> + #include <string> #include <utility> #include <vector> diff --git a/sync/internal_api/public/data_type_association_stats.h b/sync/internal_api/public/data_type_association_stats.h index ba38f65..cd5b226 100644 --- a/sync/internal_api/public/data_type_association_stats.h +++ b/sync/internal_api/public/data_type_association_stats.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_ASSOCIATION_STATS_H_ #define SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_ASSOCIATION_STATS_H_ +#include <stdint.h> + #include "base/time/time.h" #include "sync/base/sync_export.h" @@ -33,8 +35,8 @@ struct SYNC_EXPORT DataTypeAssociationStats { int num_sync_items_modified; // Model versions before association. - int64 local_version_pre_association; - int64 sync_version_pre_association; + int64_t local_version_pre_association; + int64_t sync_version_pre_association; // Whether a datatype unrecoverable error was encountered during association. bool had_error; diff --git a/sync/internal_api/public/delete_journal.h b/sync/internal_api/public/delete_journal.h index f6d43ca..c6aad553 100644 --- a/sync/internal_api/public/delete_journal.h +++ b/sync/internal_api/public/delete_journal.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ #define SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ +#include <stdint.h> + #include <set> #include <vector> @@ -17,8 +19,8 @@ namespace syncer { class BaseTransaction; struct BookmarkDeleteJournal { - int64 id; // Metahandle of delete journal entry. - int64 external_id; // Bookmark ID in the native model. + int64_t id; // Metahandle of delete journal entry. + int64_t external_id; // Bookmark ID in the native model. bool is_folder; sync_pb::EntitySpecifics specifics; }; @@ -38,7 +40,7 @@ class SYNC_EXPORT DeleteJournal { // Purge delete journals of given IDs from |trans|'s directory. static void PurgeDeleteJournals(BaseTransaction* trans, - const std::set<int64>& ids); + const std::set<int64_t>& ids); }; } // namespace syncer diff --git a/sync/internal_api/public/engine/passive_model_worker.h b/sync/internal_api/public/engine/passive_model_worker.h index c2c1d98..29ad028 100644 --- a/sync/internal_api/public/engine/passive_model_worker.h +++ b/sync/internal_api/public/engine/passive_model_worker.h @@ -5,8 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ #define SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/engine/model_safe_worker.h" #include "sync/internal_api/public/util/syncer_error.h" diff --git a/sync/internal_api/public/engine/polling_constants.cc b/sync/internal_api/public/engine/polling_constants.cc index edce4d8..0fadfa8 100644 --- a/sync/internal_api/public/engine/polling_constants.cc +++ b/sync/internal_api/public/engine/polling_constants.cc @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include <stdint.h> + #include "sync/internal_api/public/engine/polling_constants.h" namespace syncer { @@ -12,12 +13,12 @@ namespace syncer { // We use high values here to ensure that failure to receive poll updates from // the server doesn't result in rapid-fire polling from the client due to low // local limits. -const int64 kDefaultShortPollIntervalSeconds = 3600 * 8; +const int64_t kDefaultShortPollIntervalSeconds = 3600 * 8; // Long poll is used when XMPP is on. -const int64 kDefaultLongPollIntervalSeconds = 3600 * 12; +const int64_t kDefaultLongPollIntervalSeconds = 3600 * 12; // Maximum interval for exponential backoff. -const int64 kMaxBackoffSeconds = 60 * 10; // 10 minutes. +const int64_t kMaxBackoffSeconds = 60 * 10; // 10 minutes. // Backoff interval randomization factor. const int kBackoffRandomizationFactor = 2; diff --git a/sync/internal_api/public/engine/polling_constants.h b/sync/internal_api/public/engine/polling_constants.h index 4e93f17..8ef1fbcc 100644 --- a/sync/internal_api/public/engine/polling_constants.h +++ b/sync/internal_api/public/engine/polling_constants.h @@ -7,13 +7,15 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_ENGINE_POLLING_CONSTANTS_H_ #define SYNC_INTERNAL_API_PUBLIC_ENGINE_POLLING_CONSTANTS_H_ +#include <stdint.h> + #include "sync/base/sync_export.h" namespace syncer { -SYNC_EXPORT extern const int64 kDefaultShortPollIntervalSeconds; -SYNC_EXPORT extern const int64 kDefaultLongPollIntervalSeconds; -SYNC_EXPORT extern const int64 kMaxBackoffSeconds; +SYNC_EXPORT extern const int64_t kDefaultShortPollIntervalSeconds; +SYNC_EXPORT extern const int64_t kDefaultLongPollIntervalSeconds; +SYNC_EXPORT extern const int64_t kMaxBackoffSeconds; SYNC_EXPORT extern const int kBackoffRandomizationFactor; SYNC_EXPORT extern const int kInitialBackoffRetrySeconds; SYNC_EXPORT extern const int kInitialBackoffShortRetrySeconds; diff --git a/sync/internal_api/public/events/clear_server_data_request_event.h b/sync/internal_api/public/events/clear_server_data_request_event.h index 8a1fd77..b70ad5c 100644 --- a/sync/internal_api/public/events/clear_server_data_request_event.h +++ b/sync/internal_api/public/events/clear_server_data_request_event.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" diff --git a/sync/internal_api/public/events/clear_server_data_response_event.h b/sync/internal_api/public/events/clear_server_data_response_event.h index 9882d02..c6770ff 100644 --- a/sync/internal_api/public/events/clear_server_data_response_event.h +++ b/sync/internal_api/public/events/clear_server_data_response_event.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" diff --git a/sync/internal_api/public/events/commit_request_event.h b/sync/internal_api/public/events/commit_request_event.h index 1bf60d3..aed82b7 100644 --- a/sync/internal_api/public/events/commit_request_event.h +++ b/sync/internal_api/public/events/commit_request_event.h @@ -8,6 +8,7 @@ #include <cstddef> #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" diff --git a/sync/internal_api/public/events/commit_response_event.h b/sync/internal_api/public/events/commit_response_event.h index caf18d9..4f28278 100644 --- a/sync/internal_api/public/events/commit_response_event.h +++ b/sync/internal_api/public/events/commit_response_event.h @@ -8,6 +8,7 @@ #include <cstddef> #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" diff --git a/sync/internal_api/public/events/configure_get_updates_request_event.h b/sync/internal_api/public/events/configure_get_updates_request_event.h index 37d9037..42799a9 100644 --- a/sync/internal_api/public/events/configure_get_updates_request_event.h +++ b/sync/internal_api/public/events/configure_get_updates_request_event.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" diff --git a/sync/internal_api/public/events/get_updates_response_event.h b/sync/internal_api/public/events/get_updates_response_event.h index 6ec8674..0dc8c5e 100644 --- a/sync/internal_api/public/events/get_updates_response_event.h +++ b/sync/internal_api/public/events/get_updates_response_event.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" diff --git a/sync/internal_api/public/events/normal_get_updates_request_event.h b/sync/internal_api/public/events/normal_get_updates_request_event.h index 9df2bd4..0a97e10 100644 --- a/sync/internal_api/public/events/normal_get_updates_request_event.h +++ b/sync/internal_api/public/events/normal_get_updates_request_event.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" diff --git a/sync/internal_api/public/events/poll_get_updates_request_event.h b/sync/internal_api/public/events/poll_get_updates_request_event.h index 9d71af7..ff4b595 100644 --- a/sync/internal_api/public/events/poll_get_updates_request_event.h +++ b/sync/internal_api/public/events/poll_get_updates_request_event.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "base/values.h" diff --git a/sync/internal_api/public/http_bridge.h b/sync/internal_api/public/http_bridge.h index 85ad32e..79c73e0c 100644 --- a/sync/internal_api/public/http_bridge.h +++ b/sync/internal_api/public/http_bridge.h @@ -5,10 +5,12 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ #define SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" @@ -76,9 +78,11 @@ class SYNC_EXPORT HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, // net::URLFetcherDelegate implementation. void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchDownloadProgress(const net::URLFetcher* source, - int64 current, int64 total) override; + int64_t current, + int64_t total) override; void OnURLFetchUploadProgress(const net::URLFetcher* source, - int64 current, int64 total) override; + int64_t current, + int64_t total) override; net::URLRequestContextGetter* GetRequestContextGetterForTest() const; diff --git a/sync/internal_api/public/internal_components_factory_impl.h b/sync/internal_api/public/internal_components_factory_impl.h index fec1da6..ea1057d 100644 --- a/sync/internal_api/public/internal_components_factory_impl.h +++ b/sync/internal_api/public/internal_components_factory_impl.h @@ -11,6 +11,7 @@ #include <string> #include <vector> +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/internal_components_factory.h" diff --git a/sync/internal_api/public/model_type_entity.h b/sync/internal_api/public/model_type_entity.h index 551f1bd..cabbaeb 100644 --- a/sync/internal_api/public/model_type_entity.h +++ b/sync/internal_api/public/model_type_entity.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_MODEL_TYPE_ENTITY_H_ #define SYNC_INTERNAL_API_PUBLIC_MODEL_TYPE_ENTITY_H_ +#include <stdint.h> + #include <string> #include "base/memory/scoped_ptr.h" @@ -53,10 +55,10 @@ class SYNC_EXPORT ModelTypeEntity { bool RequiresCommitRequest() const; // Returns true if the specified update version does not contain new data. - bool UpdateIsReflection(int64 update_version) const; + bool UpdateIsReflection(int64_t update_version) const; // Returns true if the specified update version conflicts with local changes. - bool UpdateIsInConflict(int64 update_version) const; + bool UpdateIsInConflict(int64_t update_version) const; // Applies an update from the sync server. // @@ -92,8 +94,8 @@ class SYNC_EXPORT ModelTypeEntity { // possible that the committed item was already out of date by the time it // reached the server. void ReceiveCommitResponse(const std::string& id, - int64 sequence_number, - int64 response_version, + int64_t sequence_number, + int64_t response_version, const std::string& encryption_key_name); // Clears any in-memory sync state associated with outstanding commits. @@ -133,7 +135,7 @@ class SYNC_EXPORT ModelTypeEntity { EntityDataPtr commit_data_; // The sequence number of the last item sent to the sync thread. - int64 commit_requested_sequence_number_; + int64_t commit_requested_sequence_number_; // TODO(stanisc): this should be removed. // The name of the encryption key used to encrypt this item on the server. diff --git a/sync/internal_api/public/non_blocking_sync_common.h b/sync/internal_api/public/non_blocking_sync_common.h index 5fdcac3..799dfca 100644 --- a/sync/internal_api/public/non_blocking_sync_common.h +++ b/sync/internal_api/public/non_blocking_sync_common.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_NON_BLOCKING_SYNC_COMMON_H_ #define SYNC_INTERNAL_API_PUBLIC_NON_BLOCKING_SYNC_COMMON_H_ +#include <stdint.h> + #include <string> #include <vector> @@ -15,7 +17,7 @@ namespace syncer_v2 { -static const int64 kUncommittedVersion = -1; +static const int64_t kUncommittedVersion = -1; // Data-type global state that must be accessed and updated on the sync thread, // but persisted on or through the model thread. @@ -52,8 +54,8 @@ struct SYNC_EXPORT CommitRequestData { // Strictly incrementing number for in-progress commits. More information // about its meaning can be found in comments in the files that make use of // this struct. - int64 sequence_number = 0; - int64 base_version = 0; + int64_t sequence_number = 0; + int64_t base_version = 0; }; struct SYNC_EXPORT CommitResponseData { @@ -62,8 +64,8 @@ struct SYNC_EXPORT CommitResponseData { std::string id; std::string client_tag_hash; - int64 sequence_number = 0; - int64 response_version = 0; + int64_t sequence_number = 0; + int64_t response_version = 0; }; struct SYNC_EXPORT UpdateResponseData { @@ -72,7 +74,7 @@ struct SYNC_EXPORT UpdateResponseData { EntityDataPtr entity; - int64 response_version = 0; + int64_t response_version = 0; std::string encryption_key_name; }; diff --git a/sync/internal_api/public/read_node.h b/sync/internal_api/public/read_node.h index 69c3114..371cd67 100644 --- a/sync/internal_api/public/read_node.h +++ b/sync/internal_api/public/read_node.h @@ -5,10 +5,13 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_READ_NODE_H_ #define SYNC_INTERNAL_API_PUBLIC_READ_NODE_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/base_node.h" @@ -28,7 +31,7 @@ class SYNC_EXPORT ReadNode : public BaseNode { // populate the node. // BaseNode implementation. - InitByLookupResult InitByIdLookup(int64 id) override; + InitByLookupResult InitByIdLookup(int64_t id) override; InitByLookupResult InitByClientTagLookup(ModelType model_type, const std::string& tag) override; @@ -50,7 +53,7 @@ class SYNC_EXPORT ReadNode : public BaseNode { // Returns transaction version of the last transaction where this node has // been modified. - int64 GetTransactionVersion() const; + int64_t GetTransactionVersion() const; // Implementation of BaseNode's abstract virtual accessors. const syncable::Entry* GetEntry() const override; diff --git a/sync/internal_api/public/read_transaction.h b/sync/internal_api/public/read_transaction.h index e79669b..263a047 100644 --- a/sync/internal_api/public/read_transaction.h +++ b/sync/internal_api/public/read_transaction.h @@ -5,9 +5,13 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_READ_TRANSACTION_H_ #define SYNC_INTERNAL_API_PUBLIC_READ_TRANSACTION_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/api/attachments/attachment_id.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base_transaction.h" @@ -42,7 +46,7 @@ class SYNC_EXPORT ReadTransaction : public BaseTransaction { // Return |transaction_version| of |type| stored in sync directory's // persisted info. - int64 GetModelVersion(ModelType type) const; + int64_t GetModelVersion(ModelType type) const; // Fills |context| with the datatype context associated with |type|. void GetDataTypeContext(ModelType type, diff --git a/sync/internal_api/public/sessions/model_neutral_state.h b/sync/internal_api/public/sessions/model_neutral_state.h index 870f79e..a80a10d 100644 --- a/sync/internal_api/public/sessions/model_neutral_state.h +++ b/sync/internal_api/public/sessions/model_neutral_state.h @@ -5,7 +5,6 @@ #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" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/util/syncer_error.h" diff --git a/sync/internal_api/public/sessions/status_counters.h b/sync/internal_api/public/sessions/status_counters.h index 7c12133..83ccd13 100644 --- a/sync/internal_api/public/sessions/status_counters.h +++ b/sync/internal_api/public/sessions/status_counters.h @@ -5,6 +5,8 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_SESSIONS_STATUS_COUNTERS_H_ #define SYNC_INTERNAL_API_PUBLIC_SESSIONS_STATUS_COUNTERS_H_ +#include <stddef.h> + #include <string> #include "base/memory/scoped_ptr.h" diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.cc b/sync/internal_api/public/sessions/sync_session_snapshot.cc index 9614330..8842c17 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.cc +++ b/sync/internal_api/public/sessions/sync_session_snapshot.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/sessions/sync_session_snapshot.h" +#include <stddef.h> + #include "base/json/json_writer.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.h b/sync/internal_api/public/sessions/sync_session_snapshot.h index 335700b..fbe54eb 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.h +++ b/sync/internal_api/public/sessions/sync_session_snapshot.h @@ -5,10 +5,11 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ #define SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ +#include <stddef.h> + #include <string> #include <vector> -#include "base/basictypes.h" #include "base/time/time.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h index 1ae8ba4..7e75983 100644 --- a/sync/internal_api/public/sync_manager.h +++ b/sync/internal_api/public/sync_manager.h @@ -5,10 +5,11 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" #include "base/callback.h" #include "base/files/file_path.h" #include "base/memory/ref_counted.h" @@ -117,11 +118,10 @@ class SYNC_EXPORT SyncManager { // forward dependencies. But since deletions come before reparent // operations, a delete may temporarily orphan a node that is // updated later in the list. - virtual void OnChangesApplied( - ModelType model_type, - int64 model_version, - const BaseTransaction* trans, - const ImmutableChangeRecordList& changes) = 0; + virtual void OnChangesApplied(ModelType model_type, + int64_t model_version, + const BaseTransaction* trans, + const ImmutableChangeRecordList& changes) = 0; // OnChangesComplete gets called when the TransactionComplete event is // posted (after OnChangesApplied finishes), after the transaction lock @@ -161,10 +161,9 @@ class SYNC_EXPORT SyncManager { // Even more ideally, we would have sync semantics such that we'd // be able to apply changes without being under a transaction. // But that's a ways off... - virtual void OnChangesApplied( - ModelType model_type, - int64 write_transaction_id, - const ImmutableChangeRecordList& changes) = 0; + virtual void OnChangesApplied(ModelType model_type, + int64_t write_transaction_id, + const ImmutableChangeRecordList& changes) = 0; virtual void OnChangesComplete(ModelType model_type) = 0; diff --git a/sync/internal_api/public/sync_manager_factory.h b/sync/internal_api/public/sync_manager_factory.h index 5a5dc63..ef6ee6b 100644 --- a/sync/internal_api/public/sync_manager_factory.h +++ b/sync/internal_api/public/sync_manager_factory.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "sync/base/sync_export.h" diff --git a/sync/internal_api/public/test/fake_sync_manager.h b/sync/internal_api/public/test/fake_sync_manager.h index 86ad21f..4443a2a 100644 --- a/sync/internal_api/public/test/fake_sync_manager.h +++ b/sync/internal_api/public/test/fake_sync_manager.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "sync/internal_api/public/sync_manager.h" diff --git a/sync/internal_api/public/test/test_entry_factory.h b/sync/internal_api/public/test/test_entry_factory.h index 138338b..ee99834 100644 --- a/sync/internal_api/public/test/test_entry_factory.h +++ b/sync/internal_api/public/test/test_entry_factory.h @@ -5,9 +5,11 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_TEST_ENTRY_FACTORY_H_ #define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_ENTRY_FACTORY_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" @@ -24,20 +26,20 @@ class TestEntryFactory { ~TestEntryFactory(); // Create a new unapplied folder node with a parent. - int64 CreateUnappliedNewItemWithParent( + int64_t CreateUnappliedNewItemWithParent( const std::string& item_id, const sync_pb::EntitySpecifics& specifics, const std::string& parent_id); - int64 CreateUnappliedNewBookmarkItemWithParent( + int64_t CreateUnappliedNewBookmarkItemWithParent( const std::string& item_id, const sync_pb::EntitySpecifics& specifics, const std::string& parent_id); // Create a new unapplied update without a parent. - int64 CreateUnappliedNewItem(const std::string& item_id, - const sync_pb::EntitySpecifics& specifics, - bool is_unique); + int64_t CreateUnappliedNewItem(const std::string& item_id, + const sync_pb::EntitySpecifics& specifics, + bool is_unique); // Create an unsynced unique_client_tag item in the database. If item_id is a // local ID, it will be treated as a create-new. Otherwise, if it's a server @@ -49,52 +51,53 @@ class TestEntryFactory { const std::string& name, bool is_folder, ModelType model_type, - int64* metahandle_out); + int64_t* metahandle_out); // Creates a bookmark that is both unsynced an an unapplied update. Returns // the metahandle of the created item. - int64 CreateUnappliedAndUnsyncedBookmarkItem(const std::string& name); + int64_t CreateUnappliedAndUnsyncedBookmarkItem(const std::string& name); // Creates a unique_client_tag item that has neither IS_UNSYNED or // IS_UNAPPLIED_UPDATE. The item is known to both the server and client. // Returns the metahandle of the created item. - int64 CreateSyncedItem(const std::string& name, - ModelType model_type, bool is_folder); + int64_t CreateSyncedItem(const std::string& name, + ModelType model_type, + bool is_folder); // Creates a root node that IS_UNAPPLIED. Similar to what one would find in // the database between the ProcessUpdates of an initial datatype configure // cycle and the ApplyUpdates step of the same sync cycle. - int64 CreateUnappliedRootNode(ModelType model_type); + int64_t CreateUnappliedRootNode(ModelType model_type); // Looks up the item referenced by |meta_handle|. If successful, overwrites // the server specifics with |specifics|, sets // IS_UNAPPLIED_UPDATES/IS_UNSYNCED appropriately, and returns true. // Else, return false. - bool SetServerSpecificsForItem(int64 meta_handle, + bool SetServerSpecificsForItem(int64_t meta_handle, const sync_pb::EntitySpecifics specifics); // Looks up the item referenced by |meta_handle|. If successful, overwrites // the local specifics with |specifics|, sets // IS_UNAPPLIED_UPDATES/IS_UNSYNCED appropriately, and returns true. // Else, return false. - bool SetLocalSpecificsForItem(int64 meta_handle, + bool SetLocalSpecificsForItem(int64_t meta_handle, const sync_pb::EntitySpecifics specifics); // Looks up the item referenced by |meta_handle| and returns its server // specifics. const sync_pb::EntitySpecifics& GetServerSpecificsForItem( - int64 meta_handle) const; + int64_t meta_handle) const; // Looks up the item referenced by |meta_handle| and returns its specifics. const sync_pb::EntitySpecifics& GetLocalSpecificsForItem( - int64 meta_handle) const; + int64_t meta_handle) const; // Looks up the item referenced by |meta_handle|. If successful, overwrites // the server attachment metadata with |metadata|, sets // IS_UNAPPLIED_UPDATES/IS_UNSYNCED appropriately, and returns true. // Else, return false. bool SetServerAttachmentMetadataForItem( - int64 meta_handle, + int64_t meta_handle, const sync_pb::AttachmentMetadata metadata); // Looks up the item referenced by |meta_handle|. If successful, overwrites @@ -102,28 +105,28 @@ class TestEntryFactory { // IS_UNAPPLIED_UPDATES/IS_UNSYNCED appropriately, and returns true. // Else, return false. bool SetLocalAttachmentMetadataForItem( - int64 meta_handle, + int64_t meta_handle, const sync_pb::AttachmentMetadata metadata); // Looks up the item referenced by |meta_handle| and returns its server // attachment metadata. const sync_pb::AttachmentMetadata& GetServerAttachmentMetadataForItem( - int64 meta_handle) const; + int64_t meta_handle) const; // Looks up the item referenced by |meta_handle| and returns its attachment // metadata. const sync_pb::AttachmentMetadata& GetLocalAttachmentMetadataForItem( - int64 meta_handle) const; + int64_t meta_handle) const; // Getters for IS_UNSYNCED and IS_UNAPPLIED_UPDATE bit fields. - bool GetIsUnsyncedForItem(int64 meta_handle) const; - bool GetIsUnappliedForItem(int64 meta_handle) const; + bool GetIsUnsyncedForItem(int64_t meta_handle) const; + bool GetIsUnappliedForItem(int64_t meta_handle) const; - int64 GetNextRevision(); + int64_t GetNextRevision(); private: syncable::Directory* directory_; - int64 next_revision_; + int64_t next_revision_; DISALLOW_COPY_AND_ASSIGN(TestEntryFactory); }; 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 f4de596..9058459 100644 --- a/sync/internal_api/public/test/test_internal_components_factory.h +++ b/sync/internal_api/public/test/test_internal_components_factory.h @@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/macros.h" #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 0e6ed2f..d439a0d 100644 --- a/sync/internal_api/public/test/test_user_share.h +++ b/sync/internal_api/public/test/test_user_share.h @@ -30,7 +30,9 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ #define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ -#include "base/basictypes.h" +#include <stddef.h> + +#include "base/macros.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/user_share.h" diff --git a/sync/internal_api/public/util/immutable.h b/sync/internal_api/public/util/immutable.h index e11458c..48d4051 100644 --- a/sync/internal_api/public/util/immutable.h +++ b/sync/internal_api/public/util/immutable.h @@ -67,7 +67,7 @@ // For std::swap(). #include <algorithm> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" namespace syncer { diff --git a/sync/internal_api/public/util/immutable_unittest.cc b/sync/internal_api/public/util/immutable_unittest.cc index 954a08f..9d7d0f3 100644 --- a/sync/internal_api/public/util/immutable_unittest.cc +++ b/sync/internal_api/public/util/immutable_unittest.cc @@ -12,7 +12,7 @@ #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/sync/internal_api/public/util/proto_value_ptr_unittest.cc b/sync/internal_api/public/util/proto_value_ptr_unittest.cc index 7d1c515..b47ffa5 100644 --- a/sync/internal_api/public/util/proto_value_ptr_unittest.cc +++ b/sync/internal_api/public/util/proto_value_ptr_unittest.cc @@ -4,6 +4,7 @@ #include "sync/internal_api/public/util/proto_value_ptr.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/sync/internal_api/public/util/weak_handle.h b/sync/internal_api/public/util/weak_handle.h index d5160f2..52f2b4f 100644 --- a/sync/internal_api/public/util/weak_handle.h +++ b/sync/internal_api/public/util/weak_handle.h @@ -49,13 +49,13 @@ #include <cstddef> -#include "base/basictypes.h" #include "base/bind.h" #include "base/callback_forward.h" #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" #include "base/location.h" #include "base/logging.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" diff --git a/sync/internal_api/public/write_node.h b/sync/internal_api/public/write_node.h index ee9616d..23e00b8 100644 --- a/sync/internal_api/public/write_node.h +++ b/sync/internal_api/public/write_node.h @@ -5,12 +5,15 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_ #define SYNC_INTERNAL_API_PUBLIC_WRITE_NODE_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/base_node.h" @@ -56,7 +59,7 @@ class SYNC_EXPORT WriteNode : public BaseNode { // populate the node. // BaseNode implementation. - InitByLookupResult InitByIdLookup(int64 id) override; + InitByLookupResult InitByIdLookup(int64_t id) override; InitByLookupResult InitByClientTagLookup(ModelType model_type, const std::string& tag) override; @@ -95,7 +98,7 @@ class SYNC_EXPORT WriteNode : public BaseNode { // External ID is a client-only field, so setting it doesn't cause the item to // be synced again. - void SetExternalId(int64 external_id); + void SetExternalId(int64_t external_id); // Remove this node and its children and sync deletion to server. void Tombstone(); diff --git a/sync/internal_api/public/write_transaction.h b/sync/internal_api/public/write_transaction.h index 8a1e35a..1b8c263 100644 --- a/sync/internal_api/public/write_transaction.h +++ b/sync/internal_api/public/write_transaction.h @@ -5,10 +5,13 @@ #ifndef SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ #define SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/api/sync_change_processor.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base_transaction.h" @@ -39,7 +42,8 @@ class SYNC_EXPORT WriteTransaction : public BaseTransaction { // if not after transaction is closed. This constructor is used for model // types that support embassy data. WriteTransaction(const tracked_objects::Location& from_here, - UserShare* share, int64* transaction_version); + UserShare* share, + int64_t* transaction_version); ~WriteTransaction() override; // Provide access to the syncable transaction from the API WriteNode. diff --git a/sync/internal_api/read_node.cc b/sync/internal_api/read_node.cc index 15dffc8..023d30c 100644 --- a/sync/internal_api/read_node.cc +++ b/sync/internal_api/read_node.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/read_node.h" +#include <stdint.h> + #include "base/logging.h" #include "sync/internal_api/public/base_transaction.h" #include "sync/syncable/entry.h" @@ -36,7 +38,7 @@ void ReadNode::InitByRootLookup() { DCHECK(false) << "Could not lookup root node for reading."; } -BaseNode::InitByLookupResult ReadNode::InitByIdLookup(int64 id) { +BaseNode::InitByLookupResult ReadNode::InitByIdLookup(int64_t id) { DCHECK(!entry_) << "Init called twice"; DCHECK_NE(id, kInvalidId); syncable::BaseTransaction* trans = transaction_->GetWrappedTrans(); @@ -77,7 +79,7 @@ const BaseTransaction* ReadNode::GetTransaction() const { return transaction_; } -int64 ReadNode::GetTransactionVersion() const { +int64_t ReadNode::GetTransactionVersion() const { return GetEntry()->GetTransactionVersion(); } diff --git a/sync/internal_api/read_transaction.cc b/sync/internal_api/read_transaction.cc index 9d81b0e..55c8d8e 100644 --- a/sync/internal_api/read_transaction.cc +++ b/sync/internal_api/read_transaction.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/read_transaction.h" +#include <stdint.h> + #include "sync/syncable/directory.h" #include "sync/syncable/syncable_read_transaction.h" @@ -36,7 +38,7 @@ syncable::BaseTransaction* ReadTransaction::GetWrappedTrans() const { return transaction_; } -int64 ReadTransaction::GetModelVersion(ModelType type) const { +int64_t ReadTransaction::GetModelVersion(ModelType type) const { return transaction_->directory()->GetTransactionVersion(type); } diff --git a/sync/internal_api/shared_model_type_processor_unittest.cc b/sync/internal_api/shared_model_type_processor_unittest.cc index 23506a82..411e8b1 100644 --- a/sync/internal_api/shared_model_type_processor_unittest.cc +++ b/sync/internal_api/shared_model_type_processor_unittest.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/shared_model_type_processor.h" +#include <stddef.h> +#include <stdint.h> + #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -76,14 +79,14 @@ class SharedModelTypeProcessorTest : public ::testing::Test, // Emulate updates from the server. // This harness has some functionality to help emulate server behavior. // See the definitions of these methods for more information. - void UpdateFromServer(int64 version_offset, + void UpdateFromServer(int64_t version_offset, const std::string& tag, const std::string& value); - void TombstoneFromServer(int64 version_offset, const std::string& tag); + void TombstoneFromServer(int64_t version_offset, const std::string& tag); // Emulate the receipt of pending updates from the server. // Pending updates are usually caused by a temporary decryption failure. - void PendingUpdateFromServer(int64 version_offset, + void PendingUpdateFromServer(int64_t version_offset, const std::string& tag, const std::string& value, const std::string& key_name); @@ -128,8 +131,8 @@ class SharedModelTypeProcessorTest : public ::testing::Test, const std::string& value, const std::string& key_name); - int64 GetServerVersion(const std::string& tag); - void SetServerVersion(const std::string& tag, int64 version); + int64_t GetServerVersion(const std::string& tag); + void SetServerVersion(const std::string& tag, int64_t version); void StartDone(syncer::SyncError error, scoped_ptr<ActivationContext> context); @@ -225,7 +228,7 @@ void SharedModelTypeProcessorTest::OnInitialSyncDone() { empty_update_list); } -void SharedModelTypeProcessorTest::UpdateFromServer(int64 version_offset, +void SharedModelTypeProcessorTest::UpdateFromServer(int64_t version_offset, const std::string& tag, const std::string& value) { const std::string tag_hash = GenerateTagHash(tag); @@ -239,7 +242,7 @@ void SharedModelTypeProcessorTest::UpdateFromServer(int64 version_offset, } void SharedModelTypeProcessorTest::PendingUpdateFromServer( - int64 version_offset, + int64_t version_offset, const std::string& tag, const std::string& value, const std::string& key_name) { @@ -254,7 +257,7 @@ void SharedModelTypeProcessorTest::PendingUpdateFromServer( list); } -void SharedModelTypeProcessorTest::TombstoneFromServer(int64 version_offset, +void SharedModelTypeProcessorTest::TombstoneFromServer(int64_t version_offset, const std::string& tag) { // Overwrite the existing server version if this is the new highest version. std::string tag_hash = GenerateTagHash(tag); diff --git a/sync/internal_api/sync_backup_manager.cc b/sync/internal_api/sync_backup_manager.cc index 76edd2c..9151e52 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 <stdint.h> + #include <vector> #include "sync/internal_api/public/read_node.h" @@ -58,7 +60,7 @@ ModelTypeSet SyncBackupManager::HandleTransactionEndingChangeEvent( for (syncable::EntryKernelMutationMap::const_iterator it = write_transaction_info.Get().mutations.Get().begin(); it != write_transaction_info.Get().mutations.Get().end(); ++it) { - int64 id = it->first; + int64_t id = it->first; if (unsynced_.find(id) == unsynced_.end()) { unsynced_.insert(id); @@ -77,8 +79,8 @@ ModelTypeSet SyncBackupManager::HandleTransactionEndingChangeEvent( void SyncBackupManager::NormalizeEntries() { WriteTransaction trans(FROM_HERE, GetUserShare()); in_normalization_ = true; - for (std::set<int64>::const_iterator it = unsynced_.begin(); - it != unsynced_.end(); ++it) { + for (std::set<int64_t>::const_iterator it = unsynced_.begin(); + it != unsynced_.end(); ++it) { syncable::MutableEntry entry(trans.GetWrappedWriteTrans(), syncable::GET_BY_HANDLE, *it); CHECK(entry.good()); @@ -101,9 +103,9 @@ void SyncBackupManager::HideSyncPreference(ModelType type) { if (BaseNode::INIT_OK != pref_root.InitTypeRoot(type)) return; - std::vector<int64> pref_ids; + std::vector<int64_t> pref_ids; pref_root.GetChildIds(&pref_ids); - for (uint32 i = 0; i < pref_ids.size(); ++i) { + for (uint32_t i = 0; i < pref_ids.size(); ++i) { syncable::MutableEntry entry(trans.GetWrappedWriteTrans(), syncable::GET_BY_HANDLE, pref_ids[i]); if (entry.good()) { diff --git a/sync/internal_api/sync_backup_manager.h b/sync/internal_api/sync_backup_manager.h index 0e0227e..e7e50fa 100644 --- a/sync/internal_api/sync_backup_manager.h +++ b/sync/internal_api/sync_backup_manager.h @@ -5,8 +5,11 @@ #ifndef SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ #define SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ +#include <stdint.h> + #include <set> +#include "base/macros.h" #include "sync/internal_api/sync_rollback_manager_base.h" #include "url/gurl.h" @@ -52,7 +55,7 @@ class SYNC_EXPORT SyncBackupManager : public SyncRollbackManagerBase { void HideSyncPreference(ModelType pref_type); // Handles of unsynced entries caused by local model changes. - std::set<int64> unsynced_; + std::set<int64_t> unsynced_; // True if NormalizeEntries() is being called. bool in_normalization_; diff --git a/sync/internal_api/sync_encryption_handler_impl.cc b/sync/internal_api/sync_encryption_handler_impl.cc index 3ea242c..7bd10b9 100644 --- a/sync/internal_api/sync_encryption_handler_impl.cc +++ b/sync/internal_api/sync_encryption_handler_impl.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/sync_encryption_handler_impl.h" +#include <stddef.h> +#include <stdint.h> + #include <queue> #include <string> @@ -833,8 +836,8 @@ void SyncEncryptionHandlerImpl::ReEncryptEverything( 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; - int64 child_id = type_root.GetFirstChildId(); + std::queue<int64_t> to_visit; + int64_t child_id = type_root.GetFirstChildId(); to_visit.push(child_id); while (!to_visit.empty()) { child_id = to_visit.front(); @@ -861,7 +864,7 @@ void SyncEncryptionHandlerImpl::ReEncryptEverything( // encrypted so we don't need to check GetEncryptedTypes() here. ReadNode passwords_root(trans); if (passwords_root.InitTypeRoot(PASSWORDS) == BaseNode::INIT_OK) { - int64 child_id = passwords_root.GetFirstChildId(); + int64_t child_id = passwords_root.GetFirstChildId(); while (child_id != kInvalidId) { WriteNode child(trans); if (child.InitByIdLookup(child_id) != BaseNode::INIT_OK) diff --git a/sync/internal_api/sync_encryption_handler_impl.h b/sync/internal_api/sync_encryption_handler_impl.h index babc942..aab9c54 100644 --- a/sync/internal_api/sync_encryption_handler_impl.h +++ b/sync/internal_api/sync_encryption_handler_impl.h @@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" diff --git a/sync/internal_api/sync_encryption_handler_impl_unittest.cc b/sync/internal_api/sync_encryption_handler_impl_unittest.cc index 7fd105b..21ad3d7 100644 --- a/sync/internal_api/sync_encryption_handler_impl_unittest.cc +++ b/sync/internal_api/sync_encryption_handler_impl_unittest.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/sync_encryption_handler_impl.h" +#include <stdint.h> + #include <string> #include "base/base64.h" @@ -146,10 +148,9 @@ class SyncEncryptionHandlerImplTest : public ::testing::Test { VerifyMigratedNigoriWithTimestamp(0, passphrase_type, passphrase); } - void VerifyMigratedNigoriWithTimestamp( - int64 migration_time, - PassphraseType passphrase_type, - const std::string& passphrase) { + void VerifyMigratedNigoriWithTimestamp(int64_t migration_time, + PassphraseType passphrase_type, + const std::string& passphrase) { ReadTransaction trans(FROM_HERE, user_share()); ReadNode nigori_node(&trans); ASSERT_EQ(nigori_node.InitTypeRoot(NIGORI), BaseNode::INIT_OK); @@ -196,7 +197,7 @@ class SyncEncryptionHandlerImplTest : public ::testing::Test { sync_pb::NigoriSpecifics BuildMigratedNigori( PassphraseType passphrase_type, - int64 migration_time, + int64_t migration_time, const std::string& default_passphrase, const std::string& keystore_key) { DCHECK_NE(passphrase_type, IMPLICIT_PASSPHRASE); @@ -239,7 +240,7 @@ class SyncEncryptionHandlerImplTest : public ::testing::Test { // Build a migrated nigori node with the specified default passphrase // and keystore key and initialize the encryption handler with it. - void InitKeystoreMigratedNigori(int64 migration_time, + void InitKeystoreMigratedNigori(int64_t migration_time, const std::string& default_passphrase, const std::string& keystore_key) { { @@ -273,7 +274,7 @@ class SyncEncryptionHandlerImplTest : public ::testing::Test { // Build a migrated nigori node with the specified default passphrase // as a custom passphrase. - void InitCustomPassMigratedNigori(int64 migration_time, + void InitCustomPassMigratedNigori(int64_t migration_time, const std::string& default_passphrase) { { WriteTransaction trans(FROM_HERE, user_share()); @@ -344,7 +345,7 @@ class SyncEncryptionHandlerImplTest : public ::testing::Test { // // |passphrase| is the custom passphrase. void VerifyRestoreAfterCustomPassphrase( - int64 migration_time, + int64_t migration_time, const std::string& passphrase, const std::string& bootstrap_token, const SyncEncryptionHandler::NigoriState& nigori_state, @@ -1338,7 +1339,7 @@ TEST_F(SyncEncryptionHandlerImplTest, ReceiveUnmigratedNigoriAfterMigration) { GetCryptographer()->AddKey(cur_key); // Build a migrated nigori with full encryption. - const int64 migration_time = 1; + const int64_t migration_time = 1; { WriteTransaction trans(FROM_HERE, user_share()); WriteNode nigori_node(&trans); @@ -1476,7 +1477,7 @@ TEST_F(SyncEncryptionHandlerImplTest, ReceiveOldMigratedNigori) { EXPECT_CALL(*observer(), OnLocalSetPassphraseEncryption(_)) .WillOnce(testing::SaveArg<0>(&captured_nigori_state)); EXPECT_CALL(*observer(), OnEncryptionComplete()); - const int64 migration_time = 1; + const int64_t migration_time = 1; { WriteTransaction trans(FROM_HERE, user_share()); WriteNode nigori_node(&trans); @@ -1616,7 +1617,7 @@ TEST_F(SyncEncryptionHandlerImplTest, SetCustomPassAfterMigration) { // Build a nigori node with the generated keystore decryptor token and // initialize the encryption handler with it. The cryptographer should be // initialized properly to decrypt both kOldKey and kKeystoreKey. - const int64 migration_time = 1; + const int64_t migration_time = 1; { WriteTransaction trans(FROM_HERE, user_share()); WriteNode nigori_node(&trans); @@ -1733,7 +1734,7 @@ TEST_F(SyncEncryptionHandlerImplTest, // Build a nigori node with the generated keystore decryptor token and // initialize the encryption handler with it. The cryptographer will have // pending keys until we provide the decryption passphrase. - const int64 migration_time = 1; + const int64_t migration_time = 1; { WriteTransaction trans(FROM_HERE, user_share()); WriteNode nigori_node(&trans); @@ -1947,7 +1948,7 @@ TEST_F(SyncEncryptionHandlerImplTest, // Build a nigori node with the generated keystore decryptor token and // initialize the encryption handler with it. The cryptographer will have // pending keys until we provide the decryption passphrase. - const int64 migration_time = 1; + const int64_t migration_time = 1; { WriteTransaction trans(FROM_HERE, user_share()); WriteNode nigori_node(&trans); @@ -2414,7 +2415,7 @@ TEST_F(SyncEncryptionHandlerImplTest, RotateKeysMigratedCustomPassphrase) { KeyParams custom_key = {"localhost", "dummy", kCustomPass}; GetCryptographer()->AddKey(custom_key); - const int64 migration_time = 1; + const int64_t migration_time = 1; InitCustomPassMigratedNigori(migration_time, kCustomPass); VerifyMigratedNigoriWithTimestamp(migration_time, CUSTOM_PASSPHRASE, kCustomPass); diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc index 95c30de1..046ee3d 100644 --- a/sync/internal_api/sync_manager_impl.cc +++ b/sync/internal_api/sync_manager_impl.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/sync_manager_impl.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include "base/base64.h" @@ -680,7 +683,7 @@ SyncManagerImpl::HandleTransactionEndingChangeEvent( void SyncManagerImpl::HandleCalculateChangesChangeEventFromSyncApi( const ImmutableWriteTransactionInfo& write_transaction_info, syncable::BaseTransaction* trans, - std::vector<int64>* entries_changed) { + std::vector<int64_t>* entries_changed) { // We have been notified about a user action changing a sync model. LOG_IF(WARNING, !change_records_.empty()) << "CALCULATE_CHANGES called with unapplied old changes."; @@ -723,10 +726,14 @@ void SyncManagerImpl::HandleCalculateChangesChangeEventFromSyncApi( } } -void SyncManagerImpl::SetExtraChangeRecordData(int64 id, - ModelType type, ChangeReorderBuffer* buffer, - Cryptographer* cryptographer, const syncable::EntryKernel& original, - bool existed_before, bool exists_now) { +void SyncManagerImpl::SetExtraChangeRecordData( + int64_t id, + ModelType type, + ChangeReorderBuffer* buffer, + Cryptographer* cryptographer, + const syncable::EntryKernel& original, + bool existed_before, + bool exists_now) { // If this is a deletion and the datatype was encrypted, we need to decrypt it // and attach it to the buffer. if (!exists_now && existed_before) { @@ -756,7 +763,7 @@ void SyncManagerImpl::SetExtraChangeRecordData(int64 id, void SyncManagerImpl::HandleCalculateChangesChangeEventFromSyncer( const ImmutableWriteTransactionInfo& write_transaction_info, syncable::BaseTransaction* trans, - std::vector<int64>* entries_changed) { + std::vector<int64_t>* entries_changed) { // We only expect one notification per sync step, so change_buffers_ should // contain no pending entries. LOG_IF(WARNING, !change_records_.empty()) << @@ -778,7 +785,7 @@ void SyncManagerImpl::HandleCalculateChangesChangeEventFromSyncer( if (type < FIRST_REAL_MODEL_TYPE) continue; - int64 handle = it->first; + int64_t handle = it->first; if (exists_now && !existed_before) change_buffers[type].PushAddedItem(handle); else if (!exists_now && existed_before) diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h index 18c66df..5efc905 100644 --- a/sync/internal_api/sync_manager_impl.h +++ b/sync/internal_api/sync_manager_impl.h @@ -5,11 +5,14 @@ #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_ #define SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_ +#include <stdint.h> + #include <map> #include <string> #include <vector> #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "net/base/network_change_notifier.h" #include "sync/base/sync_export.h" #include "sync/engine/all_status.h" @@ -159,11 +162,11 @@ class SYNC_EXPORT SyncManagerImpl void HandleCalculateChangesChangeEventFromSyncApi( const syncable::ImmutableWriteTransactionInfo& write_transaction_info, syncable::BaseTransaction* trans, - std::vector<int64>* entries_changed) override; + std::vector<int64_t>* entries_changed) override; void HandleCalculateChangesChangeEventFromSyncer( const syncable::ImmutableWriteTransactionInfo& write_transaction_info, syncable::BaseTransaction* trans, - std::vector<int64>* entries_changed) override; + std::vector<int64_t>* entries_changed) override; // Handle explicit requests to fetch updates for the given types. void RefreshTypes(ModelTypeSet types) override; @@ -243,7 +246,7 @@ class SYNC_EXPORT SyncManagerImpl // If this is a deletion for a password, sets the legacy // ExtraPasswordChangeRecordData field of |buffer|. Otherwise sets // |buffer|'s specifics field to contain the unencrypted data. - void SetExtraChangeRecordData(int64 id, + void SetExtraChangeRecordData(int64_t id, ModelType type, ChangeReorderBuffer* buffer, Cryptographer* cryptographer, diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index 67aba25..4f08cb6 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -6,10 +6,11 @@ // functionality is provided by the Syncable layer, which has its own // unit tests. We'll test SyncApi specific things in this harness. +#include <stdint.h> + #include <cstddef> #include <map> -#include "base/basictypes.h" #include "base/callback.h" #include "base/compiler_specific.h" #include "base/files/scoped_temp_dir.h" @@ -97,9 +98,9 @@ namespace { // Makes a child node under the type root folder. Returns the id of the // newly-created node. -int64 MakeNode(UserShare* share, - ModelType model_type, - const std::string& client_tag) { +int64_t MakeNode(UserShare* share, + ModelType model_type, + const std::string& client_tag) { WriteTransaction trans(FROM_HERE, share); WriteNode node(&trans); WriteNode::InitUniqueByCreationResult result = @@ -111,9 +112,9 @@ int64 MakeNode(UserShare* share, // Makes a non-folder child of the root node. Returns the id of the // newly-created node. -int64 MakeNodeWithRoot(UserShare* share, - ModelType model_type, - const std::string& client_tag) { +int64_t MakeNodeWithRoot(UserShare* share, + ModelType model_type, + const std::string& client_tag) { WriteTransaction trans(FROM_HERE, share); ReadNode root_node(&trans); root_node.InitByRootLookup(); @@ -127,10 +128,10 @@ int64 MakeNodeWithRoot(UserShare* share, // Makes a folder child of a non-root node. Returns the id of the // newly-created node. -int64 MakeFolderWithParent(UserShare* share, - ModelType model_type, - int64 parent_id, - BaseNode* predecessor) { +int64_t MakeFolderWithParent(UserShare* share, + ModelType model_type, + int64_t parent_id, + BaseNode* predecessor) { WriteTransaction trans(FROM_HERE, share); ReadNode parent_node(&trans); EXPECT_EQ(BaseNode::INIT_OK, parent_node.InitByIdLookup(parent_id)); @@ -140,9 +141,9 @@ int64 MakeFolderWithParent(UserShare* share, return node.GetId(); } -int64 MakeBookmarkWithParent(UserShare* share, - int64 parent_id, - BaseNode* predecessor) { +int64_t MakeBookmarkWithParent(UserShare* share, + int64_t parent_id, + BaseNode* predecessor) { WriteTransaction trans(FROM_HERE, share); ReadNode parent_node(&trans); EXPECT_EQ(BaseNode::INIT_OK, parent_node.InitByIdLookup(parent_id)); @@ -154,7 +155,7 @@ int64 MakeBookmarkWithParent(UserShare* share, // Creates the "synced" root node for a particular datatype. We use the syncable // methods here so that the syncer treats these nodes as if they were already // received from the server. -int64 MakeTypeRoot(UserShare* share, ModelType model_type) { +int64_t MakeTypeRoot(UserShare* share, ModelType model_type) { sync_pb::EntitySpecifics specifics; AddDefaultFieldValue(model_type, &specifics); syncable::WriteTransaction trans( @@ -181,10 +182,11 @@ int64 MakeTypeRoot(UserShare* share, ModelType model_type) { } // Simulates creating a "synced" node as a child of the root datatype node. -int64 MakeServerNode(UserShare* share, ModelType model_type, - const std::string& client_tag, - const std::string& hashed_tag, - const sync_pb::EntitySpecifics& specifics) { +int64_t MakeServerNode(UserShare* share, + ModelType model_type, + const std::string& client_tag, + const std::string& hashed_tag, + const sync_pb::EntitySpecifics& specifics) { syncable::WriteTransaction trans( FROM_HERE, syncable::UNITTEST, share->directory.get()); syncable::Entry root_entry(&trans, syncable::GET_TYPE_ROOT, model_type); @@ -209,7 +211,7 @@ int64 MakeServerNode(UserShare* share, ModelType model_type, return entry.GetMetahandle(); } -int GetTotalNodeCount(UserShare* share, int64 root) { +int GetTotalNodeCount(UserShare* share, int64_t root) { ReadTransaction trans(FROM_HERE, share); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(root)); @@ -343,7 +345,7 @@ TEST_F(SyncApiTest, BasicTagWrite) { } TEST_F(SyncApiTest, BasicTagWriteWithImplicitParent) { - int64 type_root = MakeTypeRoot(user_share(), PREFERENCES); + int64_t type_root = MakeTypeRoot(user_share(), PREFERENCES); { ReadTransaction trans(FROM_HERE, user_share()); @@ -423,8 +425,8 @@ TEST_F(SyncApiTest, ReadMissingTagsFails) { // TODO(chron): Hook this all up to the server and write full integration tests // for update->undelete behavior. TEST_F(SyncApiTest, TestDeleteBehavior) { - int64 node_id; - int64 folder_id; + int64_t node_id; + int64_t folder_id; std::string test_title("test1"); { @@ -603,7 +605,7 @@ TEST_F(SyncApiTest, WriteEmptyBookmarkTitle) { } TEST_F(SyncApiTest, BaseNodeSetSpecifics) { - int64 child_id = MakeNodeWithRoot(user_share(), BOOKMARKS, "testtag"); + int64_t child_id = MakeNodeWithRoot(user_share(), BOOKMARKS, "testtag"); WriteTransaction trans(FROM_HERE, user_share()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(child_id)); @@ -619,7 +621,7 @@ TEST_F(SyncApiTest, BaseNodeSetSpecifics) { } TEST_F(SyncApiTest, BaseNodeSetSpecificsPreservesUnknownFields) { - int64 child_id = MakeNodeWithRoot(user_share(), BOOKMARKS, "testtag"); + int64_t child_id = MakeNodeWithRoot(user_share(), BOOKMARKS, "testtag"); WriteTransaction trans(FROM_HERE, user_share()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(child_id)); @@ -651,14 +653,15 @@ TEST_F(SyncApiTest, EmptyTags) { // Test counting nodes when the type's root node has no children. TEST_F(SyncApiTest, GetTotalNodeCountEmpty) { - int64 type_root = MakeTypeRoot(user_share(), BOOKMARKS); + int64_t type_root = MakeTypeRoot(user_share(), BOOKMARKS); EXPECT_EQ(1, GetTotalNodeCount(user_share(), type_root)); } // Test counting nodes when there is one child beneath the type's root. TEST_F(SyncApiTest, GetTotalNodeCountOneChild) { - int64 type_root = MakeTypeRoot(user_share(), BOOKMARKS); - int64 parent = MakeFolderWithParent(user_share(), BOOKMARKS, type_root, NULL); + int64_t type_root = MakeTypeRoot(user_share(), BOOKMARKS); + int64_t parent = + MakeFolderWithParent(user_share(), BOOKMARKS, type_root, NULL); EXPECT_EQ(2, GetTotalNodeCount(user_share(), type_root)); EXPECT_EQ(1, GetTotalNodeCount(user_share(), parent)); } @@ -666,10 +669,11 @@ TEST_F(SyncApiTest, GetTotalNodeCountOneChild) { // Test counting nodes when there are multiple children beneath the type root, // and one of those children has children of its own. TEST_F(SyncApiTest, GetTotalNodeCountMultipleChildren) { - int64 type_root = MakeTypeRoot(user_share(), BOOKMARKS); - int64 parent = MakeFolderWithParent(user_share(), BOOKMARKS, type_root, NULL); + int64_t type_root = MakeTypeRoot(user_share(), BOOKMARKS); + int64_t parent = + MakeFolderWithParent(user_share(), BOOKMARKS, type_root, NULL); ignore_result(MakeFolderWithParent(user_share(), BOOKMARKS, type_root, NULL)); - int64 child1 = MakeFolderWithParent(user_share(), BOOKMARKS, parent, NULL); + int64_t child1 = MakeFolderWithParent(user_share(), BOOKMARKS, parent, NULL); ignore_result(MakeBookmarkWithParent(user_share(), parent, NULL)); ignore_result(MakeBookmarkWithParent(user_share(), child1, NULL)); EXPECT_EQ(6, GetTotalNodeCount(user_share(), type_root)); @@ -731,10 +735,10 @@ TEST_F(SyncApiTest, AttachmentLinking) { // with client tag matching that of an existing unapplied node with server only // data. See crbug.com/505761. TEST_F(SyncApiTest, WriteNode_UniqueByCreation_UndeleteCase) { - int64 preferences_root = MakeTypeRoot(user_share(), PREFERENCES); + int64_t preferences_root = MakeTypeRoot(user_share(), PREFERENCES); // Create a node with server only data. - int64 item1 = 0; + int64_t item1 = 0; { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, user_share()->directory.get()); @@ -757,7 +761,7 @@ TEST_F(SyncApiTest, WriteNode_UniqueByCreation_UndeleteCase) { EXPECT_EQ(1, GetTotalNodeCount(user_share(), preferences_root)); // Create a client node with the same tag as the node above. - int64 item2 = MakeNode(user_share(), PREFERENCES, "foo"); + int64_t item2 = MakeNode(user_share(), PREFERENCES, "foo"); // Expect this to be the same directory entry as |item1|. EXPECT_EQ(item1, item2); // Expect it to be visible as a child of |preferences_root|. @@ -960,11 +964,10 @@ class SyncManagerTest : public testing::Test, return GetRoutingInfoTypes(routing_info); } - void OnChangesApplied( - ModelType model_type, - int64 model_version, - const BaseTransaction* trans, - const ImmutableChangeRecordList& changes) override {} + void OnChangesApplied(ModelType model_type, + int64_t model_version, + const BaseTransaction* trans, + const ImmutableChangeRecordList& changes) override {} void OnChangesComplete(ModelType model_type) override {} @@ -974,7 +977,7 @@ class SyncManagerTest : public testing::Test, UserShare* share = sync_manager_.GetUserShare(); // We need to create the nigori node as if it were an applied server update. - int64 nigori_id = GetIdForDataType(NIGORI); + int64_t nigori_id = GetIdForDataType(NIGORI); if (nigori_id == kInvalidId) return false; @@ -1005,7 +1008,7 @@ class SyncManagerTest : public testing::Test, return cryptographer->is_ready(); } - int64 GetIdForDataType(ModelType type) { + int64_t GetIdForDataType(ModelType type) { if (type_roots_.count(type) == 0) return 0; return type_roots_[type]; @@ -1118,7 +1121,7 @@ class SyncManagerTest : public testing::Test, // Needed by |sync_manager_|. base::ScopedTempDir temp_dir_; // Sync Id's for the roots of the enabled datatypes. - std::map<ModelType, int64> type_roots_; + std::map<ModelType, int64_t> type_roots_; scoped_refptr<ExtensionsActivity> extensions_activity_; protected: @@ -1237,10 +1240,8 @@ TEST_F(SyncManagerTest, EncryptDataTypesWithData) { EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION)); // Create some unencrypted unsynced data. - int64 folder = MakeFolderWithParent(sync_manager_.GetUserShare(), - BOOKMARKS, - GetIdForDataType(BOOKMARKS), - NULL); + int64_t folder = MakeFolderWithParent(sync_manager_.GetUserShare(), BOOKMARKS, + GetIdForDataType(BOOKMARKS), NULL); // First batch_size nodes are children of folder. size_t i; for (i = 0; i < batch_size; ++i) { @@ -1639,7 +1640,7 @@ TEST_F(SyncManagerTest, SupplyPendingGAIAPassUserProvided) { TEST_F(SyncManagerTest, SetPassphraseWithEmptyPasswordNode) { EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION)); - int64 node_id = 0; + int64_t node_id = 0; std::string tag = "foo"; { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); @@ -1684,9 +1685,9 @@ TEST_F(SyncManagerTest, EncryptBookmarksWithLegacyData) { std::string url2 = "http://www.bla.com"; // Create a bookmark using the legacy format. - int64 node_id1 = + int64_t node_id1 = MakeNodeWithRoot(sync_manager_.GetUserShare(), BOOKMARKS, "testtag"); - int64 node_id2 = + int64_t node_id2 = MakeNodeWithRoot(sync_manager_.GetUserShare(), BOOKMARKS, "testtag2"); { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); @@ -1797,7 +1798,7 @@ TEST_F(SyncManagerTest, CreateLocalBookmark) { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode bookmark_root(&trans); ASSERT_EQ(BaseNode::INIT_OK, bookmark_root.InitTypeRoot(BOOKMARKS)); - int64 child_id = bookmark_root.GetFirstChildId(); + int64_t child_id = bookmark_root.GetFirstChildId(); ReadNode node(&trans); ASSERT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(child_id)); @@ -2840,7 +2841,7 @@ TEST_F(SyncManagerTest, PurgeUnappliedTypes) { AddDefaultFieldValue(BOOKMARKS, &bm_specifics); int pref1_meta = MakeServerNode( share, PREFERENCES, "pref1", "hash1", pref_specifics); - int64 pref2_meta = MakeNodeWithRoot(share, PREFERENCES, "pref2"); + int64_t pref2_meta = MakeNodeWithRoot(share, PREFERENCES, "pref2"); int pref3_meta = MakeServerNode( share, PREFERENCES, "pref3", "hash3", pref_specifics); int pref4_meta = MakeServerNode( @@ -2956,7 +2957,7 @@ TEST_F(SyncManagerTest, PurgeUnappliedTypes) { class SyncManagerChangeProcessingTest : public SyncManagerTest { public: void OnChangesApplied(ModelType model_type, - int64 model_version, + int64_t model_version, const BaseTransaction* trans, const ImmutableChangeRecordList& changes) override { last_changes_ = changes; @@ -2985,7 +2986,7 @@ class SyncManagerChangeProcessingTest : public SyncManagerTest { // Looks for the given change in the list. Returns the index at which it was // found. Returns -1 on lookup failure. - size_t FindChangeInList(int64 id, ChangeRecord::Action action) { + size_t FindChangeInList(int64_t id, ChangeRecord::Action action) { SCOPED_TRACE(id); for (size_t i = 0; i < last_changes_.Get().size(); ++i) { if (last_changes_.Get()[i].id == id @@ -3015,9 +3016,9 @@ class SyncManagerChangeProcessingTest : public SyncManagerTest { // Test creation of a folder and a bookmark. TEST_F(SyncManagerChangeProcessingTest, AddBookmarks) { - int64 type_root = GetIdForDataType(BOOKMARKS); - int64 folder_id = kInvalidId; - int64 child_id = kInvalidId; + int64_t type_root = GetIdForDataType(BOOKMARKS); + int64_t folder_id = kInvalidId; + int64_t child_id = kInvalidId; // Create a folder and a bookmark under it. { @@ -3057,8 +3058,8 @@ TEST_F(SyncManagerChangeProcessingTest, AddBookmarks) { // Test creation of a preferences (with implicit parent Id) TEST_F(SyncManagerChangeProcessingTest, AddPreferences) { - int64 item1_id = kInvalidId; - int64 item2_id = kInvalidId; + int64_t item1_id = kInvalidId; + int64_t item2_id = kInvalidId; // Create two preferences. { @@ -3090,9 +3091,9 @@ TEST_F(SyncManagerChangeProcessingTest, AddPreferences) { // Test moving a bookmark into an empty folder. TEST_F(SyncManagerChangeProcessingTest, MoveBookmarkIntoEmptyFolder) { - int64 type_root = GetIdForDataType(BOOKMARKS); - int64 folder_b_id = kInvalidId; - int64 child_id = kInvalidId; + int64_t type_root = GetIdForDataType(BOOKMARKS); + int64_t folder_b_id = kInvalidId; + int64_t child_id = kInvalidId; // Create two folders. Place a child under folder A. { @@ -3147,9 +3148,9 @@ TEST_F(SyncManagerChangeProcessingTest, MoveBookmarkIntoEmptyFolder) { // Test moving a bookmark into a non-empty folder. TEST_F(SyncManagerChangeProcessingTest, MoveIntoPopulatedFolder) { - int64 type_root = GetIdForDataType(BOOKMARKS); - int64 child_a_id = kInvalidId; - int64 child_b_id = kInvalidId; + int64_t type_root = GetIdForDataType(BOOKMARKS); + int64_t child_a_id = kInvalidId; + int64_t child_b_id = kInvalidId; // Create two folders. Place one child each under folder A and folder B. { @@ -3208,10 +3209,10 @@ TEST_F(SyncManagerChangeProcessingTest, MoveIntoPopulatedFolder) { // Tests the ordering of deletion changes. TEST_F(SyncManagerChangeProcessingTest, DeletionsAndChanges) { - int64 type_root = GetIdForDataType(BOOKMARKS); - int64 folder_a_id = kInvalidId; - int64 folder_b_id = kInvalidId; - int64 child_id = kInvalidId; + int64_t type_root = GetIdForDataType(BOOKMARKS); + int64_t folder_a_id = kInvalidId; + int64_t folder_b_id = kInvalidId; + int64_t child_id = kInvalidId; // Create two folders. Place a child under folder A. { @@ -3280,11 +3281,11 @@ TEST_F(SyncManagerChangeProcessingTest, DeletionsAndChanges) { // SyncManagerImpl::VisiblePropertiesDiffer. TEST_F(SyncManagerChangeProcessingTest, AttachmentMetadataOnlyChanges) { // Create an article with no attachments. See that a change is generated. - int64 article_id = kInvalidId; + int64_t article_id = kInvalidId; { syncable::WriteTransaction trans( FROM_HERE, syncable::SYNCER, share()->directory.get()); - int64 type_root = GetIdForDataType(ARTICLES); + int64_t type_root = GetIdForDataType(ARTICLES); syncable::Entry root(&trans, syncable::GET_BY_HANDLE, type_root); ASSERT_TRUE(root.good()); syncable::MutableEntry article( diff --git a/sync/internal_api/sync_rollback_manager.cc b/sync/internal_api/sync_rollback_manager.cc index 3ec76ce..e2a5c84 100644 --- a/sync/internal_api/sync_rollback_manager.cc +++ b/sync/internal_api/sync_rollback_manager.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/sync_rollback_manager.h" +#include <stddef.h> +#include <stdint.h> + #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/read_node.h" #include "sync/internal_api/public/read_transaction.h" @@ -87,7 +90,8 @@ void SyncRollbackManager::StartSyncingNormally( } SyncerError SyncRollbackManager::DeleteOnWorkerThread( - ModelType type, std::vector<int64> handles) { + ModelType type, + std::vector<int64_t> handles) { CHECK(change_delegate_); { diff --git a/sync/internal_api/sync_rollback_manager.h b/sync/internal_api/sync_rollback_manager.h index 86c5085..d41086a 100644 --- a/sync/internal_api/sync_rollback_manager.h +++ b/sync/internal_api/sync_rollback_manager.h @@ -5,10 +5,13 @@ #ifndef SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_H_ #define SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_H_ +#include <stdint.h> + #include <map> #include <string> #include <vector> +#include "base/macros.h" #include "sync/internal_api/sync_rollback_manager_base.h" class GURL; @@ -29,7 +32,8 @@ class SYNC_EXPORT SyncRollbackManager : public SyncRollbackManagerBase { private: // Deletes specified entries in local model. - SyncerError DeleteOnWorkerThread(ModelType type, std::vector<int64> handles); + SyncerError DeleteOnWorkerThread(ModelType type, + std::vector<int64_t> handles); void NotifyRollbackDone(); diff --git a/sync/internal_api/sync_rollback_manager_base.cc b/sync/internal_api/sync_rollback_manager_base.cc index 2de9686..3ec3005 100644 --- a/sync/internal_api/sync_rollback_manager_base.cc +++ b/sync/internal_api/sync_rollback_manager_base.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/sync_rollback_manager_base.h" +#include <stdint.h> + #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/read_node.h" #include "sync/internal_api/public/read_transaction.h" @@ -178,16 +180,14 @@ ModelTypeSet SyncRollbackManagerBase::HandleTransactionEndingChangeEvent( } void SyncRollbackManagerBase::HandleCalculateChangesChangeEventFromSyncApi( - const syncable::ImmutableWriteTransactionInfo& write_transaction_info, - syncable::BaseTransaction* trans, - std::vector<int64>* entries_changed) { -} + const syncable::ImmutableWriteTransactionInfo& write_transaction_info, + syncable::BaseTransaction* trans, + std::vector<int64_t>* entries_changed) {} void SyncRollbackManagerBase::HandleCalculateChangesChangeEventFromSyncer( - const syncable::ImmutableWriteTransactionInfo& write_transaction_info, - syncable::BaseTransaction* trans, - std::vector<int64>* entries_changed) { -} + const syncable::ImmutableWriteTransactionInfo& write_transaction_info, + syncable::BaseTransaction* trans, + std::vector<int64_t>* entries_changed) {} void SyncRollbackManagerBase::OnTransactionWrite( const syncable::ImmutableWriteTransactionInfo& write_transaction_info, diff --git a/sync/internal_api/sync_rollback_manager_base.h b/sync/internal_api/sync_rollback_manager_base.h index 8518ea5..ad3ad62 100644 --- a/sync/internal_api/sync_rollback_manager_base.h +++ b/sync/internal_api/sync_rollback_manager_base.h @@ -5,9 +5,12 @@ #ifndef SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_BASE_H_ #define SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_BASE_H_ +#include <stdint.h> + #include <string> #include <vector> +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/http_post_provider_factory.h" #include "sync/internal_api/public/internal_components_factory.h" @@ -81,11 +84,11 @@ class SYNC_EXPORT SyncRollbackManagerBase void HandleCalculateChangesChangeEventFromSyncApi( const syncable::ImmutableWriteTransactionInfo& write_transaction_info, syncable::BaseTransaction* trans, - std::vector<int64>* entries_changed) override; + std::vector<int64_t>* entries_changed) override; void HandleCalculateChangesChangeEventFromSyncer( const syncable::ImmutableWriteTransactionInfo& write_transaction_info, syncable::BaseTransaction* trans, - std::vector<int64>* entries_changed) override; + std::vector<int64_t>* entries_changed) override; // syncable::TransactionObserver implementation. void OnTransactionWrite( diff --git a/sync/internal_api/sync_rollback_manager_unittest.cc b/sync/internal_api/sync_rollback_manager_unittest.cc index 94ce3b1..55c5f43 100644 --- a/sync/internal_api/sync_rollback_manager_unittest.cc +++ b/sync/internal_api/sync_rollback_manager_unittest.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/sync_rollback_manager.h" +#include <stddef.h> +#include <stdint.h> + #include <set> #include "base/files/scoped_temp_dir.h" @@ -41,20 +44,18 @@ class TestChangeDelegate : public SyncManager::ChangeDelegate { &TestChangeDelegate::VerifyDeletes))); } - void add_expected_delete(int64 v) { - expected_deletes_.insert(v); - } + void add_expected_delete(int64_t v) { expected_deletes_.insert(v); } MOCK_METHOD4(OnChangesApplied, void(ModelType model_type, - int64 model_version, + int64_t model_version, const BaseTransaction* trans, const ImmutableChangeRecordList& changes)); MOCK_METHOD1(OnChangesComplete, void(ModelType model_type)); private: void VerifyDeletes(const ImmutableChangeRecordList& changes) { - std::set<int64> deleted; + std::set<int64_t> deleted; for (size_t i = 0; i < changes.Get().size(); ++i) { const ChangeRecord& change = (changes.Get())[i]; EXPECT_EQ(ChangeRecord::ACTION_DELETE, change.action); @@ -64,7 +65,7 @@ class TestChangeDelegate : public SyncManager::ChangeDelegate { EXPECT_TRUE(expected_deletes_ == deleted); } - std::set<int64> expected_deletes_; + std::set<int64_t> expected_deletes_; }; class SyncRollbackManagerTest : public testing::Test, @@ -91,8 +92,9 @@ class SyncRollbackManagerTest : public testing::Test, EXPECT_TRUE(success); } - int64 CreateEntry(UserShare* user_share, ModelType type, - const std::string& client_tag) { + int64_t CreateEntry(UserShare* user_share, + ModelType type, + const std::string& client_tag) { WriteTransaction trans(FROM_HERE, user_share); WriteNode node(&trans); EXPECT_EQ(WriteNode::INIT_SUCCESS, @@ -189,7 +191,7 @@ TEST_F(SyncRollbackManagerTest, RollbackBasic) { InternalComponentsFactory::STORAGE_ON_DISK); // Simulate a new entry added during type initialization. - int64 new_pref_id = + int64_t new_pref_id = CreateEntry(rollback_manager.GetUserShare(), PREFERENCES, "pref2"); delegate.add_expected_delete(new_pref_id); @@ -213,7 +215,7 @@ TEST_F(SyncRollbackManagerTest, NoRollbackOfTypesNotBackedUp) { InternalComponentsFactory::STORAGE_ON_DISK); // Simulate new entry added during type initialization. - int64 new_pref_id = + int64_t new_pref_id = CreateEntry(rollback_manager.GetUserShare(), PREFERENCES, "pref2"); CreateEntry(rollback_manager.GetUserShare(), APPS, "app1"); diff --git a/sync/internal_api/syncapi_internal.cc b/sync/internal_api/syncapi_internal.cc index d3ac523..5e715d7 100644 --- a/sync/internal_api/syncapi_internal.cc +++ b/sync/internal_api/syncapi_internal.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/syncapi_internal.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "sync/protocol/attachments.pb.h" #include "sync/protocol/password_specifics.pb.h" diff --git a/sync/internal_api/syncapi_server_connection_manager.cc b/sync/internal_api/syncapi_server_connection_manager.cc index 35ca1e2..16646ec 100644 --- a/sync/internal_api/syncapi_server_connection_manager.cc +++ b/sync/internal_api/syncapi_server_connection_manager.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/syncapi_server_connection_manager.h" +#include <stdint.h> + #include "net/base/net_errors.h" #include "net/http/http_status_code.h" #include "sync/internal_api/public/http_post_provider_factory.h" @@ -60,9 +62,9 @@ bool SyncAPIBridgedConnection::Init(const char* path, // We got a server response, copy over response codes and content. response->response_code = response_code; response->content_length = - static_cast<int64>(http->GetResponseContentLength()); + static_cast<int64_t>(http->GetResponseContentLength()); response->payload_length = - static_cast<int64>(http->GetResponseContentLength()); + static_cast<int64_t>(http->GetResponseContentLength()); if (response->response_code < 400) response->server_status = HttpResponse::SERVER_CONNECTION_OK; else if (response->response_code == net::HTTP_UNAUTHORIZED) diff --git a/sync/internal_api/syncapi_server_connection_manager.h b/sync/internal_api/syncapi_server_connection_manager.h index 103fac0..aa1fe1e 100644 --- a/sync/internal_api/syncapi_server_connection_manager.h +++ b/sync/internal_api/syncapi_server_connection_manager.h @@ -9,6 +9,7 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "sync/base/sync_export.h" #include "sync/engine/net/server_connection_manager.h" diff --git a/sync/internal_api/test/test_entry_factory.cc b/sync/internal_api/test/test_entry_factory.cc index 3dfb10c..7f5c20f 100644 --- a/sync/internal_api/test/test_entry_factory.cc +++ b/sync/internal_api/test/test_entry_factory.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/test/test_entry_factory.h" +#include <stdint.h> + #include "sync/syncable/directory.h" #include "sync/syncable/entry.h" #include "sync/syncable/mutable_entry.h" @@ -28,7 +30,7 @@ TestEntryFactory::TestEntryFactory(syncable::Directory *dir) TestEntryFactory::~TestEntryFactory() { } -int64 TestEntryFactory::CreateUnappliedNewItemWithParent( +int64_t TestEntryFactory::CreateUnappliedNewItemWithParent( const string& item_id, const sync_pb::EntitySpecifics& specifics, const string& parent_id) { @@ -46,7 +48,7 @@ int64 TestEntryFactory::CreateUnappliedNewItemWithParent( return entry.GetMetahandle(); } -int64 TestEntryFactory::CreateUnappliedNewBookmarkItemWithParent( +int64_t TestEntryFactory::CreateUnappliedNewBookmarkItemWithParent( const string& item_id, const sync_pb::EntitySpecifics& specifics, const string& parent_id) { @@ -65,7 +67,7 @@ int64 TestEntryFactory::CreateUnappliedNewBookmarkItemWithParent( return entry.GetMetahandle(); } -int64 TestEntryFactory::CreateUnappliedNewItem( +int64_t TestEntryFactory::CreateUnappliedNewItem( const string& item_id, const sync_pb::EntitySpecifics& specifics, bool is_unique) { @@ -86,13 +88,12 @@ int64 TestEntryFactory::CreateUnappliedNewItem( return entry.GetMetahandle(); } -void TestEntryFactory::CreateUnsyncedItem( - const Id& item_id, - const Id& parent_id, - const string& name, - bool is_folder, - ModelType model_type, - int64* metahandle_out) { +void TestEntryFactory::CreateUnsyncedItem(const Id& item_id, + const Id& parent_id, + const string& name, + bool is_folder, + ModelType model_type, + int64_t* metahandle_out) { if (is_folder) { DCHECK_EQ(model_type, BOOKMARKS); } @@ -122,9 +123,9 @@ void TestEntryFactory::CreateUnsyncedItem( *metahandle_out = entry.GetMetahandle(); } -int64 TestEntryFactory::CreateUnappliedAndUnsyncedBookmarkItem( +int64_t TestEntryFactory::CreateUnappliedAndUnsyncedBookmarkItem( const string& name) { - int64 metahandle = 0; + int64_t metahandle = 0; CreateUnsyncedItem( TestIdFactory::MakeServer(name), TestIdFactory::root(), name, false, BOOKMARKS, &metahandle); @@ -142,13 +143,14 @@ int64 TestEntryFactory::CreateUnappliedAndUnsyncedBookmarkItem( return metahandle; } -int64 TestEntryFactory::CreateSyncedItem( - const std::string& name, ModelType model_type, bool is_folder) { +int64_t TestEntryFactory::CreateSyncedItem(const std::string& name, + ModelType model_type, + bool is_folder) { WriteTransaction trans(FROM_HERE, UNITTEST, directory_); syncable::Id parent_id(TestIdFactory::root()); syncable::Id item_id(TestIdFactory::MakeServer(name)); - int64 version = GetNextRevision(); + int64_t version = GetNextRevision(); MutableEntry entry(&trans, syncable::CREATE, model_type, parent_id, name); if (!entry.good()) { @@ -175,8 +177,7 @@ int64 TestEntryFactory::CreateSyncedItem( return entry.GetMetahandle(); } -int64 TestEntryFactory::CreateUnappliedRootNode( - ModelType model_type) { +int64_t TestEntryFactory::CreateUnappliedRootNode(ModelType model_type) { syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, directory_); sync_pb::EntitySpecifics specifics; AddDefaultFieldValue(model_type, &specifics); @@ -198,7 +199,7 @@ int64 TestEntryFactory::CreateUnappliedRootNode( } bool TestEntryFactory::SetServerSpecificsForItem( - int64 meta_handle, + int64_t meta_handle, const sync_pb::EntitySpecifics specifics) { WriteTransaction trans(FROM_HERE, UNITTEST, directory_); MutableEntry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); @@ -211,7 +212,7 @@ bool TestEntryFactory::SetServerSpecificsForItem( } bool TestEntryFactory::SetLocalSpecificsForItem( - int64 meta_handle, + int64_t meta_handle, const sync_pb::EntitySpecifics specifics) { WriteTransaction trans(FROM_HERE, UNITTEST, directory_); MutableEntry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); @@ -224,7 +225,7 @@ bool TestEntryFactory::SetLocalSpecificsForItem( } const sync_pb::EntitySpecifics& TestEntryFactory::GetServerSpecificsForItem( - int64 meta_handle) const { + int64_t meta_handle) const { syncable::ReadTransaction trans(FROM_HERE, directory_); syncable::Entry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); DCHECK(entry.good()); @@ -232,7 +233,7 @@ const sync_pb::EntitySpecifics& TestEntryFactory::GetServerSpecificsForItem( } const sync_pb::EntitySpecifics& TestEntryFactory::GetLocalSpecificsForItem( - int64 meta_handle) const { + int64_t meta_handle) const { syncable::ReadTransaction trans(FROM_HERE, directory_); syncable::Entry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); DCHECK(entry.good()); @@ -240,7 +241,7 @@ const sync_pb::EntitySpecifics& TestEntryFactory::GetLocalSpecificsForItem( } bool TestEntryFactory::SetServerAttachmentMetadataForItem( - int64 meta_handle, + int64_t meta_handle, const sync_pb::AttachmentMetadata metadata) { WriteTransaction trans(FROM_HERE, UNITTEST, directory_); MutableEntry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); @@ -253,7 +254,7 @@ bool TestEntryFactory::SetServerAttachmentMetadataForItem( } bool TestEntryFactory::SetLocalAttachmentMetadataForItem( - int64 meta_handle, + int64_t meta_handle, const sync_pb::AttachmentMetadata metadata) { WriteTransaction trans(FROM_HERE, UNITTEST, directory_); MutableEntry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); @@ -266,7 +267,8 @@ bool TestEntryFactory::SetLocalAttachmentMetadataForItem( } const sync_pb::AttachmentMetadata& -TestEntryFactory::GetServerAttachmentMetadataForItem(int64 meta_handle) const { +TestEntryFactory::GetServerAttachmentMetadataForItem( + int64_t meta_handle) const { syncable::ReadTransaction trans(FROM_HERE, directory_); syncable::Entry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); DCHECK(entry.good()); @@ -274,14 +276,14 @@ TestEntryFactory::GetServerAttachmentMetadataForItem(int64 meta_handle) const { } const sync_pb::AttachmentMetadata& -TestEntryFactory::GetLocalAttachmentMetadataForItem(int64 meta_handle) const { +TestEntryFactory::GetLocalAttachmentMetadataForItem(int64_t meta_handle) const { syncable::ReadTransaction trans(FROM_HERE, directory_); syncable::Entry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); DCHECK(entry.good()); return entry.GetAttachmentMetadata(); } -bool TestEntryFactory::GetIsUnsyncedForItem(int64 meta_handle) const { +bool TestEntryFactory::GetIsUnsyncedForItem(int64_t meta_handle) const { syncable::ReadTransaction trans(FROM_HERE, directory_); syncable::Entry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); if (!entry.good()) { @@ -291,7 +293,7 @@ bool TestEntryFactory::GetIsUnsyncedForItem(int64 meta_handle) const { return entry.GetIsUnsynced(); } -bool TestEntryFactory::GetIsUnappliedForItem(int64 meta_handle) const { +bool TestEntryFactory::GetIsUnappliedForItem(int64_t meta_handle) const { syncable::ReadTransaction trans(FROM_HERE, directory_); syncable::Entry entry(&trans, syncable::GET_BY_HANDLE, meta_handle); if (!entry.good()) { @@ -301,7 +303,7 @@ bool TestEntryFactory::GetIsUnappliedForItem(int64 meta_handle) const { return entry.GetIsUnappliedUpdate(); } -int64 TestEntryFactory::GetNextRevision() { +int64_t TestEntryFactory::GetNextRevision() { return next_revision_++; } diff --git a/sync/internal_api/test/test_user_share.cc b/sync/internal_api/test/test_user_share.cc index 331807a..7b58d5c 100644 --- a/sync/internal_api/test/test_user_share.cc +++ b/sync/internal_api/test/test_user_share.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/test/test_user_share.h" +#include <stddef.h> + #include "base/compiler_specific.h" #include "sync/syncable/directory.h" #include "sync/syncable/mutable_entry.h" diff --git a/sync/internal_api/write_node.cc b/sync/internal_api/write_node.cc index 7a065a2..eb37d11 100644 --- a/sync/internal_api/write_node.cc +++ b/sync/internal_api/write_node.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/write_node.h" +#include <stdint.h> + #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" @@ -193,7 +195,7 @@ void WriteNode::SetTypedUrlSpecifics( SetEntitySpecifics(entity_specifics); } -void WriteNode::SetExternalId(int64 id) { +void WriteNode::SetExternalId(int64_t id) { if (GetExternalId() != id) entry_->PutLocalExternalId(id); } @@ -209,7 +211,7 @@ WriteNode::~WriteNode() { // Find an existing node matching the ID |id|, and bind this WriteNode to it. // Return true on success. -BaseNode::InitByLookupResult WriteNode::InitByIdLookup(int64 id) { +BaseNode::InitByLookupResult WriteNode::InitByIdLookup(int64_t id) { DCHECK(!entry_) << "Init called twice"; DCHECK_NE(id, kInvalidId); entry_ = new syncable::MutableEntry(transaction_->GetWrappedWriteTrans(), diff --git a/sync/internal_api/write_transaction.cc b/sync/internal_api/write_transaction.cc index 5415564..8ae7f9b 100644 --- a/sync/internal_api/write_transaction.cc +++ b/sync/internal_api/write_transaction.cc @@ -4,6 +4,8 @@ #include "sync/internal_api/public/write_transaction.h" +#include <stdint.h> + #include "sync/syncable/directory.h" #include "sync/syncable/mutable_entry.h" #include "sync/syncable/syncable_write_transaction.h" @@ -22,9 +24,8 @@ WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, UserShare* share, - int64* new_model_version) - : BaseTransaction(share), - transaction_(NULL) { + int64_t* new_model_version) + : BaseTransaction(share), transaction_(NULL) { transaction_ = new syncable::WriteTransaction(from_here, share->directory.get(), new_model_version); diff --git a/sync/js/js_test_util.cc b/sync/js/js_test_util.cc index f596136..268ecf8 100644 --- a/sync/js/js_test_util.cc +++ b/sync/js/js_test_util.cc @@ -4,7 +4,7 @@ #include "sync/js/js_test_util.h" -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "sync/js/js_event_details.h" diff --git a/sync/js/sync_js_controller.h b/sync/js/sync_js_controller.h index 62474bc..cc325f1 100644 --- a/sync/js/sync_js_controller.h +++ b/sync/js/sync_js_controller.h @@ -8,8 +8,8 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "sync/base/sync_export.h" diff --git a/sync/protocol/proto_enum_conversions.cc b/sync/protocol/proto_enum_conversions.cc index 9f55f5a..0c6cf73 100644 --- a/sync/protocol/proto_enum_conversions.cc +++ b/sync/protocol/proto_enum_conversions.cc @@ -6,7 +6,6 @@ #include "sync/protocol/proto_enum_conversions.h" -#include "base/basictypes.h" #include "base/logging.h" namespace syncer { diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc index ddafb9c..4fee4ee 100644 --- a/sync/protocol/proto_value_conversions.cc +++ b/sync/protocol/proto_value_conversions.cc @@ -6,11 +6,12 @@ #include "sync/protocol/proto_value_conversions.h" +#include <stdint.h> + #include <algorithm> #include <string> #include "base/base64.h" -#include "base/basictypes.h" #include "base/i18n/time_formatting.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" @@ -50,7 +51,7 @@ namespace { // Basic Type -> Value functions. -scoped_ptr<base::StringValue> MakeInt64Value(int64 x) { +scoped_ptr<base::StringValue> MakeInt64Value(int64_t x) { return make_scoped_ptr(new base::StringValue(base::Int64ToString(x))); } @@ -79,7 +80,7 @@ scoped_ptr<base::ListValue> MakeRepeatedValue(const F& fields, return list; } -base::string16 TimestampToString(int64 tm) { +base::string16 TimestampToString(int64_t tm) { return base::TimeFormatShortDateAndTime(syncer::ProtoTimeToTime(tm)); } diff --git a/sync/sessions/data_type_tracker.cc b/sync/sessions/data_type_tracker.cc index b4d7bee..63cf523 100644 --- a/sync/sessions/data_type_tracker.cc +++ b/sync/sessions/data_type_tracker.cc @@ -4,6 +4,8 @@ #include "sync/sessions/data_type_tracker.h" +#include <stddef.h> + #include <algorithm> #include "base/logging.h" diff --git a/sync/sessions/data_type_tracker.h b/sync/sessions/data_type_tracker.h index a01d7c6..80fb164 100644 --- a/sync/sessions/data_type_tracker.h +++ b/sync/sessions/data_type_tracker.h @@ -5,9 +5,11 @@ #ifndef SYNC_SESSIONS_DATA_TYPE_TRACKER_H_ #define SYNC_SESSIONS_DATA_TYPE_TRACKER_H_ +#include <stddef.h> + #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/time/time.h" diff --git a/sync/sessions/directory_type_debug_info_emitter.cc b/sync/sessions/directory_type_debug_info_emitter.cc index d6b8721..aadf2dc 100644 --- a/sync/sessions/directory_type_debug_info_emitter.cc +++ b/sync/sessions/directory_type_debug_info_emitter.cc @@ -4,6 +4,8 @@ #include "sync/sessions/directory_type_debug_info_emitter.h" +#include <stdint.h> + #include <vector> #include "sync/internal_api/public/sessions/status_counters.h" @@ -69,13 +71,13 @@ void DirectoryTypeDebugInfoEmitter::EmitStatusCountersUpdate() { return; syncable::ReadTransaction trans(FROM_HERE, directory_); - std::vector<int64> result; + std::vector<int64_t> result; directory_->GetMetaHandlesOfType(&trans, type_, &result); StatusCounters counters; counters.num_entries_and_tombstones = result.size(); - for (std::vector<int64>::const_iterator it = result.begin(); + for (std::vector<int64_t>::const_iterator it = result.begin(); it != result.end(); ++it) { syncable::Entry e(&trans, syncable::GET_BY_HANDLE, *it); if (!e.GetIsDel()) { diff --git a/sync/sessions/model_type_registry.cc b/sync/sessions/model_type_registry.cc index b5f9654..03a0736 100644 --- a/sync/sessions/model_type_registry.cc +++ b/sync/sessions/model_type_registry.cc @@ -4,6 +4,8 @@ #include "sync/sessions/model_type_registry.h" +#include <stddef.h> + #include "base/bind.h" #include "base/observer_list.h" #include "base/thread_task_runner_handle.h" diff --git a/sync/sessions/model_type_registry.h b/sync/sessions/model_type_registry.h index c79173e..576535a 100644 --- a/sync/sessions/model_type_registry.h +++ b/sync/sessions/model_type_registry.h @@ -9,7 +9,7 @@ #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" diff --git a/sync/sessions/nudge_tracker.cc b/sync/sessions/nudge_tracker.cc index 023e6e6..a881740 100644 --- a/sync/sessions/nudge_tracker.cc +++ b/sync/sessions/nudge_tracker.cc @@ -4,9 +4,10 @@ #include "sync/sessions/nudge_tracker.h" +#include <stddef.h> + #include <utility> -#include "base/basictypes.h" #include "sync/internal_api/public/engine/polling_constants.h" #include "sync/protocol/sync.pb.h" diff --git a/sync/sessions/nudge_tracker.h b/sync/sessions/nudge_tracker.h index eb74d06..eb3b7eb 100644 --- a/sync/sessions/nudge_tracker.h +++ b/sync/sessions/nudge_tracker.h @@ -7,10 +7,13 @@ #ifndef SYNC_SESSIONS_NUDGE_TRACKER_H_ #define SYNC_SESSIONS_NUDGE_TRACKER_H_ +#include <stddef.h> + #include <list> #include <map> #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "sync/base/sync_export.h" diff --git a/sync/sessions/nudge_tracker_unittest.cc b/sync/sessions/nudge_tracker_unittest.cc index 43577a3..06e2c76 100644 --- a/sync/sessions/nudge_tracker_unittest.cc +++ b/sync/sessions/nudge_tracker_unittest.cc @@ -4,6 +4,9 @@ #include "sync/sessions/nudge_tracker.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include <vector> @@ -69,7 +72,7 @@ class NudgeTrackerTest : public ::testing::Test { } scoped_ptr<InvalidationInterface> BuildInvalidation( - int64 version, + int64_t version, const std::string& payload) { return MockInvalidation::Build(version, payload); } diff --git a/sync/sessions/status_controller.cc b/sync/sessions/status_controller.cc index 6f0f1ee..01b9781 100644 --- a/sync/sessions/status_controller.cc +++ b/sync/sessions/status_controller.cc @@ -6,7 +6,6 @@ #include <vector> -#include "base/basictypes.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync_protocol_error.h" diff --git a/sync/sessions/status_controller.h b/sync/sessions/status_controller.h index 144228b..9cf63d8 100644 --- a/sync/sessions/status_controller.h +++ b/sync/sessions/status_controller.h @@ -21,6 +21,7 @@ #include <vector> #include "base/logging.h" +#include "base/macros.h" #include "base/stl_util.h" #include "base/time/time.h" #include "sync/base/sync_export.h" diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h index e96b640..be66e15 100644 --- a/sync/sessions/sync_session.h +++ b/sync/sessions/sync_session.h @@ -16,7 +16,7 @@ #include <utility> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "sync/base/sync_export.h" diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h index 058244c..008e51a 100644 --- a/sync/sessions/sync_session_context.h +++ b/sync/sessions/sync_session_context.h @@ -15,9 +15,12 @@ #ifndef SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ #define SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ +#include <stdint.h> + #include <string> #include <vector> +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/engine/sync_engine_event_listener.h" #include "sync/sessions/debug_info_getter.h" @@ -89,7 +92,7 @@ class SYNC_EXPORT SyncSessionContext { void set_max_commit_batch_size(int batch_size) { max_commit_batch_size_ = batch_size; } - int32 max_commit_batch_size() const { return max_commit_batch_size_; } + int32_t max_commit_batch_size() const { return max_commit_batch_size_; } base::ObserverList<SyncEngineEventListener>* listeners() { return &listeners_; diff --git a/sync/syncable/deferred_on_disk_directory_backing_store.h b/sync/syncable/deferred_on_disk_directory_backing_store.h index 7656809..0531737 100644 --- a/sync/syncable/deferred_on_disk_directory_backing_store.h +++ b/sync/syncable/deferred_on_disk_directory_backing_store.h @@ -8,6 +8,7 @@ #include <string> #include "base/files/file_path.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/syncable/on_disk_directory_backing_store.h" diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc index a999bf6..9c51f00 100644 --- a/sync/syncable/directory.cc +++ b/sync/syncable/directory.cc @@ -4,6 +4,9 @@ #include "sync/syncable/directory.h" +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <iterator> @@ -146,7 +149,7 @@ void Directory::InitializeIndices(MetahandlesMap* handles_map) { EntryKernel* entry = it->second; if (ParentChildIndex::ShouldInclude(entry)) kernel_->parent_child_index.Insert(entry); - const int64 metahandle = entry->ref(META_HANDLE); + const int64_t metahandle = entry->ref(META_HANDLE); if (entry->ref(IS_UNSYNCED)) kernel_->unsynced_metahandles.insert(metahandle); if (entry->ref(IS_UNAPPLIED_UPDATE)) { @@ -274,13 +277,13 @@ EntryKernel* Directory::GetEntryByServerTag(const string& tag) { return NULL; } -EntryKernel* Directory::GetEntryByHandle(int64 metahandle) { +EntryKernel* Directory::GetEntryByHandle(int64_t metahandle) { ScopedKernelLock lock(this); return GetEntryByHandle(lock, metahandle); } EntryKernel* Directory::GetEntryByHandle(const ScopedKernelLock& lock, - int64 metahandle) { + int64_t metahandle) { // Look up in memory MetahandlesMap::iterator found = kernel_->metahandles_map.find(metahandle); @@ -441,7 +444,7 @@ bool Directory::ReindexParentId(BaseWriteTransaction* trans, void Directory::RemoveFromAttachmentIndex( const ScopedKernelLock& lock, - const int64 metahandle, + const int64_t metahandle, const sync_pb::AttachmentMetadata& attachment_metadata) { for (int i = 0; i < attachment_metadata.record_size(); ++i) { AttachmentIdUniqueId unique_id = @@ -459,7 +462,7 @@ void Directory::RemoveFromAttachmentIndex( void Directory::AddToAttachmentIndex( const ScopedKernelLock& lock, - const int64 metahandle, + const int64_t metahandle, const sync_pb::AttachmentMetadata& attachment_metadata) { for (int i = 0; i < attachment_metadata.record_size(); ++i) { AttachmentIdUniqueId unique_id = @@ -476,7 +479,7 @@ void Directory::AddToAttachmentIndex( } void Directory::UpdateAttachmentIndex( - const int64 metahandle, + const int64_t metahandle, const sync_pb::AttachmentMetadata& old_metadata, const sync_pb::AttachmentMetadata& new_metadata) { ScopedKernelLock lock(this); @@ -517,7 +520,7 @@ bool Directory::SafeToPurgeFromMemory(WriteTransaction* trans, !entry->ref(IS_UNSYNCED); if (safe) { - int64 handle = entry->ref(META_HANDLE); + int64_t handle = entry->ref(META_HANDLE); const ModelType type = entry->GetServerModelType(); if (!SyncAssert(kernel_->dirty_metahandles.count(handle) == 0U, FROM_HERE, @@ -647,7 +650,7 @@ bool Directory::VacuumAfterSaveChanges(const SaveChangesSnapshot& snapshot) { } void Directory::UnapplyEntry(EntryKernel* entry) { - int64 handle = entry->ref(META_HANDLE); + int64_t handle = entry->ref(META_HANDLE); ModelType server_type = GetModelTypeFromSpecifics( entry->ref(SERVER_SPECIFICS)); @@ -706,7 +709,7 @@ void Directory::DeleteEntry(const ScopedKernelLock& lock, bool save_to_journal, EntryKernel* entry, EntryKernelSet* entries_to_journal) { - int64 handle = entry->ref(META_HANDLE); + int64_t handle = entry->ref(META_HANDLE); ModelType server_type = GetModelTypeFromSpecifics( entry->ref(SERVER_SPECIFICS)); @@ -946,7 +949,7 @@ bool Directory::HasEmptyDownloadProgress(ModelType type) const { return kernel_->persisted_info.HasEmptyDownloadProgress(type); } -int64 Directory::GetTransactionVersion(ModelType type) const { +int64_t Directory::GetTransactionVersion(ModelType type) const { kernel_->transaction_mutex.AssertAcquired(); return kernel_->persisted_info.transaction_version[type]; } @@ -1085,7 +1088,7 @@ void Directory::GetUnsyncedMetaHandles(BaseTransaction* trans, kernel_->unsynced_metahandles.end(), back_inserter(*result)); } -int64 Directory::unsynced_entity_count() const { +int64_t Directory::unsynced_entity_count() const { ScopedKernelLock lock(this); return kernel_->unsynced_metahandles.size(); } @@ -1095,10 +1098,9 @@ bool Directory::TypeHasUnappliedUpdates(ModelType type) { return !kernel_->unapplied_update_metahandles[type].empty(); } -void Directory::GetUnappliedUpdateMetaHandles( - BaseTransaction* trans, - FullModelTypeSet server_types, - std::vector<int64>* result) { +void Directory::GetUnappliedUpdateMetaHandles(BaseTransaction* trans, + FullModelTypeSet server_types, + std::vector<int64_t>* result) { result->clear(); ScopedKernelLock lock(this); for (int i = UNSPECIFIED; i < MODEL_TYPE_COUNT; ++i) { @@ -1113,7 +1115,7 @@ void Directory::GetUnappliedUpdateMetaHandles( void Directory::GetMetaHandlesOfType(BaseTransaction* trans, ModelType type, - std::vector<int64>* result) { + std::vector<int64_t>* result) { ScopedKernelLock lock(this); GetMetaHandlesOfType(lock, trans, type, result); } @@ -1121,7 +1123,7 @@ void Directory::GetMetaHandlesOfType(BaseTransaction* trans, void Directory::GetMetaHandlesOfType(const ScopedKernelLock& lock, BaseTransaction* trans, ModelType type, - std::vector<int64>* result) { + std::vector<int64_t>* result) { result->clear(); for (MetahandlesMap::iterator it = kernel_->metahandles_map.begin(); it != kernel_->metahandles_map.end(); ++it) { @@ -1210,7 +1212,7 @@ bool Directory::CheckTreeInvariants(syncable::BaseTransaction* trans, const MetahandleSet& handles) { MetahandleSet::const_iterator i; for (i = handles.begin() ; i != handles.end() ; ++i) { - int64 metahandle = *i; + int64_t metahandle = *i; Entry e(trans, GET_BY_HANDLE, metahandle); if (!SyncAssert(e.good(), FROM_HERE, "Entry is bad", trans)) return false; @@ -1268,8 +1270,8 @@ bool Directory::CheckTreeInvariants(syncable::BaseTransaction* trans, } } } - int64 base_version = e.GetBaseVersion(); - int64 server_version = e.GetServerVersion(); + int64_t base_version = e.GetBaseVersion(); + int64_t server_version = e.GetServerVersion(); bool using_unique_client_tag = !e.GetUniqueClientTag().empty(); if (CHANGES_VERSION == base_version || 0 == base_version) { ModelType model_type = e.GetModelType(); @@ -1361,9 +1363,9 @@ void Directory::SetInvariantCheckLevel(InvariantCheckLevel check_level) { invariant_check_level_ = check_level; } -int64 Directory::NextMetahandle() { +int64_t Directory::NextMetahandle() { ScopedKernelLock lock(this); - int64 metahandle = (kernel_->next_metahandle)++; + int64_t metahandle = (kernel_->next_metahandle)++; return metahandle; } @@ -1542,12 +1544,12 @@ void Directory::GetAttachmentIdsToUpload(BaseTransaction* trans, ids->clear(); AttachmentIdSet on_server_id_set; AttachmentIdSet not_on_server_id_set; - std::vector<int64> metahandles; + std::vector<int64_t> metahandles; { ScopedKernelLock lock(this); GetMetaHandlesOfType(lock, trans, type, &metahandles); - std::vector<int64>::const_iterator iter = metahandles.begin(); - const std::vector<int64>::const_iterator end = metahandles.end(); + std::vector<int64_t>::const_iterator iter = metahandles.begin(); + const std::vector<int64_t>::const_iterator end = metahandles.end(); // For all of this type's entries... for (; iter != end; ++iter) { EntryKernel* entry = GetEntryByHandle(lock, *iter); diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h index ab01a27..06dbc5b 100644 --- a/sync/syncable/directory.h +++ b/sync/syncable/directory.h @@ -5,16 +5,19 @@ #ifndef SYNC_SYNCABLE_DIRECTORY_H_ #define SYNC_SYNCABLE_DIRECTORY_H_ +#include <stddef.h> +#include <stdint.h> + #include <deque> #include <set> #include <string> #include <vector> -#include "base/basictypes.h" #include "base/callback.h" #include "base/containers/hash_tables.h" #include "base/files/file_util.h" #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" @@ -57,7 +60,7 @@ enum InvariantCheckLevel { // treated as pseudo-private. class SYNC_EXPORT Directory { public: - typedef std::vector<int64> Metahandles; + typedef std::vector<int64_t> Metahandles; // TODO(skym): Convert this hash_map usage to unordered_map, crbug/567280. // Be careful when using these hash_map containers. According to the spec, @@ -69,7 +72,7 @@ class SYNC_EXPORT Directory { // and other similar functions are off-limits too, until this bug is fixed. // // See http://sourceforge.net/p/stlport/bugs/239/. - typedef base::hash_map<int64, EntryKernel*> MetahandlesMap; + typedef base::hash_map<int64_t, EntryKernel*> MetahandlesMap; typedef base::hash_map<std::string, EntryKernel*> IdsMap; typedef base::hash_map<std::string, EntryKernel*> TagsMap; typedef std::string AttachmentIdUniqueId; @@ -108,7 +111,7 @@ class SYNC_EXPORT Directory { // transaction versions of sync model and native model. // TODO(hatiaol): implement detection and fixing of out-of-sync models. // Bug 154858. - int64 transaction_version[MODEL_TYPE_COUNT]; + int64_t transaction_version[MODEL_TYPE_COUNT]; // The store birthday we were given by the server. Contents are opaque to // the client. std::string store_birthday; @@ -125,7 +128,7 @@ class SYNC_EXPORT Directory { struct KernelLoadInfo { PersistedKernelInfo kernel_info; std::string cache_guid; // Created on first initialization, never changes. - int64 max_metahandle; // Computed (using sql MAX aggregate) on init. + int64_t max_metahandle; // Computed (using sql MAX aggregate) on init. KernelLoadInfo() : max_metahandle(0) { } }; @@ -161,7 +164,7 @@ class SYNC_EXPORT Directory { base::Lock transaction_mutex; // Protected by transaction_mutex. Used by WriteTransactions. - int64 next_write_transaction_id; + int64_t next_write_transaction_id; // The name of this directory. std::string const name; @@ -238,7 +241,7 @@ class SYNC_EXPORT Directory { base::Lock save_changes_mutex; // The next metahandle is protected by kernel mutex. - int64 next_metahandle; + int64_t next_metahandle; // The delegate for directory change events. Must not be NULL. DirectoryChangeDelegate* const delegate; @@ -267,7 +270,7 @@ class SYNC_EXPORT Directory { const WeakHandle<TransactionObserver>& transaction_observer); - int64 NextMetahandle(); + int64_t NextMetahandle(); // Generates next client ID based on a randomly generated GUID. syncable::Id NextId(); @@ -291,7 +294,7 @@ class SYNC_EXPORT Directory { // Gets/Increments transaction version of a model type. Must be called when // holding kernel mutex. - int64 GetTransactionVersion(ModelType type) const; + int64_t GetTransactionVersion(ModelType type) const; void IncrementTransactionVersion(ModelType type); // Getter/setters for the per datatype context. @@ -399,7 +402,7 @@ class SYNC_EXPORT Directory { bool SaveChanges(); // Returns the number of entities with the unsynced bit set. - int64 unsynced_entity_count() const; + int64_t unsynced_entity_count() const; // Get GetUnsyncedMetaHandles should only be called after SaveChanges and // before any new entries have been created. The intention is that the @@ -414,7 +417,7 @@ class SYNC_EXPORT Directory { // server types. void GetUnappliedUpdateMetaHandles(BaseTransaction* trans, FullModelTypeSet server_types, - std::vector<int64>* result); + std::vector<int64_t>* result); // Get all the metahandles of entries of |type|. void GetMetaHandlesOfType(BaseTransaction* trans, @@ -505,7 +508,7 @@ class SYNC_EXPORT Directory { // Update the attachment index for |metahandle| removing it from the index // under |old_metadata| entries and add it under |new_metadata| entries. - void UpdateAttachmentIndex(const int64 metahandle, + void UpdateAttachmentIndex(const int64_t metahandle, const sync_pb::AttachmentMetadata& old_metadata, const sync_pb::AttachmentMetadata& new_metadata); @@ -513,7 +516,7 @@ class SYNC_EXPORT Directory { virtual EntryKernel* GetEntryByClientTag(const std::string& tag); EntryKernel* GetEntryByServerTag(const std::string& tag); - virtual EntryKernel* GetEntryByHandle(int64 handle); + virtual EntryKernel* GetEntryByHandle(int64_t handle); bool ReindexId(BaseWriteTransaction* trans, EntryKernel* const entry, const Id& new_id); @@ -544,7 +547,7 @@ class SYNC_EXPORT Directory { // overload with the held ScopedKernelLock. virtual EntryKernel* GetEntryByHandle(const ScopedKernelLock& lock, - int64 metahandle); + int64_t metahandle); virtual EntryKernel* GetEntryById(const ScopedKernelLock& lock, const Id& id); @@ -555,13 +558,13 @@ class SYNC_EXPORT Directory { // Remove each of |metahandle|'s attachment ids from index_by_attachment_id. void RemoveFromAttachmentIndex( const ScopedKernelLock& lock, - const int64 metahandle, + const int64_t metahandle, const sync_pb::AttachmentMetadata& attachment_metadata); // Add each of |metahandle|'s attachment ids to the index_by_attachment_id. void AddToAttachmentIndex( const ScopedKernelLock& lock, - const int64 metahandle, + const int64_t metahandle, const sync_pb::AttachmentMetadata& attachment_metadata); void ClearDirtyMetahandles(const ScopedKernelLock& lock); @@ -624,7 +627,7 @@ class SYNC_EXPORT Directory { void GetMetaHandlesOfType(const ScopedKernelLock& lock, BaseTransaction* trans, ModelType type, - std::vector<int64>* result); + std::vector<int64_t>* result); // Invoked by DirectoryBackingStore when a catastrophic database error is // detected. diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc index fa1b947..9272ae5 100644 --- a/sync/syncable/directory_backing_store.cc +++ b/sync/syncable/directory_backing_store.cc @@ -4,10 +4,14 @@ #include "sync/syncable/directory_backing_store.h" +#include <stddef.h> +#include <stdint.h> + #include <limits> #include "base/base64.h" #include "base/logging.h" +#include "base/macros.h" #include "base/metrics/histogram_macros.h" #include "base/rand_util.h" #include "base/strings/stringprintf.h" @@ -33,7 +37,7 @@ namespace syncer { namespace syncable { // Increment this version whenever updating DB tables. -const int32 kCurrentDBVersion = 90; +const int32_t kCurrentDBVersion = 90; // Iterate over the fields of |entry| and bind each to |statement| for // updating. Returns the number of args bound. @@ -460,7 +464,7 @@ bool DirectoryBackingStore::InitializeTables() { version_on_disk = 74; } - // Version 75 migrated from int64-based timestamps to per-datatype tokens. + // Version 75 migrated from int64_t-based timestamps to per-datatype tokens. if (version_on_disk == 74) { if (MigrateVersion74To75()) version_on_disk = 75; @@ -497,7 +501,7 @@ bool DirectoryBackingStore::InitializeTables() { version_on_disk = 80; } - // Version 81 replaces the int64 server_position_in_parent_field + // Version 81 replaces the int64_t server_position_in_parent_field // with a blob server_ordinal_in_parent field. if (version_on_disk == 80) { if (MigrateVersion80To81()) @@ -663,7 +667,7 @@ bool DirectoryBackingStore::LoadEntries(Directory::MetahandlesMap* handles_map, if (!kernel) return false; - int64 handle = kernel->ref(META_HANDLE); + int64_t handle = kernel->ref(META_HANDLE); if (SafeToPurgeOnLoading(*kernel)) { metahandles_to_purge->insert(handle); } else { @@ -821,7 +825,7 @@ bool DirectoryBackingStore::MigrateToSpecifics( sql::Statement update(db_->GetUniqueStatement(update_sql.c_str())); while (query.Step()) { - int64 metahandle = query.ColumnInt64(0); + int64_t metahandle = query.ColumnInt64(0); std::string new_value_bytes; query.ColumnBlobAsString(1, &new_value_bytes); sync_pb::EntitySpecifics new_value; @@ -978,7 +982,7 @@ bool DirectoryBackingStore::MigrateVersion70To71() { if (!fetch.Step()) return false; - int64 last_sync_timestamp = fetch.ColumnInt64(0); + int64_t last_sync_timestamp = fetch.ColumnInt64(0); bool initial_sync_ended = fetch.ColumnBool(1); // Verify there were no additional rows returned. @@ -1221,8 +1225,8 @@ bool DirectoryBackingStore::MigrateVersion80To81() { "WHERE metahandle = ?")); while (get_positions.Step()) { - int64 metahandle = get_positions.ColumnInt64(0); - int64 position = get_positions.ColumnInt64(1); + int64_t metahandle = get_positions.ColumnInt64(0); + int64_t position = get_positions.ColumnInt64(1); const std::string& ordinal = Int64ToNodeOrdinal(position).ToInternalValue(); put_ordinals.BindBlob(0, ordinal.data(), ordinal.length()); @@ -1342,7 +1346,7 @@ bool DirectoryBackingStore::MigrateVersion85To86() { "WHERE metahandle = ?")); while (get.Step()) { - int64 metahandle = get.ColumnInt64(0); + int64_t metahandle = get.ColumnInt64(0); std::string id_string; get.ColumnBlobAsString(1, &id_string); @@ -1393,7 +1397,7 @@ bool DirectoryBackingStore::MigrateVersion85To86() { id_string.substr(1)); } - int64 int_position = NodeOrdinalToInt64(ordinal); + int64_t int_position = NodeOrdinalToInt64(ordinal); position = UniquePosition::FromInt64(int_position, unique_bookmark_tag); } else { // Leave bookmark_tag and position at their default (invalid) values. @@ -1511,7 +1515,7 @@ bool DirectoryBackingStore::CreateTables() { { // Insert the entry for the root into the metas table. - const int64 now = TimeToProtoTime(base::Time::Now()); + const int64_t now = TimeToProtoTime(base::Time::Now()); sql::Statement s(db_->GetUniqueStatement( "INSERT INTO metas " "( id, metahandle, is_dir, ctime, mtime ) " diff --git a/sync/syncable/directory_backing_store.h b/sync/syncable/directory_backing_store.h index 049b770..d3375af 100644 --- a/sync/syncable/directory_backing_store.h +++ b/sync/syncable/directory_backing_store.h @@ -5,9 +5,12 @@ #ifndef SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ #define SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ +#include <stdint.h> + #include <string> #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" #include "sql/connection.h" @@ -25,7 +28,7 @@ class EntitySpecifics; namespace syncer { namespace syncable { -SYNC_EXPORT extern const int32 kCurrentDBVersion; +SYNC_EXPORT extern const int32_t kCurrentDBVersion; struct ColumnSpec; diff --git a/sync/syncable/directory_backing_store_unittest.cc b/sync/syncable/directory_backing_store_unittest.cc index 4d8501e..2c1edb3 100644 --- a/sync/syncable/directory_backing_store_unittest.cc +++ b/sync/syncable/directory_backing_store_unittest.cc @@ -4,6 +4,9 @@ #include "sync/syncable/directory_backing_store.h" +#include <stddef.h> +#include <stdint.h> + #include <map> #include <string> @@ -15,6 +18,7 @@ #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "sql/connection.h" #include "sql/statement.h" #include "sql/test/scoped_error_ignorer.h" @@ -53,7 +57,7 @@ scoped_ptr<EntryKernel> CreateEntry(int id, const std::string &id_suffix) { } // namespace -SYNC_EXPORT extern const int32 kCurrentDBVersion; +SYNC_EXPORT extern const int32_t kCurrentDBVersion; class MigrationTest : public testing::TestWithParam<int> { public: @@ -280,9 +284,9 @@ enum ShouldIncludeDeletedItems { // Returns a map from metahandle -> expected legacy time (in proto // format). -std::map<int64, int64> GetExpectedLegacyMetaProtoTimes( +std::map<int64_t, int64_t> GetExpectedLegacyMetaProtoTimes( enum ShouldIncludeDeletedItems include_deleted) { - std::map<int64, int64> expected_legacy_meta_proto_times; + std::map<int64_t, int64_t> expected_legacy_meta_proto_times; expected_legacy_meta_proto_times[1] = LEGACY_META_PROTO_TIMES(1); if (include_deleted == INCLUDE_DELETED_ITEMS) { expected_legacy_meta_proto_times[2] = LEGACY_META_PROTO_TIMES(2); @@ -302,9 +306,9 @@ std::map<int64, int64> GetExpectedLegacyMetaProtoTimes( } // Returns a map from metahandle -> expected time (in proto format). -std::map<int64, int64> GetExpectedMetaProtoTimes( +std::map<int64_t, int64_t> GetExpectedMetaProtoTimes( enum ShouldIncludeDeletedItems include_deleted) { - std::map<int64, int64> expected_meta_proto_times; + std::map<int64_t, int64_t> expected_meta_proto_times; expected_meta_proto_times[1] = META_PROTO_TIMES(1); if (include_deleted == INCLUDE_DELETED_ITEMS) { expected_meta_proto_times[2] = META_PROTO_TIMES(2); @@ -324,11 +328,11 @@ std::map<int64, int64> GetExpectedMetaProtoTimes( } // Returns a map from metahandle -> expected time (as a Time object). -std::map<int64, base::Time> GetExpectedMetaTimes() { - std::map<int64, base::Time> expected_meta_times; - const std::map<int64, int64>& expected_meta_proto_times = +std::map<int64_t, base::Time> GetExpectedMetaTimes() { + std::map<int64_t, base::Time> expected_meta_times; + const std::map<int64_t, int64_t>& expected_meta_proto_times = GetExpectedMetaProtoTimes(INCLUDE_DELETED_ITEMS); - for (std::map<int64, int64>::const_iterator it = + for (std::map<int64_t, int64_t>::const_iterator it = expected_meta_proto_times.begin(); it != expected_meta_proto_times.end(); ++it) { expected_meta_times[it->first] = ProtoTimeToTime(it->second); @@ -338,19 +342,19 @@ std::map<int64, base::Time> GetExpectedMetaTimes() { // Extracts a map from metahandle -> time (in proto format) from the // given database. -std::map<int64, int64> GetMetaProtoTimes(sql::Connection *db) { +std::map<int64_t, int64_t> GetMetaProtoTimes(sql::Connection* db) { sql::Statement s(db->GetCachedStatement( SQL_FROM_HERE, "SELECT metahandle, mtime, server_mtime, ctime, server_ctime " "FROM metas")); EXPECT_EQ(5, s.ColumnCount()); - std::map<int64, int64> meta_times; + std::map<int64_t, int64_t> meta_times; while (s.Step()) { - int64 metahandle = s.ColumnInt64(0); - int64 mtime = s.ColumnInt64(1); - int64 server_mtime = s.ColumnInt64(2); - int64 ctime = s.ColumnInt64(3); - int64 server_ctime = s.ColumnInt64(4); + int64_t metahandle = s.ColumnInt64(0); + int64_t mtime = s.ColumnInt64(1); + int64_t server_mtime = s.ColumnInt64(2); + int64_t ctime = s.ColumnInt64(3); + int64_t server_ctime = s.ColumnInt64(4); EXPECT_EQ(mtime, server_mtime); EXPECT_EQ(mtime, ctime); EXPECT_EQ(mtime, server_ctime); @@ -393,12 +397,12 @@ void ExpectTime(const EntryKernel& entry_kernel, // Expect that all the entries in |entries| have times matching those in // the given map (from metahandle to expect time). void ExpectTimes(const Directory::MetahandlesMap& handles_map, - const std::map<int64, base::Time>& expected_times) { + const std::map<int64_t, base::Time>& expected_times) { for (Directory::MetahandlesMap::const_iterator it = handles_map.begin(); it != handles_map.end(); ++it) { - int64 meta_handle = it->first; + int64_t meta_handle = it->first; SCOPED_TRACE(meta_handle); - std::map<int64, base::Time>::const_iterator it2 = + std::map<int64_t, base::Time>::const_iterator it2 = expected_times.find(meta_handle); if (it2 == expected_times.end()) { ADD_FAILURE() << "Could not find expected time for " << meta_handle; @@ -1859,21 +1863,9 @@ void MigrationTest::SetUpVersion80Database(sql::Connection* connection) { namespace { const int V80_ROW_COUNT = 13; -const int64 V80_POSITIONS[V80_ROW_COUNT] = { - 0, - -2097152, - -3145728, - 1048576, - -4194304, - 1048576, - 1048576, - 1048576, - 2097152, - -1048576, - 0, - -917504, - 1048576 -}; +const int64_t V80_POSITIONS[V80_ROW_COUNT] = { + 0, -2097152, -3145728, 1048576, -4194304, 1048576, 1048576, + 1048576, 2097152, -1048576, 0, -917504, 1048576}; std::string V81_Ordinal(int n) { return Int64ToNodeOrdinal(V80_POSITIONS[n]).ToInternalValue(); @@ -4060,7 +4052,7 @@ TEST_F(DirectoryBackingStoreTest, DeleteEntries) { &kernel_load_info); size_t initial_size = handles_map.size(); ASSERT_LT(0U, initial_size) << "Test requires handles_map to delete."; - int64 first_to_die = handles_map.begin()->second->ref(META_HANDLE); + int64_t first_to_die = handles_map.begin()->second->ref(META_HANDLE); MetahandleSet to_delete; to_delete.insert(first_to_die); EXPECT_TRUE(dbs->DeleteEntries(to_delete)); diff --git a/sync/syncable/directory_change_delegate.h b/sync/syncable/directory_change_delegate.h index b406f5f..9fe71cf 100644 --- a/sync/syncable/directory_change_delegate.h +++ b/sync/syncable/directory_change_delegate.h @@ -5,6 +5,8 @@ #ifndef SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_ #define SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_ +#include <stdint.h> + #include <vector> #include "sync/base/sync_export.h" @@ -30,12 +32,12 @@ class SYNC_EXPORT DirectoryChangeDelegate { virtual void HandleCalculateChangesChangeEventFromSyncApi( const ImmutableWriteTransactionInfo& write_transaction_info, BaseTransaction* trans, - std::vector<int64>* entries_changed) = 0; + std::vector<int64_t>* entries_changed) = 0; // Returns the handles of changed entries in |entry_changed|. virtual void HandleCalculateChangesChangeEventFromSyncer( const ImmutableWriteTransactionInfo& write_transaction_info, BaseTransaction* trans, - std::vector<int64>* entries_changed) = 0; + std::vector<int64_t>* entries_changed) = 0; // Must return the set of all ModelTypes that were modified in the // transaction. virtual ModelTypeSet HandleTransactionEndingChangeEvent( diff --git a/sync/syncable/directory_unittest.cc b/sync/syncable/directory_unittest.cc index dc83e61..59ac4f8 100644 --- a/sync/syncable/directory_unittest.cc +++ b/sync/syncable/directory_unittest.cc @@ -4,8 +4,12 @@ #include "sync/syncable/directory_unittest.h" +#include <stddef.h> +#include <stdint.h> + #include <cstdlib> +#include "base/macros.h" #include "base/rand_util.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" @@ -188,11 +192,11 @@ void SyncableDirectoryTest::CheckPurgeEntriesWithTypeInSucceeded( EXPECT_TRUE(dir_->InitialSyncEndedForType(BOOKMARKS)); } -bool SyncableDirectoryTest::IsInDirtyMetahandles(int64 metahandle) { +bool SyncableDirectoryTest::IsInDirtyMetahandles(int64_t metahandle) { return 1 == dir_->kernel()->dirty_metahandles.count(metahandle); } -bool SyncableDirectoryTest::IsInMetahandlesToPurge(int64 metahandle) { +bool SyncableDirectoryTest::IsInMetahandlesToPurge(int64_t metahandle) { return 1 == dir_->kernel()->metahandles_to_purge.count(metahandle); } @@ -215,11 +219,11 @@ SyncableDirectoryTest::unrecoverable_error_handler() { } void SyncableDirectoryTest::ValidateEntry(BaseTransaction* trans, - int64 id, + int64_t id, bool check_name, const std::string& name, - int64 base_version, - int64 server_version, + int64_t base_version, + int64_t server_version, bool is_del) { Entry e(trans, GET_BY_ID, TestIdFactory::FromNumber(id)); ASSERT_TRUE(e.good()); @@ -276,7 +280,7 @@ TEST_F(SyncableDirectoryTest, TakeSnapshotGetsMetahandlesToPurge) { TEST_F(SyncableDirectoryTest, TakeSnapshotGetsAllDirtyHandlesTest) { const int metahandles_to_create = 100; - std::vector<int64> expected_dirty_metahandles; + std::vector<int64_t> expected_dirty_metahandles; { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); for (int i = 0; i < metahandles_to_create; i++) { @@ -303,11 +307,10 @@ TEST_F(SyncableDirectoryTest, TakeSnapshotGetsAllDirtyHandlesTest) { // Put a new value with existing transactions as well as adding new ones. { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); - std::vector<int64> new_dirty_metahandles; - for (std::vector<int64>::const_iterator i = + std::vector<int64_t> new_dirty_metahandles; + for (std::vector<int64_t>::const_iterator i = expected_dirty_metahandles.begin(); - i != expected_dirty_metahandles.end(); - ++i) { + i != expected_dirty_metahandles.end(); ++i) { // Change existing entries to directories to dirty them. MutableEntry e1(&trans, GET_BY_HANDLE, *i); e1.PutIsDir(true); @@ -343,7 +346,7 @@ TEST_F(SyncableDirectoryTest, TakeSnapshotGetsOnlyDirtyHandlesTest) { // half of 2 * metahandles_to_create const unsigned int number_changed = 100u; - std::vector<int64> expected_dirty_metahandles; + std::vector<int64_t> expected_dirty_metahandles; { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); for (int i = 0; i < metahandles_to_create; i++) { @@ -356,11 +359,10 @@ TEST_F(SyncableDirectoryTest, TakeSnapshotGetsOnlyDirtyHandlesTest) { // Put a new value with existing transactions as well as adding new ones. { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); - std::vector<int64> new_dirty_metahandles; - for (std::vector<int64>::const_iterator i = + std::vector<int64_t> new_dirty_metahandles; + for (std::vector<int64_t>::const_iterator i = expected_dirty_metahandles.begin(); - i != expected_dirty_metahandles.end(); - ++i) { + i != expected_dirty_metahandles.end(); ++i) { // Change existing entries to directories to dirty them. MutableEntry e1(&trans, GET_BY_HANDLE, *i); ASSERT_TRUE(e1.good()); @@ -379,10 +381,9 @@ TEST_F(SyncableDirectoryTest, TakeSnapshotGetsOnlyDirtyHandlesTest) { // Don't make any changes whatsoever and ensure nothing comes back. { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); - for (std::vector<int64>::const_iterator i = + for (std::vector<int64_t>::const_iterator i = expected_dirty_metahandles.begin(); - i != expected_dirty_metahandles.end(); - ++i) { + i != expected_dirty_metahandles.end(); ++i) { MutableEntry e(&trans, GET_BY_HANDLE, *i); ASSERT_TRUE(e.good()); // We aren't doing anything to dirty these entries. @@ -400,10 +401,9 @@ TEST_F(SyncableDirectoryTest, TakeSnapshotGetsOnlyDirtyHandlesTest) { { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); bool should_change = false; - for (std::vector<int64>::const_iterator i = + for (std::vector<int64_t>::const_iterator i = expected_dirty_metahandles.begin(); - i != expected_dirty_metahandles.end(); - ++i) { + i != expected_dirty_metahandles.end(); ++i) { // Maybe change entries by flipping IS_DIR. MutableEntry e(&trans, GET_BY_HANDLE, *i); ASSERT_TRUE(e.good()); @@ -443,9 +443,9 @@ TEST_F(SyncableDirectoryTest, ManageDeleteJournals) { Id id2 = TestIdFactory::FromNumber(2); // The third one is a client ID. Id id3 = TestIdFactory::FromNumber(-3); - int64 handle1 = 0; - int64 handle2 = 0; - int64 handle3 = 0; + int64_t handle1 = 0; + int64_t handle2 = 0; + int64_t handle3 = 0; { // Create 3 bookmark entries and save in database. { @@ -587,7 +587,7 @@ TEST_F(SyncableDirectoryTest, TestPurgeDeletedEntriesOnReload) { const int kClientCount = 2; const int kServerCount = 5; const int kTestCount = kClientCount + kServerCount; - int64 handles[kTestCount]; + int64_t handles[kTestCount]; // The idea is to recreate various combinations of IDs, IS_DEL, // IS_UNSYNCED, and IS_UNAPPLIED_UPDATE flags to test all combinations @@ -643,11 +643,11 @@ TEST_F(SyncableDirectoryTest, TestPurgeDeletedEntriesOnReload) { // - Item 0 is an item with IS_DEL flag and client ID. // - Item 5 is an item with IS_DEL flag which has both // IS_UNSYNCED and IS_UNAPPLIED_UPDATE unset. - std::vector<int64> expected_purged; + std::vector<int64_t> expected_purged; expected_purged.push_back(0); expected_purged.push_back(5); - std::vector<int64> actually_purged; + std::vector<int64_t> actually_purged; { ReadTransaction trans(FROM_HERE, dir().get()); for (int i = 0; i < kTestCount; i++) { @@ -698,7 +698,7 @@ TEST_F(SyncableDirectoryTest, TestDelete) { TEST_F(SyncableDirectoryTest, TestGetUnsynced) { Directory::Metahandles handles; - int64 handle1, handle2; + int64_t handle1, handle2; { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); @@ -768,8 +768,8 @@ TEST_F(SyncableDirectoryTest, TestGetUnsynced) { } TEST_F(SyncableDirectoryTest, TestGetUnappliedUpdates) { - std::vector<int64> handles; - int64 handle1, handle2; + std::vector<int64_t> handles; + int64_t handle1, handle2; const FullModelTypeSet all_types = FullModelTypeSet::All(); { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); @@ -842,7 +842,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnappliedUpdates) { TEST_F(SyncableDirectoryTest, DeleteBug_531383) { // Try to evoke a check failure... TestIdFactory id_factory; - int64 grandchild_handle; + int64_t grandchild_handle; { WriteTransaction wtrans(FROM_HERE, UNITTEST, dir().get()); MutableEntry parent(&wtrans, CREATE, BOOKMARKS, id_factory.root(), "Bob"); @@ -930,7 +930,7 @@ TEST_F(SyncableDirectoryTest, TestIsLegalNewParent) { TEST_F(SyncableDirectoryTest, TestEntryIsInFolder) { // Create a subdir and an entry. - int64 entry_handle; + int64_t entry_handle; syncable::Id folder_id; syncable::Id entry_id; std::string entry_name = "entry"; @@ -1420,7 +1420,7 @@ TEST_F(SyncableDirectoryTest, BadPositionCountsAsCorruption) { } TEST_F(SyncableDirectoryTest, General) { - int64 written_metahandle; + int64_t written_metahandle; const Id id = TestIdFactory::FromNumber(99); std::string name = "Jeff"; // Test simple read operations on an empty DB. @@ -1497,7 +1497,7 @@ TEST_F(SyncableDirectoryTest, General) { } TEST_F(SyncableDirectoryTest, ChildrenOps) { - int64 written_metahandle; + int64_t written_metahandle; const Id id = TestIdFactory::FromNumber(99); std::string name = "Jeff"; { @@ -1558,7 +1558,7 @@ TEST_F(SyncableDirectoryTest, ChildrenOps) { } TEST_F(SyncableDirectoryTest, ClientIndexRebuildsProperly) { - int64 written_metahandle; + int64_t written_metahandle; TestIdFactory factory; const Id id = factory.NewServerId(); std::string name = "cheesepuffs"; diff --git a/sync/syncable/directory_unittest.h b/sync/syncable/directory_unittest.h index 8600537..f8a3218 100644 --- a/sync/syncable/directory_unittest.h +++ b/sync/syncable/directory_unittest.h @@ -5,9 +5,10 @@ #ifndef SYNC_SYNCABLE_DIRECTORY_UNITTEST_H_ #define SYNC_SYNCABLE_DIRECTORY_UNITTEST_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/message_loop/message_loop.h" #include "sync/syncable/in_memory_directory_backing_store.h" #include "sync/syncable/mutable_entry.h" @@ -82,8 +83,8 @@ class SyncableDirectoryTest : public testing::Test { void GetAllMetaHandles(BaseTransaction* trans, MetahandleSet* result); void CheckPurgeEntriesWithTypeInSucceeded(ModelTypeSet types_to_purge, bool before_reload); - bool IsInDirtyMetahandles(int64 metahandle); - bool IsInMetahandlesToPurge(int64 metahandle); + bool IsInDirtyMetahandles(int64_t metahandle); + bool IsInMetahandlesToPurge(int64_t metahandle); scoped_ptr<Directory>& dir(); DirectoryChangeDelegate* directory_change_delegate(); @@ -92,11 +93,11 @@ class SyncableDirectoryTest : public testing::Test { private: void ValidateEntry(BaseTransaction* trans, - int64 id, + int64_t id, bool check_name, const std::string& name, - int64 base_version, - int64 server_version, + int64_t base_version, + int64_t server_version, bool is_del); base::MessageLoop message_loop_; diff --git a/sync/syncable/entry.cc b/sync/syncable/entry.cc index ca249e5..1761784 100644 --- a/sync/syncable/entry.cc +++ b/sync/syncable/entry.cc @@ -4,6 +4,8 @@ #include "sync/syncable/entry.h" +#include <stdint.h> + #include <iomanip> #include "sync/syncable/directory.h" @@ -28,7 +30,7 @@ Entry::Entry(BaseTransaction* trans, GetTypeRoot, ModelType type) kernel_ = trans->directory()->GetEntryByServerTag(tag); } -Entry::Entry(BaseTransaction* trans, GetByHandle, int64 metahandle) +Entry::Entry(BaseTransaction* trans, GetByHandle, int64_t metahandle) : basetrans_(trans) { kernel_ = trans->directory()->GetEntryByHandle(metahandle); } @@ -109,7 +111,7 @@ Id Entry::GetFirstChildId() const { return dir()->GetFirstChildId(basetrans_, kernel_); } -void Entry::GetChildHandles(std::vector<int64>* result) const { +void Entry::GetChildHandles(std::vector<int64_t>* result) const { dir()->GetChildHandlesById(basetrans_, GetId(), result); } diff --git a/sync/syncable/entry.h b/sync/syncable/entry.h index cf9b9af..906387f 100644 --- a/sync/syncable/entry.h +++ b/sync/syncable/entry.h @@ -5,9 +5,13 @@ #ifndef SYNC_SYNCABLE_ENTRY_H_ #define SYNC_SYNCABLE_ENTRY_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> #include <vector> +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/syncable/entry_kernel.h" @@ -54,7 +58,7 @@ class SYNC_EXPORT Entry { public: // After constructing, you must check good() to test whether the Get // succeeded. - Entry(BaseTransaction* trans, GetByHandle, int64 handle); + Entry(BaseTransaction* trans, GetByHandle, int64_t handle); Entry(BaseTransaction* trans, GetById, const Id& id); Entry(BaseTransaction* trans, GetTypeRoot, ModelType type); Entry(BaseTransaction* trans, GetByClientTag, const std::string& tag); @@ -68,27 +72,27 @@ class SYNC_EXPORT Entry { BaseTransaction* trans() const { return basetrans_; } // Field accessors. - int64 GetMetahandle() const { + int64_t GetMetahandle() const { DCHECK(kernel_); return kernel_->ref(META_HANDLE); } - int64 GetBaseVersion() const { + int64_t GetBaseVersion() const { DCHECK(kernel_); return kernel_->ref(BASE_VERSION); } - int64 GetServerVersion() const { + int64_t GetServerVersion() const { DCHECK(kernel_); return kernel_->ref(SERVER_VERSION); } - int64 GetLocalExternalId() const { + int64_t GetLocalExternalId() const { DCHECK(kernel_); return kernel_->ref(LOCAL_EXTERNAL_ID); } - int64 GetTransactionVersion() const { + int64_t GetTransactionVersion() const { DCHECK(kernel_); return kernel_->ref(TRANSACTION_VERSION); } @@ -235,7 +239,7 @@ class SYNC_EXPORT Entry { // Clears |result| if there are no children. If this node is of a type that // supports user-defined ordering then the resulting vector will be in the // proper order. - void GetChildHandles(std::vector<int64>* result) const; + void GetChildHandles(std::vector<int64_t>* result) const; inline bool ExistsOnClientBecauseNameIsNonEmpty() const { DCHECK(kernel_); diff --git a/sync/syncable/entry_kernel.cc b/sync/syncable/entry_kernel.cc index ec7575b..e9d21e5 100644 --- a/sync/syncable/entry_kernel.cc +++ b/sync/syncable/entry_kernel.cc @@ -4,6 +4,8 @@ #include "sync/syncable/entry_kernel.h" +#include <stdint.h> + #include "base/json/string_escape.h" #include "base/strings/string_number_conversions.h" #include "sync/protocol/proto_value_conversions.h" @@ -115,7 +117,7 @@ void SetEncryptableProtoValues( // Helper functions for SetFieldValues(). -base::StringValue* Int64ToValue(int64 i) { +base::StringValue* Int64ToValue(int64_t i) { return new base::StringValue(base::Int64ToString(i)); } diff --git a/sync/syncable/entry_kernel.h b/sync/syncable/entry_kernel.h index be606d1..96a657f 100644 --- a/sync/syncable/entry_kernel.h +++ b/sync/syncable/entry_kernel.h @@ -5,6 +5,8 @@ #ifndef SYNC_SYNCABLE_ENTRY_KERNEL_H_ #define SYNC_SYNCABLE_ENTRY_KERNEL_H_ +#include <stdint.h> + #include <algorithm> #include <map> #include <set> @@ -40,7 +42,7 @@ namespace syncable { // directory_backing_store.cc // - TestSimpleFieldsPreservedDuringSaveChanges in syncable_unittest.cc -static const int64 kInvalidMetaHandle = 0; +static const int64_t kInvalidMetaHandle = 0; enum { BEGIN_FIELDS = 0, @@ -204,7 +206,7 @@ struct SYNC_EXPORT EntryKernel { std::string string_fields[STRING_FIELDS_COUNT]; EntitySpecificsPtr specifics_fields[PROTO_FIELDS_COUNT]; - int64 int64_fields[INT64_FIELDS_COUNT]; + int64_t int64_fields[INT64_FIELDS_COUNT]; base::Time time_fields[TIME_FIELDS_COUNT]; Id id_fields[ID_FIELDS_COUNT]; UniquePosition unique_position_fields[UNIQUE_POSITION_FIELDS_COUNT]; @@ -246,10 +248,10 @@ struct SYNC_EXPORT EntryKernel { } // Setters. - inline void put(MetahandleField field, int64 value) { + inline void put(MetahandleField field, int64_t value) { int64_fields[field - INT64_FIELDS_BEGIN] = value; } - inline void put(Int64Field field, int64 value) { + inline void put(Int64Field field, int64_t value) { int64_fields[field - INT64_FIELDS_BEGIN] = value; } inline void put(TimeField field, const base::Time& value) { @@ -261,7 +263,7 @@ struct SYNC_EXPORT EntryKernel { inline void put(IdField field, const Id& value) { id_fields[field - ID_FIELDS_BEGIN] = value; } - inline void put(BaseVersion field, int64 value) { + inline void put(BaseVersion field, int64_t value) { int64_fields[field - INT64_FIELDS_BEGIN] = value; } inline void put(IndexedBitField field, bool value) { @@ -292,10 +294,10 @@ struct SYNC_EXPORT EntryKernel { } // Const ref getters. - inline int64 ref(MetahandleField field) const { + inline int64_t ref(MetahandleField field) const { return int64_fields[field - INT64_FIELDS_BEGIN]; } - inline int64 ref(Int64Field field) const { + inline int64_t ref(Int64Field field) const { return int64_fields[field - INT64_FIELDS_BEGIN]; } inline const base::Time& ref(TimeField field) const { @@ -304,7 +306,7 @@ struct SYNC_EXPORT EntryKernel { inline const Id& ref(IdField field) const { return id_fields[field - ID_FIELDS_BEGIN]; } - inline int64 ref(BaseVersion field) const { + inline int64_t ref(BaseVersion field) const { return int64_fields[field - INT64_FIELDS_BEGIN]; } inline bool ref(IndexedBitField field) const { @@ -402,7 +404,7 @@ struct EntryKernelMutation { EntryKernel original, mutated; }; -typedef std::map<int64, EntryKernelMutation> EntryKernelMutationMap; +typedef std::map<int64_t, EntryKernelMutation> EntryKernelMutationMap; typedef Immutable<EntryKernelMutationMap> ImmutableEntryKernelMutationMap; diff --git a/sync/syncable/in_memory_directory_backing_store.h b/sync/syncable/in_memory_directory_backing_store.h index b482b95..5df9709 100644 --- a/sync/syncable/in_memory_directory_backing_store.h +++ b/sync/syncable/in_memory_directory_backing_store.h @@ -7,8 +7,9 @@ #include <string> -#include "sync/syncable/directory_backing_store.h" +#include "base/macros.h" #include "sync/base/sync_export.h" +#include "sync/syncable/directory_backing_store.h" namespace syncer { namespace syncable { diff --git a/sync/syncable/invalid_directory_backing_store.h b/sync/syncable/invalid_directory_backing_store.h index 272e664..b6f5915 100644 --- a/sync/syncable/invalid_directory_backing_store.h +++ b/sync/syncable/invalid_directory_backing_store.h @@ -5,8 +5,9 @@ #ifndef SYNC_SYNCABLE_INVALID_DIRECTORY_BACKING_STORE_H_ #define SYNC_SYNCABLE_INVALID_DIRECTORY_BACKING_STORE_H_ -#include "sync/syncable/directory_backing_store.h" +#include "base/macros.h" #include "sync/base/sync_export.h" +#include "sync/syncable/directory_backing_store.h" namespace syncer { namespace syncable { diff --git a/sync/syncable/metahandle_set.h b/sync/syncable/metahandle_set.h index acb5c27..24d5472 100644 --- a/sync/syncable/metahandle_set.h +++ b/sync/syncable/metahandle_set.h @@ -5,14 +5,15 @@ #ifndef SYNC_SYNCABLE_METAHANDLE_SET_H_ #define SYNC_SYNCABLE_METAHANDLE_SET_H_ +#include <stdint.h> + #include <set> -#include "base/basictypes.h" namespace syncer { namespace syncable { -typedef std::set<int64> MetahandleSet; +typedef std::set<int64_t> MetahandleSet; } // namespace syncable } // namespace syncer diff --git a/sync/syncable/model_neutral_mutable_entry.cc b/sync/syncable/model_neutral_mutable_entry.cc index 46486f7..df354ee 100644 --- a/sync/syncable/model_neutral_mutable_entry.cc +++ b/sync/syncable/model_neutral_mutable_entry.cc @@ -4,6 +4,9 @@ #include "sync/syncable/model_neutral_mutable_entry.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include "sync/internal_api/public/base/unique_position.h" @@ -88,10 +91,10 @@ ModelNeutralMutableEntry::ModelNeutralMutableEntry( : Entry(trans, GET_BY_ID, id), base_write_transaction_(trans) { } -ModelNeutralMutableEntry::ModelNeutralMutableEntry( - BaseWriteTransaction* trans, GetByHandle, int64 metahandle) - : Entry(trans, GET_BY_HANDLE, metahandle), base_write_transaction_(trans) { -} +ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans, + GetByHandle, + int64_t metahandle) + : Entry(trans, GET_BY_HANDLE, metahandle), base_write_transaction_(trans) {} ModelNeutralMutableEntry::ModelNeutralMutableEntry( BaseWriteTransaction* trans, GetByClientTag, const std::string& tag) @@ -103,7 +106,7 @@ ModelNeutralMutableEntry::ModelNeutralMutableEntry( : Entry(trans, GET_TYPE_ROOT, type), base_write_transaction_(trans) { } -void ModelNeutralMutableEntry::PutBaseVersion(int64 value) { +void ModelNeutralMutableEntry::PutBaseVersion(int64_t value) { DCHECK(kernel_); if (kernel_->ref(BASE_VERSION) != value) { base_write_transaction_->TrackChangesTo(kernel_); @@ -112,7 +115,7 @@ void ModelNeutralMutableEntry::PutBaseVersion(int64 value) { } } -void ModelNeutralMutableEntry::PutServerVersion(int64 value) { +void ModelNeutralMutableEntry::PutServerVersion(int64_t value) { DCHECK(kernel_); if (kernel_->ref(SERVER_VERSION) != value) { base_write_transaction_->TrackChangesTo(kernel_); @@ -350,7 +353,7 @@ void ModelNeutralMutableEntry::PutServerSpecifics( // Remove ourselves from unapplied_update_metahandles with our // old server type. const ModelType old_server_type = kernel_->GetServerModelType(); - const int64 metahandle = kernel_->ref(META_HANDLE); + const int64_t metahandle = kernel_->ref(META_HANDLE); size_t erase_count = dir()->kernel()->unapplied_update_metahandles[old_server_type] .erase(metahandle); @@ -370,7 +373,7 @@ void ModelNeutralMutableEntry::PutServerSpecifics( // Add ourselves back into unapplied_update_metahandles with our // new server type. const ModelType new_server_type = kernel_->GetServerModelType(); - const int64 metahandle = kernel_->ref(META_HANDLE); + const int64_t metahandle = kernel_->ref(META_HANDLE); dir()->kernel()->unapplied_update_metahandles[new_server_type] .insert(metahandle); } @@ -446,7 +449,7 @@ void ModelNeutralMutableEntry::PutParentIdPropertyOnly(const Id& parent_id) { MarkDirty(); } -void ModelNeutralMutableEntry::UpdateTransactionVersion(int64 value) { +void ModelNeutralMutableEntry::UpdateTransactionVersion(int64_t value) { kernel_->put(TRANSACTION_VERSION, value); MarkDirty(); } diff --git a/sync/syncable/model_neutral_mutable_entry.h b/sync/syncable/model_neutral_mutable_entry.h index 8f25f23..76aa32a 100644 --- a/sync/syncable/model_neutral_mutable_entry.h +++ b/sync/syncable/model_neutral_mutable_entry.h @@ -5,8 +5,12 @@ #ifndef SYNC_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_H_ #define SYNC_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/syncable/entry.h" @@ -37,7 +41,7 @@ class SYNC_EXPORT ModelNeutralMutableEntry : public Entry { ModelNeutralMutableEntry(BaseWriteTransaction* trans, CreateNewTypeRoot, ModelType type); - ModelNeutralMutableEntry(BaseWriteTransaction* trans, GetByHandle, int64); + ModelNeutralMutableEntry(BaseWriteTransaction* trans, GetByHandle, int64_t); ModelNeutralMutableEntry(BaseWriteTransaction* trans, GetById, const Id&); ModelNeutralMutableEntry( BaseWriteTransaction* trans, @@ -61,8 +65,8 @@ class SYNC_EXPORT ModelNeutralMutableEntry : public Entry { // success and false on failure, which occurs when putting the value would // have caused a duplicate in the index. The setters that never fail return // void. - void PutBaseVersion(int64 value); - void PutServerVersion(int64 value); + void PutBaseVersion(int64_t value); + void PutServerVersion(int64_t value); void PutServerMtime(base::Time value); void PutServerCtime(base::Time value); bool PutId(const Id& value); @@ -97,7 +101,7 @@ class SYNC_EXPORT ModelNeutralMutableEntry : public Entry { // except that it doesn't bother to invoke 'SaveOriginals'. Calling that // function is at best unnecessary, since the transaction will have already // used its list of mutations by the time this function is called. - void UpdateTransactionVersion(int64 version); + void UpdateTransactionVersion(int64_t version); protected: explicit ModelNeutralMutableEntry(BaseWriteTransaction* trans); diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc index 1131249..b7fd364 100644 --- a/sync/syncable/model_type.cc +++ b/sync/syncable/model_type.cc @@ -4,6 +4,9 @@ #include "sync/internal_api/public/base/model_type.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/strings/string_split.h" #include "base/values.h" #include "sync/protocol/app_notification_specifics.pb.h" diff --git a/sync/syncable/mutable_entry.cc b/sync/syncable/mutable_entry.cc index 978bbe7..eac80f9 100644 --- a/sync/syncable/mutable_entry.cc +++ b/sync/syncable/mutable_entry.cc @@ -4,6 +4,8 @@ #include "sync/syncable/mutable_entry.h" +#include <stdint.h> + #include "base/memory/scoped_ptr.h" #include "sync/internal_api/public/base/unique_position.h" #include "sync/syncable/directory.h" @@ -103,11 +105,11 @@ MutableEntry::MutableEntry(WriteTransaction* trans, GetById, const Id& id) write_transaction_(trans) { } -MutableEntry::MutableEntry(WriteTransaction* trans, GetByHandle, - int64 metahandle) +MutableEntry::MutableEntry(WriteTransaction* trans, + GetByHandle, + int64_t metahandle) : ModelNeutralMutableEntry(trans, GET_BY_HANDLE, metahandle), - write_transaction_(trans) { -} + write_transaction_(trans) {} MutableEntry::MutableEntry(WriteTransaction* trans, GetByClientTag, const std::string& tag) @@ -120,7 +122,7 @@ MutableEntry::MutableEntry(WriteTransaction* trans, GetTypeRoot, ModelType type) write_transaction_(trans) { } -void MutableEntry::PutLocalExternalId(int64 value) { +void MutableEntry::PutLocalExternalId(int64_t value) { DCHECK(kernel_); if (kernel_->ref(LOCAL_EXTERNAL_ID) != value) { write_transaction()->TrackChangesTo(kernel_); diff --git a/sync/syncable/mutable_entry.h b/sync/syncable/mutable_entry.h index efffa12..8cc5df7 100644 --- a/sync/syncable/mutable_entry.h +++ b/sync/syncable/mutable_entry.h @@ -5,8 +5,11 @@ #ifndef SYNC_SYNCABLE_MUTABLE_ENTRY_H_ #define SYNC_SYNCABLE_MUTABLE_ENTRY_H_ +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/syncable/entry.h" @@ -41,7 +44,7 @@ class SYNC_EXPORT MutableEntry : public ModelNeutralMutableEntry { ModelType model_type, const Id& parent_id, const std::string& name); - MutableEntry(WriteTransaction* trans, GetByHandle, int64); + MutableEntry(WriteTransaction* trans, GetByHandle, int64_t); MutableEntry(WriteTransaction* trans, GetById, const Id&); MutableEntry(WriteTransaction* trans, GetByClientTag, const std::string& tag); MutableEntry(WriteTransaction* trans, GetTypeRoot, ModelType type); @@ -52,7 +55,7 @@ class SYNC_EXPORT MutableEntry : public ModelNeutralMutableEntry { // Model-changing setters. These setters make user-visible changes that will // need to be communicated either to the local model or the sync server. - void PutLocalExternalId(int64 value); + void PutLocalExternalId(int64_t value); void PutMtime(base::Time value); void PutCtime(base::Time value); void PutParentId(const Id& value); diff --git a/sync/syncable/nigori_util.cc b/sync/syncable/nigori_util.cc index db779a4..7b5a811 100644 --- a/sync/syncable/nigori_util.cc +++ b/sync/syncable/nigori_util.cc @@ -4,6 +4,9 @@ #include "sync/syncable/nigori_util.h" +#include <stddef.h> +#include <stdint.h> + #include <queue> #include <string> #include <vector> @@ -11,8 +14,8 @@ #include "base/json/json_writer.h" #include "sync/syncable/directory.h" #include "sync/syncable/entry.h" -#include "sync/syncable/nigori_handler.h" #include "sync/syncable/mutable_entry.h" +#include "sync/syncable/nigori_handler.h" #include "sync/syncable/syncable_util.h" #include "sync/syncable/syncable_write_transaction.h" #include "sync/util/cryptographer.h" @@ -33,7 +36,7 @@ bool ProcessUnsyncedChangesForEncryption( // Note: we do not attempt to re-encrypt data with a new key here as key // changes in this code path are likely due to consistency issues (we have // to be updated to a key we already have, e.g. an old key). - std::vector<int64> handles; + std::vector<int64_t> handles; GetUnsyncedEntries(trans, &handles); for (size_t i = 0; i < handles.size(); ++i) { MutableEntry entry(trans, GET_BY_HANDLE, handles[i]); @@ -51,7 +54,7 @@ bool ProcessUnsyncedChangesForEncryption( bool VerifyUnsyncedChangesAreEncrypted( BaseTransaction* const trans, ModelTypeSet encrypted_types) { - std::vector<int64> handles; + std::vector<int64_t> handles; GetUnsyncedEntries(trans, &handles); for (size_t i = 0; i < handles.size(); ++i) { Entry entry(trans, GET_BY_HANDLE, handles[i]); diff --git a/sync/syncable/on_disk_directory_backing_store.h b/sync/syncable/on_disk_directory_backing_store.h index b24c584..af509dd 100644 --- a/sync/syncable/on_disk_directory_backing_store.h +++ b/sync/syncable/on_disk_directory_backing_store.h @@ -8,6 +8,7 @@ #include <string> #include "base/files/file_path.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/syncable/directory_backing_store.h" diff --git a/sync/syncable/parent_child_index.h b/sync/syncable/parent_child_index.h index eb973f6..540234c 100644 --- a/sync/syncable/parent_child_index.h +++ b/sync/syncable/parent_child_index.h @@ -9,7 +9,7 @@ #include <set> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" diff --git a/sync/syncable/scoped_kernel_lock.h b/sync/syncable/scoped_kernel_lock.h index 942faef..dbc28e7 100644 --- a/sync/syncable/scoped_kernel_lock.h +++ b/sync/syncable/scoped_kernel_lock.h @@ -5,7 +5,7 @@ #ifndef SYNC_SYNCABLE_SCOPED_KERNEL_LOCK_H_ #define SYNC_SYNCABLE_SCOPED_KERNEL_LOCK_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/synchronization/lock.h" namespace syncer { diff --git a/sync/syncable/scoped_parent_child_index_updater.h b/sync/syncable/scoped_parent_child_index_updater.h index 29bda16..0c6dedd 100644 --- a/sync/syncable/scoped_parent_child_index_updater.h +++ b/sync/syncable/scoped_parent_child_index_updater.h @@ -5,7 +5,7 @@ #ifndef SYNC_SYNCABLE_SCOPED_PARENT_CHILD_INDEX_UPDATER_H_ #define SYNC_SYNCABLE_SCOPED_PARENT_CHILD_INDEX_UPDATER_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "sync/base/sync_export.h" namespace syncer { diff --git a/sync/syncable/syncable_base_transaction.h b/sync/syncable/syncable_base_transaction.h index 8921623..a6b1f49 100644 --- a/sync/syncable/syncable_base_transaction.h +++ b/sync/syncable/syncable_base_transaction.h @@ -8,6 +8,7 @@ #include <string> #include "base/location.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/syncable/syncable_id.h" diff --git a/sync/syncable/syncable_base_write_transaction.h b/sync/syncable/syncable_base_write_transaction.h index 52ccc4f..af1c3fe 100644 --- a/sync/syncable/syncable_base_write_transaction.h +++ b/sync/syncable/syncable_base_write_transaction.h @@ -5,6 +5,7 @@ #ifndef SYNC_SYNCABLE_SYNCABLE_BASE_WRITE_TRANSACTION_H_ #define SYNC_SYNCABLE_SYNCABLE_BASE_WRITE_TRANSACTION_H_ +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/syncable/syncable_base_transaction.h" diff --git a/sync/syncable/syncable_columns.h b/sync/syncable/syncable_columns.h index 8b3bd9e..40e36ea 100644 --- a/sync/syncable/syncable_columns.h +++ b/sync/syncable/syncable_columns.h @@ -5,6 +5,7 @@ #ifndef SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_ #define SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_ +#include "base/macros.h" #include "sync/syncable/entry_kernel.h" #include "sync/syncable/syncable_changes_version.h" diff --git a/sync/syncable/syncable_delete_journal.cc b/sync/syncable/syncable_delete_journal.cc index 0aa04fa..923b065 100644 --- a/sync/syncable/syncable_delete_journal.cc +++ b/sync/syncable/syncable_delete_journal.cc @@ -4,6 +4,9 @@ #include "sync/syncable/syncable_delete_journal.h" +#include <stddef.h> +#include <stdint.h> + #include "base/stl_util.h" #include "sync/internal_api/public/base/model_type.h" @@ -83,7 +86,7 @@ void DeleteJournal::PurgeDeleteJournals(BaseTransaction* trans, DCHECK(trans); JournalIndex::iterator it = delete_journals_.begin(); while (it != delete_journals_.end()) { - int64 handle = (*it)->ref(META_HANDLE); + int64_t handle = (*it)->ref(META_HANDLE); if (to_purge.count(handle)) { delete *it; delete_journals_.erase(it++); diff --git a/sync/syncable/syncable_delete_journal.h b/sync/syncable/syncable_delete_journal.h index bba5321..c4271e5 100644 --- a/sync/syncable/syncable_delete_journal.h +++ b/sync/syncable/syncable_delete_journal.h @@ -5,9 +5,12 @@ #ifndef SYNC_SYNCABLE_SYNCABLE_DELETE_JOURNAL_H_ #define SYNC_SYNCABLE_SYNCABLE_DELETE_JOURNAL_H_ +#include <stddef.h> + #include <set> #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/synchronization/lock.h" #include "sync/base/sync_export.h" #include "sync/syncable/metahandle_set.h" diff --git a/sync/syncable/syncable_enum_conversions.cc b/sync/syncable/syncable_enum_conversions.cc index 6ac1fdc..c74b170 100644 --- a/sync/syncable/syncable_enum_conversions.cc +++ b/sync/syncable/syncable_enum_conversions.cc @@ -6,7 +6,6 @@ #include "sync/syncable/syncable_enum_conversions.h" -#include "base/basictypes.h" #include "base/logging.h" namespace syncer { diff --git a/sync/syncable/syncable_model_neutral_write_transaction.h b/sync/syncable/syncable_model_neutral_write_transaction.h index f51e802..62be038 100644 --- a/sync/syncable/syncable_model_neutral_write_transaction.h +++ b/sync/syncable/syncable_model_neutral_write_transaction.h @@ -5,6 +5,7 @@ #ifndef SYNC_SYNCABLE_SYNCABLE_MODEL_NEUTRAL_WRITE_TRANSACTION_H_ #define SYNC_SYNCABLE_SYNCABLE_MODEL_NEUTRAL_WRITE_TRANSACTION_H_ +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/syncable/metahandle_set.h" #include "sync/syncable/syncable_base_write_transaction.h" diff --git a/sync/syncable/syncable_read_transaction.h b/sync/syncable/syncable_read_transaction.h index 4ee325f..577336f 100644 --- a/sync/syncable/syncable_read_transaction.h +++ b/sync/syncable/syncable_read_transaction.h @@ -5,6 +5,9 @@ #ifndef SYNC_SYNCABLE_SYNCABLE_READ_TRANSACTION_H_ #define SYNC_SYNCABLE_SYNCABLE_READ_TRANSACTION_H_ +#include <stddef.h> + +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/syncable/syncable_base_transaction.h" diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc index c4d5443..e7f2e7d 100644 --- a/sync/syncable/syncable_unittest.cc +++ b/sync/syncable/syncable_unittest.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -18,6 +19,7 @@ #include "base/test/values_test_util.h" #include "base/threading/platform_thread.h" #include "base/values.h" +#include "build/build_config.h" #include "sync/protocol/bookmark_specifics.pb.h" #include "sync/syncable/directory_backing_store.h" #include "sync/syncable/directory_change_delegate.h" @@ -372,13 +374,13 @@ TEST_F(OnDiskSyncableDirectoryTest, } int i = BEGIN_FIELDS; for ( ; i < INT64_FIELDS_END ; ++i) { - EXPECT_EQ(create_pre_save.ref((Int64Field)i) + - (i == TRANSACTION_VERSION ? 1 : 0), - create_post_save.ref((Int64Field)i)) - << "int64 field #" << i << " changed during save/load"; + EXPECT_EQ( + create_pre_save.ref((Int64Field)i) + (i == TRANSACTION_VERSION ? 1 : 0), + create_post_save.ref((Int64Field)i)) + << "int64_t field #" << i << " changed during save/load"; EXPECT_EQ(update_pre_save.ref((Int64Field)i), update_post_save.ref((Int64Field)i)) - << "int64 field #" << i << " changed during save/load"; + << "int64_t field #" << i << " changed during save/load"; } for ( ; i < TIME_FIELDS_END ; ++i) { EXPECT_EQ(create_pre_save.ref((TimeField)i), @@ -431,7 +433,7 @@ TEST_F(OnDiskSyncableDirectoryTest, } TEST_F(OnDiskSyncableDirectoryTest, TestSaveChangesFailure) { - int64 handle1 = 0; + int64_t handle1 = 0; // Set up an item using a regular, saveable directory. { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); @@ -467,7 +469,7 @@ TEST_F(OnDiskSyncableDirectoryTest, TestSaveChangesFailure) { StartFailingSaveChanges(); ASSERT_TRUE(dir()->good()); - int64 handle2 = 0; + int64_t handle2 = 0; { WriteTransaction trans(FROM_HERE, UNITTEST, dir().get()); @@ -513,7 +515,7 @@ TEST_F(OnDiskSyncableDirectoryTest, TestSaveChangesFailure) { } TEST_F(OnDiskSyncableDirectoryTest, TestSaveChangesFailureWithPurge) { - int64 handle1 = 0; + int64_t handle1 = 0; // Set up an item and progress marker using a regular, saveable directory. dir()->SetDownloadProgress(BOOKMARKS, BuildProgress(BOOKMARKS)); { diff --git a/sync/syncable/syncable_util.cc b/sync/syncable/syncable_util.cc index 89d1375..e1271bf 100644 --- a/sync/syncable/syncable_util.cc +++ b/sync/syncable/syncable_util.cc @@ -4,6 +4,8 @@ #include "sync/syncable/syncable_util.h" +#include <stdint.h> + #include "base/base64.h" #include "base/location.h" #include "base/logging.h" @@ -18,8 +20,7 @@ namespace syncer { namespace syncable { // Returns the number of unsynced entries. -int GetUnsyncedEntries(BaseTransaction* trans, - std::vector<int64> *handles) { +int GetUnsyncedEntries(BaseTransaction* trans, std::vector<int64_t>* handles) { trans->directory()->GetUnsyncedMetaHandles(trans, handles); DVLOG_IF(1, !handles->empty()) << "Have " << handles->size() << " unsynced items."; diff --git a/sync/syncable/syncable_util.h b/sync/syncable/syncable_util.h index 7792579..a5d80a9 100644 --- a/sync/syncable/syncable_util.h +++ b/sync/syncable/syncable_util.h @@ -5,10 +5,11 @@ #ifndef SYNC_SYNCABLE_SYNCABLE_UTIL_H_ #define SYNC_SYNCABLE_SYNCABLE_UTIL_H_ +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" @@ -38,7 +39,7 @@ bool SyncAssert(bool condition, BaseTransaction* trans); SYNC_EXPORT int GetUnsyncedEntries(BaseTransaction* trans, - std::vector<int64>* handles); + std::vector<int64_t>* handles); // Generates a fixed-length tag for the given string under the given model_type. SYNC_EXPORT std::string GenerateSyncableHash(ModelType model_type, diff --git a/sync/syncable/syncable_write_transaction.cc b/sync/syncable/syncable_write_transaction.cc index 1e1ac56..08b6aaa 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 <stdint.h> + #include <string> #include "sync/syncable/directory.h" @@ -15,7 +17,7 @@ namespace syncer { namespace syncable { -const int64 kInvalidTransactionVersion = -1; +const int64_t kInvalidTransactionVersion = -1; WriteTransaction::WriteTransaction(const tracked_objects::Location& location, WriterTag writer, Directory* directory) @@ -26,7 +28,7 @@ WriteTransaction::WriteTransaction(const tracked_objects::Location& location, WriteTransaction::WriteTransaction(const tracked_objects::Location& location, Directory* directory, - int64* transaction_version) + int64_t* transaction_version) : BaseWriteTransaction(location, "WriteTransaction", SYNCAPI, directory), transaction_version_(transaction_version) { Lock(); @@ -39,7 +41,7 @@ void WriteTransaction::TrackChangesTo(const EntryKernel* entry) { return; } // Insert only if it's not already there. - const int64 handle = entry->ref(META_HANDLE); + const int64_t handle = entry->ref(META_HANDLE); EntryKernelMutationMap::iterator it = mutations_.lower_bound(handle); if (it == mutations_.end() || it->first != handle) { mutations_[handle].original = *entry; @@ -96,7 +98,7 @@ ModelTypeSet WriteTransaction::NotifyTransactionChangingAndEnding( ImmutableWriteTransactionInfo immutable_write_transaction_info( &write_transaction_info); DirectoryChangeDelegate* const delegate = directory_->kernel()->delegate; - std::vector<int64> entry_changed; + std::vector<int64_t> entry_changed; if (writer_ == syncable::SYNCAPI) { delegate->HandleCalculateChangesChangeEventFromSyncApi( immutable_write_transaction_info, this, &entry_changed); @@ -124,9 +126,9 @@ void WriteTransaction::NotifyTransactionComplete( } void WriteTransaction::UpdateTransactionVersion( - const std::vector<int64>& entry_changed) { + const std::vector<int64_t>& entry_changed) { syncer::ModelTypeSet type_seen; - for (uint32 i = 0; i < entry_changed.size(); ++i) { + for (uint32_t i = 0; i < entry_changed.size(); ++i) { MutableEntry entry(this, GET_BY_HANDLE, entry_changed[i]); if (entry.good()) { ModelType type = GetModelTypeFromSpecifics(entry.GetSpecifics()); diff --git a/sync/syncable/syncable_write_transaction.h b/sync/syncable/syncable_write_transaction.h index f85b035..593647f 100644 --- a/sync/syncable/syncable_write_transaction.h +++ b/sync/syncable/syncable_write_transaction.h @@ -5,8 +5,11 @@ #ifndef SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_ #define SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_ +#include <stdint.h> + #include <vector> +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/syncable/entry_kernel.h" #include "sync/syncable/syncable_base_write_transaction.h" @@ -14,7 +17,7 @@ namespace syncer { namespace syncable { -SYNC_EXPORT extern const int64 kInvalidTransactionVersion; +SYNC_EXPORT extern const int64_t kInvalidTransactionVersion; // Locks db in constructor, unlocks in destructor. class SYNC_EXPORT WriteTransaction : public BaseWriteTransaction { @@ -28,7 +31,8 @@ class SYNC_EXPORT WriteTransaction : public BaseWriteTransaction { // in |transaction_version| upon destruction of the transaction. If model is // not changed, |transaction_version| will be kInvalidTransactionVersion. WriteTransaction(const tracked_objects::Location& from_here, - Directory* directory, int64* transaction_version); + Directory* directory, + int64_t* transaction_version); ~WriteTransaction() override; @@ -51,7 +55,7 @@ class SYNC_EXPORT WriteTransaction : public BaseWriteTransaction { // Increment versions of the models whose entries are modified and set the // version on the changed entries. - void UpdateTransactionVersion(const std::vector<int64>& entry_changed); + void UpdateTransactionVersion(const std::vector<int64_t>& entry_changed); // Only the original fields are filled in until |RecordMutations()|. // We use a mutation map instead of a kernel set to avoid copying. @@ -59,7 +63,7 @@ class SYNC_EXPORT WriteTransaction : public BaseWriteTransaction { // Stores new transaction version of changed model and nodes if model is // indeed changed. kInvalidTransactionVersion otherwise. Not owned. - int64* transaction_version_; + int64_t* transaction_version_; DISALLOW_COPY_AND_ASSIGN(WriteTransaction); }; diff --git a/sync/syncable/write_transaction_info.cc b/sync/syncable/write_transaction_info.cc index a8a2327..6a2df9f 100644 --- a/sync/syncable/write_transaction_info.cc +++ b/sync/syncable/write_transaction_info.cc @@ -4,13 +4,16 @@ #include "sync/syncable/write_transaction_info.h" +#include <stddef.h> +#include <stdint.h> + #include "base/strings/string_number_conversions.h" namespace syncer { namespace syncable { WriteTransactionInfo::WriteTransactionInfo( - int64 id, + int64_t id, tracked_objects::Location location, WriterTag writer, ImmutableEntryKernelMutationMap mutations) diff --git a/sync/syncable/write_transaction_info.h b/sync/syncable/write_transaction_info.h index 0b571d2..dcf2ab4 100644 --- a/sync/syncable/write_transaction_info.h +++ b/sync/syncable/write_transaction_info.h @@ -5,6 +5,9 @@ #ifndef SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_ #define SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> #include "sync/syncable/entry_kernel.h" @@ -15,7 +18,7 @@ namespace syncable { // A struct describing the changes made during a transaction. struct WriteTransactionInfo { - WriteTransactionInfo(int64 id, + WriteTransactionInfo(int64_t id, tracked_objects::Location location, WriterTag writer, ImmutableEntryKernelMutationMap mutations); @@ -25,7 +28,7 @@ struct WriteTransactionInfo { // Caller owns the return value. base::DictionaryValue* ToValue(size_t max_mutations_size) const; - int64 id; + int64_t id; // If tracked_objects::Location becomes assignable, we can use that // instead. std::string location_string; diff --git a/sync/test/callback_counter.h b/sync/test/callback_counter.h index 16b2acb..cd56e38 100644 --- a/sync/test/callback_counter.h +++ b/sync/test/callback_counter.h @@ -5,6 +5,8 @@ #ifndef SYNC_TEST_CALLBACK_COUNTER_H_ #define SYNC_TEST_CALLBACK_COUNTER_H_ +#include "base/macros.h" + namespace syncer { // Helper class to track how many times a callback is triggered. diff --git a/sync/test/engine/fake_model_worker.h b/sync/test/engine/fake_model_worker.h index beb5400..603d769 100644 --- a/sync/test/engine/fake_model_worker.h +++ b/sync/test/engine/fake_model_worker.h @@ -7,8 +7,8 @@ #include <vector> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/threading/non_thread_safe.h" #include "sync/internal_api/public/engine/model_safe_worker.h" #include "sync/internal_api/public/util/syncer_error.h" diff --git a/sync/test/engine/mock_commit_queue.cc b/sync/test/engine/mock_commit_queue.cc index e3a9a12..d6740c0 100644 --- a/sync/test/engine/mock_commit_queue.cc +++ b/sync/test/engine/mock_commit_queue.cc @@ -4,6 +4,9 @@ #include "sync/test/engine/mock_commit_queue.h" +#include <stddef.h> +#include <stdint.h> + #include "base/logging.h" namespace syncer_v2 { @@ -67,12 +70,12 @@ CommitRequestData MockCommitQueue::GetLatestCommitRequestForTagHash( } UpdateResponseData MockCommitQueue::UpdateFromServer( - int64 version_offset, + int64_t version_offset, const std::string& tag_hash, const sync_pb::EntitySpecifics& specifics) { // Overwrite the existing server version if this is the new highest version. - int64 old_version = GetServerVersion(tag_hash); - int64 version = old_version + version_offset; + int64_t old_version = GetServerVersion(tag_hash); + int64_t version = old_version + version_offset; if (version > old_version) { SetServerVersion(tag_hash, version); } @@ -97,10 +100,10 @@ UpdateResponseData MockCommitQueue::UpdateFromServer( } UpdateResponseData MockCommitQueue::TombstoneFromServer( - int64 version_offset, + int64_t version_offset, const std::string& tag_hash) { - int64 old_version = GetServerVersion(tag_hash); - int64 version = old_version + version_offset; + int64_t old_version = GetServerVersion(tag_hash); + int64_t version = old_version + version_offset; if (version > old_version) { SetServerVersion(tag_hash, version); } @@ -143,7 +146,7 @@ CommitResponseData MockCommitQueue::SuccessfulCommitResponse( response_data.sequence_number = request_data.sequence_number; // Increment the server version on successful commit. - int64 version = GetServerVersion(client_tag_hash); + int64_t version = GetServerVersion(client_tag_hash); version++; SetServerVersion(client_tag_hash, version); @@ -161,8 +164,8 @@ std::string MockCommitQueue::GenerateId(const std::string& tag_hash) { return "FakeId:" + tag_hash; } -int64 MockCommitQueue::GetServerVersion(const std::string& tag_hash) { - std::map<const std::string, int64>::const_iterator it; +int64_t MockCommitQueue::GetServerVersion(const std::string& tag_hash) { + std::map<const std::string, int64_t>::const_iterator it; it = server_versions_.find(tag_hash); if (it == server_versions_.end()) { return 0; @@ -172,7 +175,7 @@ int64 MockCommitQueue::GetServerVersion(const std::string& tag_hash) { } void MockCommitQueue::SetServerVersion(const std::string& tag_hash, - int64 version) { + int64_t version) { server_versions_[tag_hash] = version; } diff --git a/sync/test/engine/mock_commit_queue.h b/sync/test/engine/mock_commit_queue.h index 65a6e11..f217183 100644 --- a/sync/test/engine/mock_commit_queue.h +++ b/sync/test/engine/mock_commit_queue.h @@ -5,6 +5,9 @@ #ifndef SYNC_TEST_ENGINE_MOCK_COMMIT_QUEUE_H_ #define SYNC_TEST_ENGINE_MOCK_COMMIT_QUEUE_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <string> #include <vector> @@ -45,13 +48,13 @@ class MockCommitQueue : public CommitQueue { // going backwards), reflections and redeliveries (ie. several instances of // the same version) or new updates. UpdateResponseData UpdateFromServer( - int64 version_offset, + int64_t version_offset, const std::string& tag_hash, const sync_pb::EntitySpecifics& specifics); // Returns an UpdateResponseData representing a tombstone update from the // server. Updates server state accordingly. - UpdateResponseData TombstoneFromServer(int64 version_offset, + UpdateResponseData TombstoneFromServer(int64_t version_offset, const std::string& tag_hash); // Returns a commit response that indicates a successful commit of the @@ -69,15 +72,15 @@ class MockCommitQueue : public CommitQueue { static std::string GenerateId(const std::string& tag_hash); // Retrieve or set the server version. - int64 GetServerVersion(const std::string& tag_hash); - void SetServerVersion(const std::string& tag_hash, int64 version); + int64_t GetServerVersion(const std::string& tag_hash); + void SetServerVersion(const std::string& tag_hash, int64_t version); // A record of past commits requests. std::vector<CommitRequestDataList> commit_request_lists_; // Map of versions by client tag. // This is an essential part of the mocked server state. - std::map<const std::string, int64> server_versions_; + std::map<const std::string, int64_t> server_versions_; // Name of the encryption key in use on other clients. std::string server_encryption_key_name_; diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc index a82ac63..5a7ecd9 100644 --- a/sync/test/engine/mock_connection_manager.cc +++ b/sync/test/engine/mock_connection_manager.cc @@ -6,6 +6,8 @@ #include "sync/test/engine/mock_connection_manager.h" +#include <stdint.h> + #include <map> #include "base/location.h" @@ -214,8 +216,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateDirectory( int id, int parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const std::string& originator_cache_guid, const std::string& originator_client_item_id) { return AddUpdateDirectory(TestIdFactory::FromNumber(id), @@ -245,8 +247,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateBookmark( int id, int parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const string& originator_client_item_id, const string& originator_cache_guid) { return AddUpdateBookmark(TestIdFactory::FromNumber(id), @@ -262,10 +264,10 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateSpecifics( int id, int parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, bool is_dir, - int64 position, + int64_t position, const sync_pb::EntitySpecifics& specifics) { sync_pb::SyncEntity* ent = AddUpdateMeta( TestIdFactory::FromNumber(id).GetServerId(), @@ -281,10 +283,10 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateSpecifics( int id, int parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, bool is_dir, - int64 position, + int64_t position, const sync_pb::EntitySpecifics& specifics, const string& originator_cache_guid, const string& originator_client_item_id) { @@ -297,8 +299,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateSpecifics( sync_pb::SyncEntity* MockConnectionManager::SetNigori( int id, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const sync_pb::EntitySpecifics& specifics) { sync_pb::SyncEntity* ent = GetUpdateResponse()->add_entries(); ent->set_id_string(TestIdFactory::FromNumber(id).GetServerId()); @@ -320,8 +322,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdatePref( const string& id, const string& parent_id, const string& client_tag, - int64 version, - int64 sync_ts) { + int64_t version, + int64_t sync_ts) { sync_pb::SyncEntity* ent = AddUpdateMeta(id, parent_id, " ", version, sync_ts); @@ -338,8 +340,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateFull( const string& id, const string& parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, bool is_dir) { sync_pb::SyncEntity* ent = AddUpdateMeta(id, parent_id, name, version, sync_ts); @@ -351,8 +353,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateMeta( const string& id, const string& parent_id, const string& name, - int64 version, - int64 sync_ts) { + int64_t version, + int64_t sync_ts) { sync_pb::SyncEntity* ent = GetUpdateResponse()->add_entries(); ent->set_id_string(id); ent->set_parent_id_string(parent_id); @@ -383,8 +385,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateDirectory( const string& id, const string& parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const std::string& originator_cache_guid, const std::string& originator_client_item_id) { sync_pb::SyncEntity* ret = @@ -398,8 +400,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateBookmark( const string& id, const string& parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const string& originator_cache_guid, const string& originator_client_item_id) { sync_pb::SyncEntity* ret = @@ -485,7 +487,7 @@ void MockConnectionManager::SetLastUpdateClientTag(const string& tag) { GetMutableLastUpdate()->set_client_defined_unique_tag(tag); } -void MockConnectionManager::SetLastUpdatePosition(int64 server_position) { +void MockConnectionManager::SetLastUpdatePosition(int64_t server_position) { GetMutableLastUpdate()->set_position_in_parent(server_position); } @@ -508,7 +510,7 @@ void MockConnectionManager::ApplyToken() { } } -void MockConnectionManager::SetChangesRemaining(int64 timestamp) { +void MockConnectionManager::SetChangesRemaining(int64_t timestamp) { GetUpdateResponse()->set_changes_remaining(timestamp); } @@ -669,8 +671,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateDirectory( syncable::Id id, syncable::Id parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const string& originator_cache_guid, const string& originator_client_item_id) { return AddUpdateDirectory(id.GetServerId(), parent_id.GetServerId(), @@ -682,8 +684,8 @@ sync_pb::SyncEntity* MockConnectionManager::AddUpdateBookmark( syncable::Id id, syncable::Id parent_id, const string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const string& originator_cache_guid, const string& originator_client_item_id) { return AddUpdateBookmark(id.GetServerId(), parent_id.GetServerId(), diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h index 6595fa0e..03baff3 100644 --- a/sync/test/engine/mock_connection_manager.h +++ b/sync/test/engine/mock_connection_manager.h @@ -7,6 +7,8 @@ #ifndef SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ #define SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ +#include <stdint.h> + #include <bitset> #include <list> #include <string> @@ -14,6 +16,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/synchronization/lock.h" #include "sync/engine/net/server_connection_manager.h" @@ -52,7 +55,7 @@ class MockConnectionManager : public ServerConnectionManager { void SetCommitTimeRename(const std::string& prepend); // Generic versions of AddUpdate functions. Tests using these function should - // compile for both the int64 and string id based versions of the server. + // compile for both the int64_t and string id based versions of the server. // The SyncEntity returned is only valid until the Sync is completed // (e.g. with SyncShare.) It allows to add further entity properties before // sync, using SetLastXXX() methods and/or GetMutableLastUpdate(). @@ -60,16 +63,16 @@ class MockConnectionManager : public ServerConnectionManager { syncable::Id id, syncable::Id parent_id, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const std::string& originator_cache_guid, const std::string& originator_client_item_id); sync_pb::SyncEntity* AddUpdateBookmark( syncable::Id id, syncable::Id parent_id, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const std::string& originator_cache_guid, const std::string& originator_client_item_id); // Versions of the AddUpdate functions that accept integer IDs. @@ -77,16 +80,16 @@ class MockConnectionManager : public ServerConnectionManager { int id, int parent_id, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const std::string& originator_cache_guid, const std::string& originator_client_item_id); sync_pb::SyncEntity* AddUpdateBookmark( int id, int parent_id, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const std::string& originator_cache_guid, const std::string& originator_client_item_id); // New protocol versions of the AddUpdate functions. @@ -94,16 +97,16 @@ class MockConnectionManager : public ServerConnectionManager { const std::string& id, const std::string& parent_id, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const std::string& originator_cache_guid, const std::string& originator_client_item_id); sync_pb::SyncEntity* AddUpdateBookmark( const std::string& id, const std::string& parent_id, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, const std::string& originator_cache_guid, const std::string& originator_client_item_id); // Versions of the AddUpdate function that accept specifics. @@ -111,33 +114,32 @@ class MockConnectionManager : public ServerConnectionManager { int id, int parent_id, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, bool is_dir, - int64 position, + int64_t position, const sync_pb::EntitySpecifics& specifics); sync_pb::SyncEntity* AddUpdateSpecifics( int id, int parent_id, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, bool is_dir, - int64 position, + int64_t position, const sync_pb::EntitySpecifics& specifics, const std::string& originator_cache_guid, const std::string& originator_client_item_id); - sync_pb::SyncEntity* SetNigori( - int id, - int64 version, - int64 sync_ts, - const sync_pb::EntitySpecifics& specifics); + sync_pb::SyncEntity* SetNigori(int id, + int64_t version, + int64_t sync_ts, + const sync_pb::EntitySpecifics& specifics); // Unique client tag variant for adding items. sync_pb::SyncEntity* AddUpdatePref(const std::string& id, const std::string& parent_id, const std::string& client_tag, - int64 version, - int64 sync_ts); + int64_t version, + int64_t sync_ts); // Find the last commit sent by the client, and replay it for the next get // updates command. This can be used to simulate the GetUpdates that happens @@ -154,9 +156,9 @@ class MockConnectionManager : public ServerConnectionManager { void SetLastUpdateClientTag(const std::string& tag); void SetLastUpdateOriginatorFields(const std::string& client_id, const std::string& entry_id); - void SetLastUpdatePosition(int64 position_in_parent); + void SetLastUpdatePosition(int64_t position_in_parent); void SetNewTimestamp(int ts); - void SetChangesRemaining(int64 count); + void SetChangesRemaining(int64_t count); // Add a new batch of updates after the current one. Allows multiple // GetUpdates responses to be buffered up, since the syncer may @@ -275,20 +277,20 @@ class MockConnectionManager : public ServerConnectionManager { sync_pb::SyncEntity* AddUpdateFull(syncable::Id id, syncable::Id parentid, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, bool is_dir); sync_pb::SyncEntity* AddUpdateFull(const std::string& id, const std::string& parentid, const std::string& name, - int64 version, - int64 sync_ts, + int64_t version, + int64_t sync_ts, bool is_dir); sync_pb::SyncEntity* AddUpdateMeta(const std::string& id, const std::string& parentid, const std::string& name, - int64 version, - int64 sync_ts); + int64_t version, + int64_t sync_ts); // Functions to handle the various types of server request. void ProcessGetUpdates(sync_pb::ClientToServerMessage* csm, @@ -309,9 +311,7 @@ class MockConnectionManager : public ServerConnectionManager { // Generate a numeric position_in_parent value. We use a global counter // that only decreases; this simulates new objects always being added to the // front of the ordering. - int64 GeneratePositionInParent() { - return next_position_in_parent_--; - } + int64_t GeneratePositionInParent() { return next_position_in_parent_--; } // Get a mutable update response which will eventually be returned to the // client. @@ -398,7 +398,7 @@ class MockConnectionManager : public ServerConnectionManager { scoped_ptr<sync_pb::ClientCommand> commit_client_command_; // The next value to use for the position_in_parent property. - int64 next_position_in_parent_; + int64_t next_position_in_parent_; // The default is to use the newer sync_pb::BookmarkSpecifics-style protocol. // If this option is set to true, then the MockConnectionManager will diff --git a/sync/test/engine/mock_model_type_processor.cc b/sync/test/engine/mock_model_type_processor.cc index 8f2f947..d4249e2 100644 --- a/sync/test/engine/mock_model_type_processor.cc +++ b/sync/test/engine/mock_model_type_processor.cc @@ -4,6 +4,9 @@ #include "sync/test/engine/mock_model_type_processor.h" +#include <stddef.h> +#include <stdint.h> + #include "base/bind.h" #include "sync/engine/commit_queue.h" @@ -62,7 +65,7 @@ void MockModelTypeProcessor::RunQueuedTasks() { CommitRequestData MockModelTypeProcessor::CommitRequest( const std::string& tag_hash, const sync_pb::EntitySpecifics& specifics) { - const int64 base_version = GetBaseVersion(tag_hash); + const int64_t base_version = GetBaseVersion(tag_hash); EntityData data; @@ -90,7 +93,7 @@ CommitRequestData MockModelTypeProcessor::CommitRequest( CommitRequestData MockModelTypeProcessor::DeleteRequest( const std::string& tag_hash) { - const int64 base_version = GetBaseVersion(tag_hash); + const int64_t base_version = GetBaseVersion(tag_hash); EntityData data; @@ -218,9 +221,9 @@ void MockModelTypeProcessor::OnUpdateReceivedImpl( } // Fetches the sequence number as of the most recent update request. -int64 MockModelTypeProcessor::GetCurrentSequenceNumber( +int64_t MockModelTypeProcessor::GetCurrentSequenceNumber( const std::string& tag_hash) const { - std::map<const std::string, int64>::const_iterator it = + std::map<const std::string, int64_t>::const_iterator it = sequence_numbers_.find(tag_hash); if (it == sequence_numbers_.end()) { return 0; @@ -231,17 +234,17 @@ int64 MockModelTypeProcessor::GetCurrentSequenceNumber( // The model thread should be sending us items with strictly increasing // sequence numbers. Here's where we emulate that behavior. -int64 MockModelTypeProcessor::GetNextSequenceNumber( +int64_t MockModelTypeProcessor::GetNextSequenceNumber( const std::string& tag_hash) { - int64 sequence_number = GetCurrentSequenceNumber(tag_hash); + int64_t sequence_number = GetCurrentSequenceNumber(tag_hash); sequence_number++; sequence_numbers_[tag_hash] = sequence_number; return sequence_number; } -int64 MockModelTypeProcessor::GetBaseVersion( +int64_t MockModelTypeProcessor::GetBaseVersion( const std::string& tag_hash) const { - std::map<const std::string, int64>::const_iterator it = + std::map<const std::string, int64_t>::const_iterator it = base_versions_.find(tag_hash); if (it == base_versions_.end()) { return kUncommittedVersion; @@ -251,7 +254,7 @@ int64 MockModelTypeProcessor::GetBaseVersion( } void MockModelTypeProcessor::SetBaseVersion(const std::string& tag_hash, - int64 version) { + int64_t version) { base_versions_[tag_hash] = version; } diff --git a/sync/test/engine/mock_model_type_processor.h b/sync/test/engine/mock_model_type_processor.h index d926dfe..120dedc8 100644 --- a/sync/test/engine/mock_model_type_processor.h +++ b/sync/test/engine/mock_model_type_processor.h @@ -5,6 +5,9 @@ #ifndef SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ #define SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <string> #include <vector> @@ -100,12 +103,12 @@ class MockModelTypeProcessor : public ModelTypeProcessor { const UpdateResponseDataList& pending_updates); // Getter and setter for per-item sequence number tracking. - int64 GetCurrentSequenceNumber(const std::string& tag_hash) const; - int64 GetNextSequenceNumber(const std::string& tag_hash); + int64_t GetCurrentSequenceNumber(const std::string& tag_hash) const; + int64_t GetNextSequenceNumber(const std::string& tag_hash); // Getter and setter for per-item base version tracking. - int64 GetBaseVersion(const std::string& tag_hash) const; - void SetBaseVersion(const std::string& tag_hash, int64 version); + int64_t GetBaseVersion(const std::string& tag_hash) const; + void SetBaseVersion(const std::string& tag_hash, int64_t version); // Getters and setter for server-assigned ID values. bool HasServerAssignedId(const std::string& tag_hash) const; @@ -130,8 +133,8 @@ class MockModelTypeProcessor : public ModelTypeProcessor { std::map<const std::string, UpdateResponseData> update_response_items_; // The per-item state maps. - std::map<const std::string, int64> sequence_numbers_; - std::map<const std::string, int64> base_versions_; + std::map<const std::string, int64_t> sequence_numbers_; + std::map<const std::string, int64_t> base_versions_; std::map<const std::string, std::string> assigned_ids_; DISALLOW_COPY_AND_ASSIGN(MockModelTypeProcessor); diff --git a/sync/test/engine/mock_nudge_handler.h b/sync/test/engine/mock_nudge_handler.h index 477d2bd..80d34ea 100644 --- a/sync/test/engine/mock_nudge_handler.h +++ b/sync/test/engine/mock_nudge_handler.h @@ -5,8 +5,8 @@ #ifndef SYNC_TEST_ENGINE_MOCK_NUDGE_HANDLER_H_ #define SYNC_TEST_ENGINE_MOCK_NUDGE_HANDLER_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/engine/nudge_handler.h" #include "sync/internal_api/public/base/model_type.h" diff --git a/sync/test/engine/single_type_mock_server.cc b/sync/test/engine/single_type_mock_server.cc index 6f828fb..6c0b5cd 100644 --- a/sync/test/engine/single_type_mock_server.cc +++ b/sync/test/engine/single_type_mock_server.cc @@ -4,6 +4,9 @@ #include "sync/test/engine/single_type_mock_server.h" +#include <stddef.h> +#include <stdint.h> + #include "sync/util/time.h" using google::protobuf::RepeatedPtrField; @@ -33,11 +36,11 @@ sync_pb::SyncEntity SingleTypeMockServer::TypeRootUpdate() { } sync_pb::SyncEntity SingleTypeMockServer::UpdateFromServer( - int64 version_offset, + int64_t version_offset, const std::string& tag_hash, const sync_pb::EntitySpecifics& specifics) { - int64 old_version = GetServerVersion(tag_hash); - int64 version = old_version + version_offset; + int64_t old_version = GetServerVersion(tag_hash); + int64_t version = old_version + version_offset; if (version > old_version) { SetServerVersion(tag_hash, version); } @@ -62,10 +65,10 @@ sync_pb::SyncEntity SingleTypeMockServer::UpdateFromServer( } sync_pb::SyncEntity SingleTypeMockServer::TombstoneFromServer( - int64 version_offset, + int64_t version_offset, const std::string& tag_hash) { - int64 old_version = GetServerVersion(tag_hash); - int64 version = old_version + version_offset; + int64_t old_version = GetServerVersion(tag_hash); + int64_t version = old_version + version_offset; if (version > old_version) { SetServerVersion(tag_hash, version); } @@ -107,7 +110,7 @@ sync_pb::ClientToServerResponse SingleTypeMockServer::DoSuccessfulCommit( committed_items_[tag_hash] = *it; // Every commit increments the version number. - int64 version = GetServerVersion(tag_hash); + int64_t version = GetServerVersion(tag_hash); version++; SetServerVersion(tag_hash, version); @@ -159,9 +162,9 @@ std::string SingleTypeMockServer::GenerateId(const std::string& tag_hash) { return "FakeId:" + tag_hash; } -int64 SingleTypeMockServer::GetServerVersion( +int64_t SingleTypeMockServer::GetServerVersion( const std::string& tag_hash) const { - std::map<const std::string, int64>::const_iterator it; + std::map<const std::string, int64_t>::const_iterator it; it = server_versions_.find(tag_hash); // Server versions do not necessarily start at 1 or 0. if (it == server_versions_.end()) { @@ -172,7 +175,7 @@ int64 SingleTypeMockServer::GetServerVersion( } void SingleTypeMockServer::SetServerVersion(const std::string& tag_hash, - int64 version) { + int64_t version) { server_versions_[tag_hash] = version; } diff --git a/sync/test/engine/single_type_mock_server.h b/sync/test/engine/single_type_mock_server.h index 53ec575..ca1f5e3 100644 --- a/sync/test/engine/single_type_mock_server.h +++ b/sync/test/engine/single_type_mock_server.h @@ -5,10 +5,14 @@ #ifndef SYNC_TEST_ENGINE_SINGLE_TYPE_MOCK_SERVER_H_ #define SYNC_TEST_ENGINE_SINGLE_TYPE_MOCK_SERVER_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <string> #include <vector> +#include "base/macros.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/non_blocking_sync_common.h" @@ -35,13 +39,13 @@ class SingleTypeMockServer { // The |version_offset| parameter allows the caller to simulate reflected // updates, redeliveries, and genuine updates. sync_pb::SyncEntity UpdateFromServer( - int64 version_offset, + int64_t version_offset, const std::string& tag_hash, const sync_pb::EntitySpecifics& specifics); // Generates a SyncEntity representing a server-delivered update to delete // an item. - sync_pb::SyncEntity TombstoneFromServer(int64 version_offset, + sync_pb::SyncEntity TombstoneFromServer(int64_t version_offset, const std::string& tag_hash); // Generates a response to the specified commit message. @@ -74,14 +78,14 @@ class SingleTypeMockServer { static std::string GenerateId(const std::string& tag_hash); // Get and set our emulated server state. - int64 GetServerVersion(const std::string& tag_hash) const; - void SetServerVersion(const std::string& tag_hash, int64 version); + int64_t GetServerVersion(const std::string& tag_hash) const; + void SetServerVersion(const std::string& tag_hash, int64_t version); const ModelType type_; const std::string type_root_id_; // Server version state maps. - std::map<const std::string, int64> server_versions_; + std::map<const std::string, int64_t> server_versions_; // Log of messages sent to the server. std::vector<sync_pb::ClientToServerMessage> commit_messages_; diff --git a/sync/test/engine/test_directory_setter_upper.h b/sync/test/engine/test_directory_setter_upper.h index 587236a..72b4ee9 100644 --- a/sync/test/engine/test_directory_setter_upper.h +++ b/sync/test/engine/test_directory_setter_upper.h @@ -31,8 +31,8 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "sync/test/fake_sync_encryption_handler.h" #include "sync/test/null_directory_change_delegate.h" diff --git a/sync/test/engine/test_id_factory.h b/sync/test/engine/test_id_factory.h index 40a3b5b..705575a 100644 --- a/sync/test/engine/test_id_factory.h +++ b/sync/test/engine/test_id_factory.h @@ -7,6 +7,8 @@ #ifndef SYNC_TEST_ENGINE_TEST_ID_FACTORY_H_ #define SYNC_TEST_ENGINE_TEST_ID_FACTORY_H_ +#include <stdint.h> + #include <string> #include "base/strings/string_number_conversions.h" @@ -26,7 +28,7 @@ class TestIdFactory { // If the number is positive, create a server ID based on the value. If // the number is negative, create a local ID based on the value. This // is deterministic, and [FromNumber(X) == FromNumber(Y)] iff [X == Y]. - static syncable::Id FromNumber(int64 value) { + static syncable::Id FromNumber(int64_t value) { if (value == 0) return root(); else if (value < 0) diff --git a/sync/test/fake_server/android/fake_server_helper_android.cc b/sync/test/fake_server/android/fake_server_helper_android.cc index 919f3a6..ea485e9 100644 --- a/sync/test/fake_server/android/fake_server_helper_android.cc +++ b/sync/test/fake_server/android/fake_server_helper_android.cc @@ -5,12 +5,12 @@ #include "sync/test/fake_server/android/fake_server_helper_android.h" #include <jni.h> +#include <stddef.h> #include <set> #include <vector> #include "base/android/jni_array.h" #include "base/android/jni_string.h" -#include "base/basictypes.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "jni/FakeServerHelper_jni.h" diff --git a/sync/test/fake_server/android/fake_server_helper_android.h b/sync/test/fake_server/android/fake_server_helper_android.h index 497b2e0..aa93f8d 100644 --- a/sync/test/fake_server/android/fake_server_helper_android.h +++ b/sync/test/fake_server/android/fake_server_helper_android.h @@ -9,7 +9,6 @@ #include <string> #include "base/android/scoped_java_ref.h" -#include "base/basictypes.h" #include "sync/test/fake_server/entity_builder_factory.h" // Helper for utilizing native FakeServer infrastructure in Android tests. diff --git a/sync/test/fake_server/bookmark_entity.cc b/sync/test/fake_server/bookmark_entity.cc index 9a9ac69..b14e864 100644 --- a/sync/test/fake_server/bookmark_entity.cc +++ b/sync/test/fake_server/bookmark_entity.cc @@ -4,9 +4,10 @@ #include "sync/test/fake_server/bookmark_entity.h" +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/guid.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" @@ -71,18 +72,17 @@ scoped_ptr<FakeServerEntity> BookmarkEntity::CreateUpdatedVersion( client_entity.mtime())); } -BookmarkEntity::BookmarkEntity( - const string& id, - int64 version, - const string& name, - const string& originator_cache_guid, - const string& originator_client_item_id, - const sync_pb::UniquePosition& unique_position, - const sync_pb::EntitySpecifics& specifics, - bool is_folder, - const string& parent_id, - int64 creation_time, - int64 last_modified_time) +BookmarkEntity::BookmarkEntity(const string& id, + int64_t version, + const string& name, + const string& originator_cache_guid, + const string& originator_client_item_id, + const sync_pb::UniquePosition& unique_position, + const sync_pb::EntitySpecifics& specifics, + bool is_folder, + const string& parent_id, + int64_t creation_time, + int64_t last_modified_time) : FakeServerEntity(id, syncer::BOOKMARKS, version, name), originator_cache_guid_(originator_cache_guid), originator_client_item_id_(originator_client_item_id), diff --git a/sync/test/fake_server/bookmark_entity.h b/sync/test/fake_server/bookmark_entity.h index aabb059..02e1011 100644 --- a/sync/test/fake_server/bookmark_entity.h +++ b/sync/test/fake_server/bookmark_entity.h @@ -5,10 +5,11 @@ #ifndef SYNC_TEST_FAKE_SERVER_BOOKMARK_ENTITY_H_ #define SYNC_TEST_FAKE_SERVER_BOOKMARK_ENTITY_H_ +#include <stdint.h> + #include <map> #include <string> -#include "base/basictypes.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" #include "sync/test/fake_server/fake_server_entity.h" @@ -38,7 +39,7 @@ class BookmarkEntity : public FakeServerEntity { const std::string& parent_id); BookmarkEntity(const std::string& id, - int64 version, + int64_t version, const std::string& name, const std::string& originator_cache_guid, const std::string& originator_client_item_id, @@ -46,8 +47,8 @@ class BookmarkEntity : public FakeServerEntity { const sync_pb::EntitySpecifics& specifics, bool is_folder, const std::string& parent_id, - int64 creation_time, - int64 last_modified_time); + int64_t creation_time, + int64_t last_modified_time); void SetParentId(const std::string& parent_id); @@ -64,8 +65,8 @@ class BookmarkEntity : public FakeServerEntity { sync_pb::UniquePosition unique_position_; bool is_folder_; std::string parent_id_; - int64 creation_time_; - int64 last_modified_time_; + int64_t creation_time_; + int64_t last_modified_time_; }; } // namespace fake_server diff --git a/sync/test/fake_server/bookmark_entity_builder.cc b/sync/test/fake_server/bookmark_entity_builder.cc index c73fb08..20a5b03 100644 --- a/sync/test/fake_server/bookmark_entity_builder.cc +++ b/sync/test/fake_server/bookmark_entity_builder.cc @@ -4,6 +4,8 @@ #include "sync/test/fake_server/bookmark_entity_builder.h" +#include <stdint.h> + #include <string> #include "base/guid.h" @@ -24,10 +26,10 @@ using syncer::syncable::GenerateSyncableBookmarkHash; // A version must be passed when creating a FakeServerEntity, but this value // is overrideen immediately when saving the entity in FakeServer. -const int64 kUnusedVersion = 0L; +const int64_t kUnusedVersion = 0L; // Default time (creation and last modified) used when creating entities. -const int64 kDefaultTime = 1234L; +const int64_t kDefaultTime = 1234L; namespace fake_server { diff --git a/sync/test/fake_server/entity_builder_factory.h b/sync/test/fake_server/entity_builder_factory.h index 07d7a57..ff86cda 100644 --- a/sync/test/fake_server/entity_builder_factory.h +++ b/sync/test/fake_server/entity_builder_factory.h @@ -5,6 +5,8 @@ #ifndef SYNC_TEST_FAKE_SERVER_ENTITY_BUILDER_FACTORY_H_ #define SYNC_TEST_FAKE_SERVER_ENTITY_BUILDER_FACTORY_H_ +#include <stdint.h> + #include <string> #include "sync/test/fake_server/bookmark_entity_builder.h" @@ -34,7 +36,7 @@ class EntityBuilderFactory { std::string cache_guid_; // The latest client item id assigned to an entity. - int64 latest_client_item_id_; + int64_t latest_client_item_id_; }; } // namespace fake_server diff --git a/sync/test/fake_server/fake_server.cc b/sync/test/fake_server/fake_server.cc index d5e39af..a721682 100644 --- a/sync/test/fake_server/fake_server.cc +++ b/sync/test/fake_server/fake_server.cc @@ -4,6 +4,8 @@ #include "sync/test/fake_server/fake_server.h" +#include <stdint.h> + #include <algorithm> #include <limits> #include <set> @@ -11,7 +13,6 @@ #include <utility> #include <vector> -#include "base/basictypes.h" #include "base/guid.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" @@ -73,7 +74,7 @@ class UpdateSieve { // markers from the original GetUpdatesMessage and |new_version| (the latest // version in the entries sent back). void UpdateProgressMarkers( - int64 new_version, + int64_t new_version, sync_pb::GetUpdatesResponse* get_updates_response) const { ModelTypeToVersionMap::const_iterator it; for (it = request_from_version_.begin(); it != request_from_version_.end(); @@ -83,7 +84,7 @@ class UpdateSieve { new_marker->set_data_type_id( GetSpecificsFieldNumberFromModelType(it->first)); - int64 version = std::max(new_version, it->second); + int64_t version = std::max(new_version, it->second); new_marker->set_token(base::Int64ToString(version)); } } @@ -91,7 +92,7 @@ class UpdateSieve { // Determines whether the server should send an |entity| to the client as // part of a GetUpdatesResponse. bool ClientWantsItem(const FakeServerEntity& entity) const { - int64 version = entity.GetVersion(); + int64_t version = entity.GetVersion(); if (version <= min_version_) { return false; } else if (entity.IsDeleted()) { @@ -105,18 +106,16 @@ class UpdateSieve { } // Returns the minimum version seen across all types. - int64 GetMinVersion() const { - return min_version_; - } + int64_t GetMinVersion() const { return min_version_; } private: - typedef std::map<ModelType, int64> ModelTypeToVersionMap; + typedef std::map<ModelType, int64_t> ModelTypeToVersionMap; // Creates an UpdateSieve. UpdateSieve(const ModelTypeToVersionMap request_from_version, - const int64 min_version) + const int64_t min_version) : request_from_version_(request_from_version), - min_version_(min_version) { } + min_version_(min_version) {} // Maps data type IDs to the latest version seen for that type. const ModelTypeToVersionMap request_from_version_; @@ -131,12 +130,12 @@ scoped_ptr<UpdateSieve> UpdateSieve::Create( << "A GetUpdates request must have at least one progress marker."; UpdateSieve::ModelTypeToVersionMap request_from_version; - int64 min_version = std::numeric_limits<int64>::max(); + int64_t min_version = std::numeric_limits<int64_t>::max(); for (int i = 0; i < get_updates_message.from_progress_marker_size(); i++) { sync_pb::DataTypeProgressMarker marker = get_updates_message.from_progress_marker(i); - int64 version = 0; + int64_t version = 0; // Let the version remain zero if there is no token or an empty token (the // first request for this type). if (marker.has_token() && !marker.token().empty()) { @@ -338,7 +337,7 @@ bool FakeServer::HandleGetUpdatesRequest( } bool send_encryption_keys_based_on_nigori = false; - int64 max_response_version = 0; + int64_t max_response_version = 0; for (EntityMap::const_iterator it = entities_.begin(); it != entities_.end(); ++it) { const FakeServerEntity& entity = *it->second; diff --git a/sync/test/fake_server/fake_server.h b/sync/test/fake_server/fake_server.h index 87bc2a4..21fb963 100644 --- a/sync/test/fake_server/fake_server.h +++ b/sync/test/fake_server/fake_server.h @@ -5,11 +5,12 @@ #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_H_ +#include <stdint.h> + #include <map> #include <string> #include <vector> -#include "base/basictypes.h" #include "base/callback.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" @@ -204,10 +205,10 @@ class FakeServer { // This is the last version number assigned to an entity. The next entity will // have a version number of version_ + 1. - int64 version_; + int64_t version_; // The current store birthday value. - int64 store_birthday_; + int64_t store_birthday_; // Whether the server should act as if incoming connections are properly // authenticated. diff --git a/sync/test/fake_server/fake_server_entity.cc b/sync/test/fake_server/fake_server_entity.cc index 28cb2ec..905bb74 100644 --- a/sync/test/fake_server/fake_server_entity.cc +++ b/sync/test/fake_server/fake_server_entity.cc @@ -4,11 +4,12 @@ #include "sync/test/fake_server/fake_server_entity.h" +#include <stdint.h> + #include <limits> #include <string> #include <vector> -#include "base/basictypes.h" #include "base/guid.h" #include "base/logging.h" #include "base/memory/ref_counted.h" @@ -46,11 +47,11 @@ ModelType FakeServerEntity::GetModelType() const { return model_type_; } -int64 FakeServerEntity::GetVersion() const { +int64_t FakeServerEntity::GetVersion() const { return version_; } -void FakeServerEntity::SetVersion(int64 version) { +void FakeServerEntity::SetVersion(int64_t version) { version_ = version; } @@ -111,12 +112,9 @@ ModelType FakeServerEntity::GetModelTypeFromId(const string& id) { FakeServerEntity::FakeServerEntity(const string& id, const ModelType& model_type, - int64 version, + int64_t version, const string& name) - : id_(id), - model_type_(model_type), - version_(version), - name_(name) {} + : id_(id), model_type_(model_type), version_(version), name_(name) {} void FakeServerEntity::SerializeBaseProtoFields( sync_pb::SyncEntity* sync_entity) const { diff --git a/sync/test/fake_server/fake_server_entity.h b/sync/test/fake_server/fake_server_entity.h index 0b197b7..be2da7d 100644 --- a/sync/test/fake_server/fake_server_entity.h +++ b/sync/test/fake_server/fake_server_entity.h @@ -5,10 +5,11 @@ #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ +#include <stdint.h> + #include <map> #include <string> -#include "base/basictypes.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" @@ -32,8 +33,8 @@ class FakeServerEntity { virtual ~FakeServerEntity(); const std::string& GetId() const; syncer::ModelType GetModelType() const; - int64 GetVersion() const; - void SetVersion(int64 version); + int64_t GetVersion() const; + void SetVersion(int64_t version); const std::string& GetName() const; void SetName(const std::string& name); @@ -56,7 +57,7 @@ class FakeServerEntity { FakeServerEntity(const std::string& id, const syncer::ModelType& model_type, - int64 version, + int64_t version, const std::string& name); void SerializeBaseProtoFields(sync_pb::SyncEntity* sync_entity) const; @@ -69,7 +70,7 @@ class FakeServerEntity { syncer::ModelType model_type_; // The version of this entity. - int64 version_; + int64_t version_; // The name of the entity. std::string name_; diff --git a/sync/test/fake_server/fake_server_http_post_provider.h b/sync/test/fake_server/fake_server_http_post_provider.h index b9f5e4d..9a8239d 100644 --- a/sync/test/fake_server/fake_server_http_post_provider.h +++ b/sync/test/fake_server/fake_server_http_post_provider.h @@ -8,6 +8,7 @@ #include <string> #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner.h" diff --git a/sync/test/fake_server/fake_server_verifier.cc b/sync/test/fake_server/fake_server_verifier.cc index 9d2e49c..0a598c9 100644 --- a/sync/test/fake_server/fake_server_verifier.cc +++ b/sync/test/fake_server/fake_server_verifier.cc @@ -4,6 +4,8 @@ #include "sync/test/fake_server/fake_server_verifier.h" +#include <stddef.h> + #include <map> #include <set> #include <vector> diff --git a/sync/test/fake_server/fake_server_verifier.h b/sync/test/fake_server/fake_server_verifier.h index 795f210..ecc4567 100644 --- a/sync/test/fake_server/fake_server_verifier.h +++ b/sync/test/fake_server/fake_server_verifier.h @@ -5,8 +5,11 @@ #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_VERIFIER_H_ #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_VERIFIER_H_ +#include <stddef.h> + #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" #include "sync/internal_api/public/base/model_type.h" diff --git a/sync/test/fake_server/permanent_entity.cc b/sync/test/fake_server/permanent_entity.cc index 648688e..ca88c5f 100644 --- a/sync/test/fake_server/permanent_entity.cc +++ b/sync/test/fake_server/permanent_entity.cc @@ -6,7 +6,6 @@ #include <string> -#include "base/basictypes.h" #include "base/logging.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" diff --git a/sync/test/fake_server/permanent_entity.h b/sync/test/fake_server/permanent_entity.h index 9776679..5a410ac 100644 --- a/sync/test/fake_server/permanent_entity.h +++ b/sync/test/fake_server/permanent_entity.h @@ -7,7 +7,6 @@ #include <string> -#include "base/basictypes.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" #include "sync/test/fake_server/fake_server_entity.h" diff --git a/sync/test/fake_server/tombstone_entity.cc b/sync/test/fake_server/tombstone_entity.cc index e62f1ec..195c15a 100644 --- a/sync/test/fake_server/tombstone_entity.cc +++ b/sync/test/fake_server/tombstone_entity.cc @@ -6,7 +6,6 @@ #include <string> -#include "base/basictypes.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" #include "sync/test/fake_server/fake_server_entity.h" diff --git a/sync/test/fake_server/tombstone_entity.h b/sync/test/fake_server/tombstone_entity.h index 02f2e12..b2d0c36 100644 --- a/sync/test/fake_server/tombstone_entity.h +++ b/sync/test/fake_server/tombstone_entity.h @@ -7,7 +7,6 @@ #include <string> -#include "base/basictypes.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" #include "sync/test/fake_server/fake_server_entity.h" diff --git a/sync/test/fake_server/unique_client_entity.cc b/sync/test/fake_server/unique_client_entity.cc index 201e947..fc9bdff 100644 --- a/sync/test/fake_server/unique_client_entity.cc +++ b/sync/test/fake_server/unique_client_entity.cc @@ -4,9 +4,10 @@ #include "sync/test/fake_server/unique_client_entity.h" +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/guid.h" #include "base/memory/scoped_ptr.h" #include "sync/internal_api/public/base/model_type.h" @@ -27,22 +28,22 @@ namespace { // A version must be passed when creating a FakeServerEntity, but this value // is overrideen immediately when saving the entity in FakeServer. -const int64 kUnusedVersion = 0L; +const int64_t kUnusedVersion = 0L; // Default time (creation and last modified) used when creating entities. -const int64 kDefaultTime = 1234L; +const int64_t kDefaultTime = 1234L; } // namespace UniqueClientEntity::UniqueClientEntity( const string& id, ModelType model_type, - int64 version, + int64_t version, const string& name, const string& client_defined_unique_tag, const sync_pb::EntitySpecifics& specifics, - int64 creation_time, - int64 last_modified_time) + int64_t creation_time, + int64_t last_modified_time) : FakeServerEntity(id, model_type, version, name), client_defined_unique_tag_(client_defined_unique_tag), creation_time_(creation_time), diff --git a/sync/test/fake_server/unique_client_entity.h b/sync/test/fake_server/unique_client_entity.h index 0a5a855..a450eeb 100644 --- a/sync/test/fake_server/unique_client_entity.h +++ b/sync/test/fake_server/unique_client_entity.h @@ -5,9 +5,10 @@ #ifndef SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ #define SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/test/fake_server/fake_server_entity.h" @@ -28,12 +29,12 @@ class UniqueClientEntity : public FakeServerEntity { public: UniqueClientEntity(const std::string& id, syncer::ModelType model_type, - int64 version, + int64_t version, const std::string& name, const std::string& client_defined_unique_tag, const sync_pb::EntitySpecifics& specifics, - int64 creation_time, - int64 last_modified_time); + int64_t creation_time, + int64_t last_modified_time); ~UniqueClientEntity() override; @@ -59,8 +60,8 @@ class UniqueClientEntity : public FakeServerEntity { private: // These member values have equivalent fields in SyncEntity. std::string client_defined_unique_tag_; - int64 creation_time_; - int64 last_modified_time_; + int64_t creation_time_; + int64_t last_modified_time_; }; } // namespace fake_server diff --git a/sync/test/local_sync_test_server.cc b/sync/test/local_sync_test_server.cc index e5f0a38..77355558 100644 --- a/sync/test/local_sync_test_server.cc +++ b/sync/test/local_sync_test_server.cc @@ -4,6 +4,8 @@ #include "sync/test/local_sync_test_server.h" +#include <stdint.h> + #include <string> #include "base/command_line.h" @@ -22,11 +24,11 @@ LocalSyncTestServer::LocalSyncTestServer() base::FilePath()), xmpp_port_(0) {} -LocalSyncTestServer::LocalSyncTestServer(uint16 port, uint16 xmpp_port) +LocalSyncTestServer::LocalSyncTestServer(uint16_t port, uint16_t xmpp_port) : LocalTestServer( - net::SpawnedTestServer::TYPE_HTTP, // Sync uses the HTTP scheme. - net::SpawnedTestServer::kLocalhost, - base::FilePath()), + net::SpawnedTestServer::TYPE_HTTP, // Sync uses the HTTP scheme. + net::SpawnedTestServer::kLocalhost, + base::FilePath()), xmpp_port_(xmpp_port) { SetPort(port); } diff --git a/sync/test/local_sync_test_server.h b/sync/test/local_sync_test_server.h index 4c3c01f..95943be 100644 --- a/sync/test/local_sync_test_server.h +++ b/sync/test/local_sync_test_server.h @@ -5,8 +5,10 @@ #ifndef SYNC_TEST_LOCAL_SYNC_TEST_SERVER_H_ #define SYNC_TEST_LOCAL_SYNC_TEST_SERVER_H_ -#include "base/basictypes.h" +#include <stdint.h> + #include "base/compiler_specific.h" +#include "base/macros.h" #include "net/test/spawned_test_server/local_test_server.h" namespace syncer { @@ -21,7 +23,7 @@ class LocalSyncTestServer : public net::LocalTestServer { // Initialize a sync server that listens on |port| for sync updates and // |xmpp_port| for p2p notifications. - LocalSyncTestServer(uint16 port, uint16 xmpp_port); + LocalSyncTestServer(uint16_t port, uint16_t xmpp_port); ~LocalSyncTestServer() override; @@ -37,7 +39,7 @@ class LocalSyncTestServer : public net::LocalTestServer { private: // Port on which the Sync XMPP server listens. - uint16 xmpp_port_; + uint16_t xmpp_port_; DISALLOW_COPY_AND_ASSIGN(LocalSyncTestServer); }; diff --git a/sync/test/mock_invalidation.cc b/sync/test/mock_invalidation.cc index bfcb3c3..5a27909 100644 --- a/sync/test/mock_invalidation.cc +++ b/sync/test/mock_invalidation.cc @@ -4,6 +4,8 @@ #include "sync/test/mock_invalidation.h" +#include <stdint.h> + #include "base/logging.h" #include "sync/test/mock_invalidation_tracker.h" @@ -15,7 +17,7 @@ scoped_ptr<MockInvalidation> MockInvalidation::BuildUnknownVersion() { } scoped_ptr<MockInvalidation> MockInvalidation::Build( - int64 version, + int64_t version, const std::string& payload) { return scoped_ptr<MockInvalidation>( new MockInvalidation(false, version, payload)); @@ -33,7 +35,7 @@ const std::string& MockInvalidation::GetPayload() const { return payload_; } -int64 MockInvalidation::GetVersion() const { +int64_t MockInvalidation::GetVersion() const { DCHECK(!is_unknown_version_); return version_; } @@ -47,11 +49,10 @@ void MockInvalidation::Drop() { } MockInvalidation::MockInvalidation(bool is_unknown_version, - int64 version, + int64_t version, const std::string& payload) : is_unknown_version_(is_unknown_version), version_(version), - payload_(payload) { -} + payload_(payload) {} } // namespace syncer diff --git a/sync/test/mock_invalidation.h b/sync/test/mock_invalidation.h index 2aea01b..4b1bba4 100644 --- a/sync/test/mock_invalidation.h +++ b/sync/test/mock_invalidation.h @@ -5,6 +5,8 @@ #ifndef SYNC_TEST_MOCK_INVALIDATION_H_ #define SYNC_TEST_MOCK_INVALIDATION_H_ +#include <stdint.h> + #include <string> #include "base/memory/scoped_ptr.h" @@ -18,7 +20,7 @@ class MockInvalidation : public InvalidationInterface { public: // Helpers to build new MockInvalidations. static scoped_ptr<MockInvalidation> BuildUnknownVersion(); - static scoped_ptr<MockInvalidation> Build(int64 version, + static scoped_ptr<MockInvalidation> Build(int64_t version, const std::string& payload); ~MockInvalidation() override; @@ -26,20 +28,20 @@ class MockInvalidation : public InvalidationInterface { // Implementation of InvalidationInterface. bool IsUnknownVersion() const override; const std::string& GetPayload() const override; - int64 GetVersion() const override; + int64_t GetVersion() const override; void Acknowledge() override; void Drop() override; protected: MockInvalidation(bool is_unknown_version, - int64 version, + int64_t version, const std::string& payload); // Whether or not this is an 'unknown version' invalidation. const bool is_unknown_version_; // The version of this invalidation. Valid only if !is_unknown_version_. - const int64 version_; + const int64_t version_; // The payload of this invalidation. Valid only if !is_unknown_version_. const std::string payload_; diff --git a/sync/test/mock_invalidation_tracker.cc b/sync/test/mock_invalidation_tracker.cc index 6e816a6..3c3a498 100644 --- a/sync/test/mock_invalidation_tracker.cc +++ b/sync/test/mock_invalidation_tracker.cc @@ -4,6 +4,8 @@ #include "sync/test/mock_invalidation_tracker.h" +#include <stdint.h> + #include "base/logging.h" #include "sync/test/trackable_mock_invalidation.h" @@ -16,7 +18,7 @@ MockInvalidationTracker::IssueUnknownVersionInvalidation() { } scoped_ptr<TrackableMockInvalidation> -MockInvalidationTracker::IssueInvalidation(int64 version, +MockInvalidationTracker::IssueInvalidation(int64_t version, const std::string& payload) { return scoped_ptr<TrackableMockInvalidation>( new TrackableMockInvalidation(false, version, payload, this, next_id_++)); diff --git a/sync/test/mock_invalidation_tracker.h b/sync/test/mock_invalidation_tracker.h index ee1f740..7a15522 100644 --- a/sync/test/mock_invalidation_tracker.h +++ b/sync/test/mock_invalidation_tracker.h @@ -5,6 +5,8 @@ #ifndef SYNC_TEST_MOCK_INVALIDATION_TRACKER_H_ #define SYNC_TEST_MOCK_INVALIDATION_TRACKER_H_ +#include <stdint.h> + #include <set> #include <string> @@ -21,7 +23,7 @@ class MockInvalidationTracker { // object. scoped_ptr<TrackableMockInvalidation> IssueUnknownVersionInvalidation(); scoped_ptr<TrackableMockInvalidation> IssueInvalidation( - int64 version, + int64_t version, const std::string& payload); MockInvalidationTracker(); diff --git a/sync/test/null_directory_change_delegate.cc b/sync/test/null_directory_change_delegate.cc index 5e2a93d..e9793ef 100644 --- a/sync/test/null_directory_change_delegate.cc +++ b/sync/test/null_directory_change_delegate.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + #include "sync/test/null_directory_change_delegate.h" namespace syncer { @@ -12,7 +14,7 @@ NullDirectoryChangeDelegate::~NullDirectoryChangeDelegate() {} void NullDirectoryChangeDelegate::HandleCalculateChangesChangeEventFromSyncApi( const ImmutableWriteTransactionInfo& write_transaction_info, BaseTransaction* trans, - std::vector<int64>* entries_changed) { + std::vector<int64_t>* entries_changed) { for (EntryKernelMutationMap::const_iterator it = write_transaction_info.Get().mutations.Get().begin(); it != write_transaction_info.Get().mutations.Get().end(); ++it) { @@ -23,7 +25,7 @@ void NullDirectoryChangeDelegate::HandleCalculateChangesChangeEventFromSyncApi( void NullDirectoryChangeDelegate::HandleCalculateChangesChangeEventFromSyncer( const ImmutableWriteTransactionInfo& write_transaction_info, BaseTransaction* trans, - std::vector<int64>* entries_changed) { + std::vector<int64_t>* entries_changed) { for (EntryKernelMutationMap::const_iterator it = write_transaction_info.Get().mutations.Get().begin(); it != write_transaction_info.Get().mutations.Get().end(); ++it) { diff --git a/sync/test/null_directory_change_delegate.h b/sync/test/null_directory_change_delegate.h index 4c52f3c..4a2799e 100644 --- a/sync/test/null_directory_change_delegate.h +++ b/sync/test/null_directory_change_delegate.h @@ -5,6 +5,8 @@ #ifndef SYNC_TEST_NULL_DIRECTORY_CHANGE_DELEGATE_H_ #define SYNC_TEST_NULL_DIRECTORY_CHANGE_DELEGATE_H_ +#include <stdint.h> + #include <vector> #include "base/compiler_specific.h" @@ -21,11 +23,11 @@ class NullDirectoryChangeDelegate : public DirectoryChangeDelegate { void HandleCalculateChangesChangeEventFromSyncApi( const ImmutableWriteTransactionInfo& write_transaction_info, BaseTransaction* trans, - std::vector<int64>* entries_changed) override; + std::vector<int64_t>* entries_changed) override; void HandleCalculateChangesChangeEventFromSyncer( const ImmutableWriteTransactionInfo& write_transaction_info, BaseTransaction* trans, - std::vector<int64>* entries_changed) override; + std::vector<int64_t>* entries_changed) override; ModelTypeSet HandleTransactionEndingChangeEvent( const ImmutableWriteTransactionInfo& write_transaction_info, BaseTransaction* trans) override; diff --git a/sync/test/sessions/mock_debug_info_getter.h b/sync/test/sessions/mock_debug_info_getter.h index 85cb6f9..8672ca9 100644 --- a/sync/test/sessions/mock_debug_info_getter.h +++ b/sync/test/sessions/mock_debug_info_getter.h @@ -5,8 +5,8 @@ #ifndef SYNC_TEST_SESSIONS_MOCK_DEBUG_INFO_GETTER_H_ #define SYNC_TEST_SESSIONS_MOCK_DEBUG_INFO_GETTER_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/base/sync_export.h" #include "sync/protocol/sync.pb.h" #include "sync/sessions/debug_info_getter.h" diff --git a/sync/test/sessions/test_scoped_session_event_listener.h b/sync/test/sessions/test_scoped_session_event_listener.h index d2f68b8..3599e74 100644 --- a/sync/test/sessions/test_scoped_session_event_listener.h +++ b/sync/test/sessions/test_scoped_session_event_listener.h @@ -5,6 +5,7 @@ #ifndef SYNC_TEST_SESSIONS_TEST_SCOPED_SESSION_EVENT_LISTENER_H_ #define SYNC_TEST_SESSIONS_TEST_SCOPED_SESSION_EVENT_LISTENER_H_ +#include "base/macros.h" #include "sync/sessions/sync_session_context.h" namespace syncer { diff --git a/sync/test/test_directory_backing_store.cc b/sync/test/test_directory_backing_store.cc index f382cc5..d845252 100644 --- a/sync/test/test_directory_backing_store.cc +++ b/sync/test/test_directory_backing_store.cc @@ -4,7 +4,6 @@ #include "sync/test/test_directory_backing_store.h" -#include "base/basictypes.h" #include "base/logging.h" namespace syncer { diff --git a/sync/test/trackable_mock_invalidation.cc b/sync/test/trackable_mock_invalidation.cc index 0f00814..55b4896 100644 --- a/sync/test/trackable_mock_invalidation.cc +++ b/sync/test/trackable_mock_invalidation.cc @@ -4,20 +4,21 @@ #include "sync/test/trackable_mock_invalidation.h" +#include <stdint.h> + #include "sync/test/mock_invalidation_tracker.h" namespace syncer { TrackableMockInvalidation::TrackableMockInvalidation( bool is_unknown_version, - int64 version, + int64_t version, const std::string& payload, MockInvalidationTracker* tracker, int tracking_id) : MockInvalidation(is_unknown_version, version, payload), tracker_(tracker), - tracking_id_(tracking_id) { -} + tracking_id_(tracking_id) {} TrackableMockInvalidation::~TrackableMockInvalidation() { } diff --git a/sync/test/trackable_mock_invalidation.h b/sync/test/trackable_mock_invalidation.h index 83208898..3a72af34 100644 --- a/sync/test/trackable_mock_invalidation.h +++ b/sync/test/trackable_mock_invalidation.h @@ -5,6 +5,8 @@ #ifndef SYNC_TEST_TRACKABLE_MOCK_INVALIDATION_H_ #define SYNC_TEST_TRACKABLE_MOCK_INVALIDATION_H_ +#include <stdint.h> + #include <string> #include "sync/test/mock_invalidation.h" @@ -20,7 +22,7 @@ class MockInvalidationTracker; class TrackableMockInvalidation : public MockInvalidation { public: TrackableMockInvalidation(bool is_unknown_version, - int64 version, + int64_t version, const std::string& payload, MockInvalidationTracker* tracker, int tracking_id); diff --git a/sync/tools/sync_client.cc b/sync/tools/sync_client.cc index dbb1421..1c60222 100644 --- a/sync/tools/sync_client.cc +++ b/sync/tools/sync_client.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + #include <cstddef> #include <cstdio> #include <string> @@ -20,6 +22,7 @@ #include "base/rand_util.h" #include "base/task_runner.h" #include "base/threading/thread.h" +#include "build/build_config.h" #include "components/invalidation/impl/non_blocking_invalidator.h" #include "components/invalidation/public/object_id_invalidation_map.h" #include "components/sync_driver/invalidation_helper.h" @@ -131,7 +134,7 @@ class LoggingChangeDelegate : public SyncManager::ChangeDelegate { ~LoggingChangeDelegate() override {} void OnChangesApplied(ModelType model_type, - int64 model_version, + int64_t model_version, const BaseTransaction* trans, const ImmutableChangeRecordList& changes) override { LOG(INFO) << "Changes applied for " @@ -200,7 +203,7 @@ class InvalidationAdapter : public syncer::InvalidationInterface { return invalidation_.payload(); } - int64 GetVersion() const override { return invalidation_.version(); } + int64_t GetVersion() const override { return invalidation_.version(); } void Acknowledge() override { invalidation_.Acknowledge(); } diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc index 5c8db57..3e896f1 100644 --- a/sync/tools/sync_listen_notifications.cc +++ b/sync/tools/sync_listen_notifications.cc @@ -10,11 +10,13 @@ #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/logging.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/rand_util.h" #include "base/threading/thread.h" +#include "build/build_config.h" #include "components/invalidation/impl/invalidation_state_tracker.h" #include "components/invalidation/impl/invalidator.h" #include "components/invalidation/impl/non_blocking_invalidator.h" diff --git a/sync/tools/testserver/run_sync_testserver.cc b/sync/tools/testserver/run_sync_testserver.cc index 414076a..2057db2 100644 --- a/sync/tools/testserver/run_sync_testserver.cc +++ b/sync/tools/testserver/run_sync_testserver.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> #include <stdio.h> #include "base/at_exit.h" @@ -54,7 +55,7 @@ static bool RunSyncTest( // Gets a port value from the switch with name |switch_name| and writes it to // |port|. Returns true if a port was provided and false otherwise. -static bool GetPortFromSwitch(const std::string& switch_name, uint16* port) { +static bool GetPortFromSwitch(const std::string& switch_name, uint16_t* port) { DCHECK(port != NULL) << "|port| is NULL"; base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); int port_int = 0; @@ -64,7 +65,7 @@ static bool GetPortFromSwitch(const std::string& switch_name, uint16* port) { return false; } } - *port = static_cast<uint16>(port_int); + *port = static_cast<uint16_t>(port_int); return true; } @@ -99,10 +100,10 @@ int main(int argc, const char* argv[]) { return RunSyncTest(FILE_PATH_LITERAL("xmppserver_test.py")) ? 0 : -1; } - uint16 port = 0; + uint16_t port = 0; GetPortFromSwitch("port", &port); - uint16 xmpp_port = 0; + uint16_t xmpp_port = 0; GetPortFromSwitch("xmpp-port", &xmpp_port); scoped_ptr<syncer::LocalSyncTestServer> test_server( diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc index 0fe0b25..7f5990d 100644 --- a/sync/util/cryptographer.cc +++ b/sync/util/cryptographer.cc @@ -4,10 +4,11 @@ #include "sync/util/cryptographer.h" +#include <stddef.h> + #include <algorithm> #include "base/base64.h" -#include "base/basictypes.h" #include "base/logging.h" #include "sync/protocol/nigori_specifics.pb.h" #include "sync/util/encryptor.h" diff --git a/sync/util/cryptographer.h b/sync/util/cryptographer.h index 2366409..bbcac02 100644 --- a/sync/util/cryptographer.h +++ b/sync/util/cryptographer.h @@ -8,6 +8,7 @@ #include <map> #include <string> +#include "base/macros.h" #include "base/memory/linked_ptr.h" #include "base/memory/scoped_ptr.h" #include "sync/base/sync_export.h" diff --git a/sync/util/extensions_activity.h b/sync/util/extensions_activity.h index 8178760..a6e4bc7 100644 --- a/sync/util/extensions_activity.h +++ b/sync/util/extensions_activity.h @@ -5,10 +5,11 @@ #ifndef SYNC_UTIL_EXTENSIONS_ACTIVITY_H_ #define SYNC_UTIL_EXTENSIONS_ACTIVITY_H_ +#include <stdint.h> + #include <map> #include <string> -#include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" #include "sync/base/sync_export.h" @@ -32,7 +33,7 @@ class SYNC_EXPORT ExtensionsActivity // How many times the extension successfully invoked a write // operation through the bookmarks API since the last CommitMessage. - uint32 bookmark_write_count; + uint32_t bookmark_write_count; }; typedef std::map<std::string, Record> Records; diff --git a/sync/util/get_session_name.cc b/sync/util/get_session_name.cc index 5d02553..1d4ba42 100644 --- a/sync/util/get_session_name.cc +++ b/sync/util/get_session_name.cc @@ -11,6 +11,7 @@ #include "base/strings/string_util.h" #include "base/sys_info.h" #include "base/task_runner.h" +#include "build/build_config.h" #if defined(OS_CHROMEOS) #include "chromeos/system/devicetype.h" diff --git a/sync/util/get_session_name_mac.mm b/sync/util/get_session_name_mac.mm index ddd2c3c..00c2a75 100644 --- a/sync/util/get_session_name_mac.mm +++ b/sync/util/get_session_name_mac.mm @@ -4,6 +4,7 @@ #include "sync/util/get_session_name_mac.h" +#include <stddef.h> #include <sys/sysctl.h> #import <SystemConfiguration/SCDynamicStoreCopySpecific.h> diff --git a/sync/util/get_session_name_unittest.cc b/sync/util/get_session_name_unittest.cc index 8aff5e0..95ae1f9 100644 --- a/sync/util/get_session_name_unittest.cc +++ b/sync/util/get_session_name_unittest.cc @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "base/sys_info.h" +#include "build/build_config.h" #include "sync/util/get_session_name.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/sync/util/nigori.cc b/sync/util/nigori.cc index 225e074..002f718 100644 --- a/sync/util/nigori.cc +++ b/sync/util/nigori.cc @@ -4,6 +4,8 @@ #include "sync/util/nigori.h" +#include <stdint.h> + #include <sstream> #include <vector> @@ -30,9 +32,9 @@ class NigoriStream { // Append the big-endian representation of the length of |value| with 32 bits, // followed by |value| itself to the stream. NigoriStream& operator<<(const std::string& value) { - uint32 size = base::HostToNet32(value.size()); + uint32_t size = base::HostToNet32(value.size()); - stream_.write(reinterpret_cast<char*>(&size), sizeof(uint32)); + stream_.write(reinterpret_cast<char*>(&size), sizeof(uint32_t)); stream_ << value; return *this; } @@ -41,10 +43,10 @@ class NigoriStream { // followed by the big-endian representation of the value of |type|, with 32 // bits, to the stream. NigoriStream& operator<<(const Nigori::Type type) { - uint32 size = base::HostToNet32(sizeof(uint32)); - stream_.write(reinterpret_cast<char*>(&size), sizeof(uint32)); - uint32 value = base::HostToNet32(type); - stream_.write(reinterpret_cast<char*>(&value), sizeof(uint32)); + uint32_t size = base::HostToNet32(sizeof(uint32_t)); + stream_.write(reinterpret_cast<char*>(&size), sizeof(uint32_t)); + uint32_t value = base::HostToNet32(type); + stream_.write(reinterpret_cast<char*>(&value), sizeof(uint32_t)); return *this; } diff --git a/sync/util/nigori.h b/sync/util/nigori.h index 40e9692..2076977 100644 --- a/sync/util/nigori.h +++ b/sync/util/nigori.h @@ -5,6 +5,8 @@ #ifndef SYNC_UTIL_NIGORI_H_ #define SYNC_UTIL_NIGORI_H_ +#include <stddef.h> + #include <string> #include "base/memory/scoped_ptr.h" diff --git a/sync/util/time.cc b/sync/util/time.cc index 5f878a2..5f376d7 100644 --- a/sync/util/time.cc +++ b/sync/util/time.cc @@ -4,16 +4,18 @@ #include "sync/util/time.h" +#include <stdint.h> + #include "base/i18n/time_formatting.h" #include "base/strings/utf_string_conversions.h" namespace syncer { -int64 TimeToProtoTime(const base::Time& t) { +int64_t TimeToProtoTime(const base::Time& t) { return (t - base::Time::UnixEpoch()).InMilliseconds(); } -base::Time ProtoTimeToTime(int64 proto_t) { +base::Time ProtoTimeToTime(int64_t proto_t) { return base::Time::UnixEpoch() + base::TimeDelta::FromMilliseconds(proto_t); } diff --git a/sync/util/time.h b/sync/util/time.h index f9b0cbc..b8f32a4 100644 --- a/sync/util/time.h +++ b/sync/util/time.h @@ -7,9 +7,10 @@ #ifndef SYNC_UTIL_TIME_H_ #define SYNC_UTIL_TIME_H_ +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/time/time.h" #include "sync/base/sync_export.h" @@ -17,10 +18,10 @@ namespace syncer { // Converts a time object to the format used in sync protobufs (ms // since the Unix epoch). -SYNC_EXPORT int64 TimeToProtoTime(const base::Time& t); +SYNC_EXPORT int64_t TimeToProtoTime(const base::Time& t); // Converts a time field from sync protobufs to a time object. -SYNC_EXPORT base::Time ProtoTimeToTime(int64 proto_t); +SYNC_EXPORT base::Time ProtoTimeToTime(int64_t proto_t); SYNC_EXPORT std::string GetTimeDebugString(const base::Time& t); |