| Index: google_apis/gcm/engine/gcm_store_impl.cc
|
| diff --git a/google_apis/gcm/engine/gcm_store_impl.cc b/google_apis/gcm/engine/gcm_store_impl.cc
|
| index 3ad9b99ed908d8179aa4b6454cc27e070b53ce4f..e3127b95977d1a81c5ab665ced345650ef3111f1 100644
|
| --- a/google_apis/gcm/engine/gcm_store_impl.cc
|
| +++ b/google_apis/gcm/engine/gcm_store_impl.cc
|
| @@ -4,12 +4,12 @@
|
|
|
| #include "google_apis/gcm/engine/gcm_store_impl.h"
|
|
|
| -#include "base/basictypes.h"
|
| #include "base/bind.h"
|
| #include "base/callback.h"
|
| #include "base/files/file_path.h"
|
| #include "base/files/file_util.h"
|
| #include "base/logging.h"
|
| +#include "base/macros.h"
|
| #include "base/metrics/histogram_macros.h"
|
| #include "base/profiler/scoped_tracker.h"
|
| #include "base/sequenced_task_runner.h"
|
| @@ -189,8 +189,8 @@ class GCMStoreImpl::Backend
|
| void Load(StoreOpenMode open_mode, const LoadCallback& callback);
|
| void Close();
|
| void Destroy(const UpdateCallback& callback);
|
| - void SetDeviceCredentials(uint64 device_android_id,
|
| - uint64 device_security_token,
|
| + void SetDeviceCredentials(uint64_t device_android_id,
|
| + uint64_t device_security_token,
|
| const UpdateCallback& callback);
|
| void AddRegistration(const std::string& serialized_key,
|
| const std::string& serialized_value,
|
| @@ -209,7 +209,7 @@ class GCMStoreImpl::Backend
|
| const base::Callback<void(bool, const AppIdToMessageCountMap&)>
|
| callback);
|
| void AddUserSerialNumber(const std::string& username,
|
| - int64 serial_number,
|
| + int64_t serial_number,
|
| const UpdateCallback& callback);
|
| void RemoveUserSerialNumber(const std::string& username,
|
| const UpdateCallback& callback);
|
| @@ -245,7 +245,7 @@ class GCMStoreImpl::Backend
|
| ~Backend();
|
|
|
| LoadStatus OpenStoreAndLoadData(StoreOpenMode open_mode, LoadResult* result);
|
| - bool LoadDeviceCredentials(uint64* android_id, uint64* security_token);
|
| + bool LoadDeviceCredentials(uint64_t* android_id, uint64_t* security_token);
|
| bool LoadRegistrations(std::map<std::string, std::string>* registrations);
|
| bool LoadIncomingMessages(std::vector<std::string>* incoming_messages);
|
| bool LoadOutgoingMessages(OutgoingMessageMap* outgoing_messages);
|
| @@ -366,7 +366,7 @@ void GCMStoreImpl::Backend::Load(StoreOpenMode open_mode,
|
|
|
| // Only record histograms if GCM had already been set up for this device.
|
| if (result->device_android_id != 0 && result->device_security_token != 0) {
|
| - int64 file_size = 0;
|
| + int64_t file_size = 0;
|
| if (base::GetFileSize(path_, &file_size)) {
|
| UMA_HISTOGRAM_COUNTS("GCM.StoreSizeKB",
|
| static_cast<int>(file_size / 1024));
|
| @@ -418,8 +418,8 @@ void GCMStoreImpl::Backend::Destroy(const UpdateCallback& callback) {
|
| }
|
|
|
| void GCMStoreImpl::Backend::SetDeviceCredentials(
|
| - uint64 device_android_id,
|
| - uint64 device_security_token,
|
| + uint64_t device_android_id,
|
| + uint64_t device_security_token,
|
| const UpdateCallback& callback) {
|
| DVLOG(1) << "Saving device credentials with AID " << device_android_id;
|
| if (!db_.get()) {
|
| @@ -636,7 +636,7 @@ void GCMStoreImpl::Backend::SetLastCheckinInfo(
|
| const UpdateCallback& callback) {
|
| leveldb::WriteBatch write_batch;
|
|
|
| - int64 last_checkin_time_internal = time.ToInternalValue();
|
| + int64_t last_checkin_time_internal = time.ToInternalValue();
|
| write_batch.Put(MakeSlice(kLastCheckinTimeKey),
|
| MakeSlice(base::Int64ToString(last_checkin_time_internal)));
|
|
|
| @@ -899,8 +899,8 @@ void GCMStoreImpl::Backend::SetValue(const std::string& key,
|
| foreground_task_runner_->PostTask(FROM_HERE, base::Bind(callback, s.ok()));
|
| }
|
|
|
| -bool GCMStoreImpl::Backend::LoadDeviceCredentials(uint64* android_id,
|
| - uint64* security_token) {
|
| +bool GCMStoreImpl::Backend::LoadDeviceCredentials(uint64_t* android_id,
|
| + uint64_t* security_token) {
|
| leveldb::ReadOptions read_options;
|
| read_options.verify_checksums = true;
|
|
|
| @@ -991,7 +991,7 @@ bool GCMStoreImpl::Backend::LoadOutgoingMessages(
|
| LOG(ERROR) << "Error reading incoming message with key " << s.ToString();
|
| return false;
|
| }
|
| - uint8 tag = iter->value().data()[0];
|
| + uint8_t tag = iter->value().data()[0];
|
| std::string id = ParseOutgoingKey(iter->key().ToString());
|
| scoped_ptr<google::protobuf::MessageLite> message(
|
| BuildProtobufFromTag(tag));
|
| @@ -1019,7 +1019,7 @@ bool GCMStoreImpl::Backend::LoadLastCheckinInfo(
|
| leveldb::Status s = db_->Get(read_options,
|
| MakeSlice(kLastCheckinTimeKey),
|
| &result);
|
| - int64 time_internal = 0LL;
|
| + int64_t time_internal = 0LL;
|
| if (s.ok() && !base::StringToInt64(result, &time_internal)) {
|
| LOG(ERROR) << "Failed to restore last checkin time. Using default = 0.";
|
| time_internal = 0LL;
|
| @@ -1100,7 +1100,7 @@ bool GCMStoreImpl::Backend::LoadLastTokenFetchTime(
|
| std::string result;
|
| leveldb::Status s =
|
| db_->Get(read_options, MakeSlice(kLastTokenFetchTimeKey), &result);
|
| - int64 time_internal = 0LL;
|
| + int64_t time_internal = 0LL;
|
| if (s.ok() && !base::StringToInt64(result, &time_internal)) {
|
| LOG(ERROR) <<
|
| "Failed to restore last token fetching time. Using default = 0.";
|
| @@ -1197,8 +1197,8 @@ void GCMStoreImpl::Destroy(const UpdateCallback& callback) {
|
| base::Bind(&GCMStoreImpl::Backend::Destroy, backend_, callback));
|
| }
|
|
|
| -void GCMStoreImpl::SetDeviceCredentials(uint64 device_android_id,
|
| - uint64 device_security_token,
|
| +void GCMStoreImpl::SetDeviceCredentials(uint64_t device_android_id,
|
| + uint64_t device_security_token,
|
| const UpdateCallback& callback) {
|
| blocking_task_runner_->PostTask(
|
| FROM_HERE,
|
|
|