summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
Diffstat (limited to 'sync')
-rw-r--r--sync/api/sync_data.cc2
-rw-r--r--sync/engine/syncer_unittest.cc16
-rw-r--r--sync/engine/syncer_util.cc2
-rw-r--r--sync/internal_api/public/base/model_type_invalidation_map_unittest.cc2
-rw-r--r--sync/internal_api/public/base/ordinal_unittest.cc2
-rw-r--r--sync/internal_api/public/base/unique_position.cc8
-rw-r--r--sync/internal_api/sync_encryption_handler_impl.cc6
-rw-r--r--sync/internal_api/sync_encryption_handler_impl_unittest.cc13
-rw-r--r--sync/internal_api/sync_manager_impl.cc2
-rw-r--r--sync/internal_api/sync_manager_impl_unittest.cc47
-rw-r--r--sync/internal_api/syncapi_server_connection_manager_unittest.cc2
-rw-r--r--sync/notifier/p2p_invalidator.cc22
-rw-r--r--sync/notifier/p2p_invalidator_unittest.cc14
-rw-r--r--sync/notifier/push_client_channel_unittest.cc2
-rw-r--r--sync/notifier/sync_invalidation_listener_unittest.cc2
-rw-r--r--sync/notifier/sync_system_resources.cc5
-rw-r--r--sync/notifier/sync_system_resources_unittest.cc5
-rw-r--r--sync/syncable/directory_backing_store.cc2
-rw-r--r--sync/syncable/model_type.cc2
-rw-r--r--sync/syncable/syncable_unittest.cc2
-rw-r--r--sync/syncable/syncable_write_transaction.cc2
-rw-r--r--sync/test/engine/mock_connection_manager.cc1
-rw-r--r--sync/util/cryptographer.cc16
23 files changed, 96 insertions, 81 deletions
diff --git a/sync/api/sync_data.cc b/sync/api/sync_data.cc
index b9e2ca9..e0b6f1a 100644
--- a/sync/api/sync_data.cc
+++ b/sync/api/sync_data.cc
@@ -59,7 +59,7 @@ SyncData SyncData::CreateLocalDelete(
ModelType datatype) {
sync_pb::EntitySpecifics specifics;
AddDefaultFieldValue(datatype, &specifics);
- return CreateLocalData(sync_tag, "", specifics);
+ return CreateLocalData(sync_tag, std::string(), specifics);
}
// Static.
diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc
index 5ee9e47..2dcc4b7 100644
--- a/sync/engine/syncer_unittest.cc
+++ b/sync/engine/syncer_unittest.cc
@@ -1641,15 +1641,15 @@ TEST_F(SyncerTest, TestCommitListOrderingAndNewParentAndChild) {
TEST_F(SyncerTest, UpdateWithZeroLengthName) {
// One illegal update
- mock_server_->AddUpdateDirectory(1, 0, "", 1, 10,
- foreign_cache_guid(), "-1");
+ mock_server_->AddUpdateDirectory(
+ 1, 0, std::string(), 1, 10, foreign_cache_guid(), "-1");
// And one legal one that we're going to delete.
mock_server_->AddUpdateDirectory(2, 0, "FOO", 1, 10,
foreign_cache_guid(), "-2");
SyncShareNudge();
// Delete the legal one. The new update has a null name.
- mock_server_->AddUpdateDirectory(2, 0, "", 2, 20,
- foreign_cache_guid(), "-2");
+ mock_server_->AddUpdateDirectory(
+ 2, 0, std::string(), 2, 20, foreign_cache_guid(), "-2");
mock_server_->SetLastUpdateDeleted();
SyncShareNudge();
}
@@ -4044,9 +4044,11 @@ TEST_F(SyncerTest, UniqueServerTagUpdates) {
}
// Now download some tagged items as updates.
- mock_server_->AddUpdateDirectory(1, 0, "update1", 1, 10, "", "");
+ mock_server_->AddUpdateDirectory(
+ 1, 0, "update1", 1, 10, std::string(), std::string());
mock_server_->SetLastUpdateServerTag("alpha");
- mock_server_->AddUpdateDirectory(2, 0, "update2", 2, 20, "", "");
+ mock_server_->AddUpdateDirectory(
+ 2, 0, "update2", 2, 20, std::string(), std::string());
mock_server_->SetLastUpdateServerTag("bob");
SyncShareNudge();
@@ -4252,7 +4254,7 @@ TEST_F(SyncerTest, GetKeyEmpty) {
EXPECT_TRUE(directory()->GetNigoriHandler()->NeedKeystoreKey(&rtrans));
}
- mock_server_->SetKeystoreKey("");
+ mock_server_->SetKeystoreKey(std::string());
SyncShareConfigure();
EXPECT_NE(session_->status_controller().last_get_key_result(), SYNCER_OK);
diff --git a/sync/engine/syncer_util.cc b/sync/engine/syncer_util.cc
index c571b10..d1bde98 100644
--- a/sync/engine/syncer_util.cc
+++ b/sync/engine/syncer_util.cc
@@ -633,7 +633,7 @@ VerifyResult VerifyUndelete(syncable::WriteTransaction* trans,
DCHECK(target->Get(UNIQUE_CLIENT_TAG).empty())
<< "Doing move-aside undeletion on client-tagged item.";
target->Put(ID, trans->directory()->NextId());
- target->Put(UNIQUE_CLIENT_TAG, "");
+ target->Put(UNIQUE_CLIENT_TAG, std::string());
target->Put(BASE_VERSION, CHANGES_VERSION);
target->Put(SERVER_VERSION, 0);
return VERIFY_SUCCESS;
diff --git a/sync/internal_api/public/base/model_type_invalidation_map_unittest.cc b/sync/internal_api/public/base/model_type_invalidation_map_unittest.cc
index f051479..772ee7e 100644
--- a/sync/internal_api/public/base/model_type_invalidation_map_unittest.cc
+++ b/sync/internal_api/public/base/model_type_invalidation_map_unittest.cc
@@ -35,7 +35,7 @@ TEST_F(ModelTypeInvalidationMapTest, TypeInvalidationMapToValue) {
scoped_ptr<DictionaryValue> value(ModelTypeInvalidationMapToValue(states));
EXPECT_EQ(2u, value->size());
ExpectDictStringValue(states[BOOKMARKS].payload, *value, "Bookmarks");
- ExpectDictStringValue("", *value, "Apps");
+ ExpectDictStringValue(std::string(), *value, "Apps");
EXPECT_FALSE(value->HasKey("Preferences"));
}
diff --git a/sync/internal_api/public/base/ordinal_unittest.cc b/sync/internal_api/public/base/ordinal_unittest.cc
index 20a6d19..8c77d6d 100644
--- a/sync/internal_api/public/base/ordinal_unittest.cc
+++ b/sync/internal_api/public/base/ordinal_unittest.cc
@@ -87,7 +87,7 @@ COMPILE_ASSERT(LargeOrdinal::kRadix == 256,
// IsValid() should return false for all of them.
TEST(Ordinal, Invalid) {
// Length criterion.
- EXPECT_FALSE(TestOrdinal("").IsValid());
+ EXPECT_FALSE(TestOrdinal(std::string()).IsValid());
EXPECT_FALSE(LongOrdinal("0001").IsValid());
const char kBeforeZero[] = { '0' - 1, '\0' };
diff --git a/sync/internal_api/public/base/unique_position.cc b/sync/internal_api/public/base/unique_position.cc
index a47d42b..b6c18ef 100644
--- a/sync/internal_api/public/base/unique_position.cc
+++ b/sync/internal_api/public/base/unique_position.cc
@@ -61,7 +61,7 @@ UniquePosition UniquePosition::FromInt64(
UniquePosition UniquePosition::InitialPosition(
const std::string& suffix) {
DCHECK(IsValidSuffix(suffix));
- return UniquePosition("", suffix);
+ return UniquePosition(std::string(), suffix);
}
// static.
@@ -175,7 +175,7 @@ std::string UniquePosition::FindSmallerWithSuffix(
if (suffix_zeroes > ref_zeroes) {
// Implies suffix < ref.
- return "";
+ return std::string();
}
if (suffix.substr(suffix_zeroes) < reference.substr(ref_zeroes)) {
@@ -210,7 +210,7 @@ std::string UniquePosition::FindGreaterWithSuffix(
if (suffix_FFs > ref_FFs) {
// Implies suffix > reference.
- return "";
+ return std::string();
}
if (suffix.substr(suffix_FFs) > reference.substr(ref_FFs)) {
@@ -244,7 +244,7 @@ std::string UniquePosition::FindBetweenWithSuffix(
// Sometimes our suffix puts us where we want to be.
if (before < suffix && suffix < after) {
- return "";
+ return std::string();
}
size_t i = 0;
diff --git a/sync/internal_api/sync_encryption_handler_impl.cc b/sync/internal_api/sync_encryption_handler_impl.cc
index 1a645bf..655feb2 100644
--- a/sync/internal_api/sync_encryption_handler_impl.cc
+++ b/sync/internal_api/sync_encryption_handler_impl.cc
@@ -136,7 +136,7 @@ std::string PackKeystoreBootstrapToken(
const std::string& current_keystore_key,
Encryptor* encryptor) {
if (current_keystore_key.empty())
- return "";
+ return std::string();
base::ListValue keystore_key_values;
for (size_t i = 0; i < old_keystore_keys.size(); ++i)
@@ -1112,7 +1112,7 @@ void SyncEncryptionHandlerImpl::SetCustomPassphrase(
if (passphrase_type_ != KEYSTORE_PASSPHRASE) {
DVLOG(1) << "Failing to set a custom passphrase because one has already "
<< "been set.";
- FinishSetPassphrase(false, "", trans, nigori_node);
+ FinishSetPassphrase(false, std::string(), trans, nigori_node);
return;
}
@@ -1125,7 +1125,7 @@ void SyncEncryptionHandlerImpl::SetCustomPassphrase(
// if statement above. For the sake of safety though, we check for it in
// case a client is misbehaving.
LOG(ERROR) << "Failing to set custom passphrase because of pending keys.";
- FinishSetPassphrase(false, "", trans, nigori_node);
+ FinishSetPassphrase(false, std::string(), trans, nigori_node);
return;
}
diff --git a/sync/internal_api/sync_encryption_handler_impl_unittest.cc b/sync/internal_api/sync_encryption_handler_impl_unittest.cc
index 8abbd7e..919a65d 100644
--- a/sync/internal_api/sync_encryption_handler_impl_unittest.cc
+++ b/sync/internal_api/sync_encryption_handler_impl_unittest.cc
@@ -91,7 +91,8 @@ class SyncEncryptionHandlerImplTest : public ::testing::Test {
encryption_handler_.reset(
new SyncEncryptionHandlerImpl(user_share(),
&encryptor_,
- "", "" /* bootstrap tokens */));
+ std::string(),
+ std::string() /* bootstrap tokens */));
encryption_handler_->AddObserver(&observer_);
}
@@ -347,7 +348,8 @@ TEST_F(SyncEncryptionHandlerImplTest, NigoriEncryptionTypes) {
StrictMock<SyncEncryptionHandlerObserverMock> observer2;
SyncEncryptionHandlerImpl handler2(user_share(),
&encryptor_,
- "", "" /* bootstrap tokens */);
+ std::string(),
+ std::string() /* bootstrap tokens */);
handler2.AddObserver(&observer2);
// Just set the sensitive types (shouldn't trigger any notifications).
@@ -611,9 +613,8 @@ TEST_F(SyncEncryptionHandlerImplTest, SetKeystoreMigratesAndUpdatesBootstrap) {
WriteTransaction trans(FROM_HERE, user_share());
EXPECT_FALSE(GetCryptographer()->is_initialized());
EXPECT_TRUE(encryption_handler()->NeedKeystoreKey(trans.GetWrappedTrans()));
- EXPECT_FALSE(
- encryption_handler()->SetKeystoreKeys(BuildEncryptionKeyProto(""),
- trans.GetWrappedTrans()));
+ EXPECT_FALSE(encryption_handler()->SetKeystoreKeys(
+ BuildEncryptionKeyProto(std::string()), trans.GetWrappedTrans()));
EXPECT_TRUE(encryption_handler()->NeedKeystoreKey(trans.GetWrappedTrans()));
}
Mock::VerifyAndClearExpectations(observer());
@@ -679,7 +680,7 @@ TEST_F(SyncEncryptionHandlerImplTest, SetKeystoreMigratesAndUpdatesBootstrap) {
// token.
SyncEncryptionHandlerImpl handler2(user_share(),
&encryptor_,
- "", // Cryptographer bootstrap.
+ std::string(), // Cryptographer bootstrap.
keystore_bootstrap);
{
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 97d03ba..7413b71 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -1289,7 +1289,7 @@ void SyncManagerImpl::OnIncomingInvalidation(
void SyncManagerImpl::RefreshTypes(ModelTypeSet types) {
DCHECK(thread_checker_.CalledOnValidThread());
const ModelTypeInvalidationMap& type_invalidation_map =
- ModelTypeSetToInvalidationMap(types, "");
+ ModelTypeSetToInvalidationMap(types, std::string());
if (type_invalidation_map.empty()) {
LOG(WARNING) << "Sync received refresh request with no types specified.";
} else {
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc
index 9a6ddee..7f96f49 100644
--- a/sync/internal_api/sync_manager_impl_unittest.cc
+++ b/sync/internal_api/sync_manager_impl_unittest.cc
@@ -723,7 +723,7 @@ class TestHttpPostProviderInterface : public HttpPostProviderInterface {
}
virtual const std::string GetResponseHeaderValue(
const std::string& name) const OVERRIDE {
- return "";
+ return std::string();
}
virtual void Abort() OVERRIDE {}
};
@@ -820,20 +820,25 @@ class SyncManagerTest : public testing::Test,
GetModelSafeRoutingInfo(&routing_info);
// Takes ownership of |fake_invalidator_|.
- sync_manager_.Init(temp_dir_.path(),
- WeakHandle<JsEventHandler>(),
- "bogus", 0, false,
- scoped_ptr<HttpPostProviderFactory>(
- new TestHttpPostProviderFactory()),
- workers, &extensions_activity_monitor_, this,
- credentials,
- scoped_ptr<Invalidator>(fake_invalidator_),
- "fake_invalidator_client_id",
- "", "", // bootstrap tokens
- scoped_ptr<InternalComponentsFactory>(GetFactory()),
- &encryptor_,
- &handler_,
- NULL);
+ sync_manager_.Init(
+ temp_dir_.path(),
+ WeakHandle<JsEventHandler>(),
+ "bogus",
+ 0,
+ false,
+ scoped_ptr<HttpPostProviderFactory>(new TestHttpPostProviderFactory()),
+ workers,
+ &extensions_activity_monitor_,
+ this,
+ credentials,
+ scoped_ptr<Invalidator>(fake_invalidator_),
+ "fake_invalidator_client_id",
+ std::string(),
+ std::string(), // bootstrap tokens
+ scoped_ptr<InternalComponentsFactory>(GetFactory()),
+ &encryptor_,
+ &handler_,
+ NULL);
sync_manager_.GetEncryptionHandler()->AddObserver(&encryption_observer_);
@@ -1181,9 +1186,9 @@ class SyncManagerGetNodesByIdTest : public SyncManagerTest {
base::ListValue args;
base::ListValue* ids = new base::ListValue();
args.Append(ids);
- ids->Append(new base::StringValue(""));
- SendJsMessage(message_name,
- JsArgList(&args), reply_handler.AsWeakHandle());
+ ids->Append(new base::StringValue(std::string()));
+ SendJsMessage(
+ message_name, JsArgList(&args), reply_handler.AsWeakHandle());
}
{
@@ -1273,9 +1278,9 @@ TEST_F(SyncManagerTest, GetChildNodeIdsFailure) {
{
base::ListValue args;
- args.Append(new base::StringValue(""));
- SendJsMessage("getChildNodeIds",
- JsArgList(&args), reply_handler.AsWeakHandle());
+ args.Append(new base::StringValue(std::string()));
+ SendJsMessage(
+ "getChildNodeIds", JsArgList(&args), reply_handler.AsWeakHandle());
}
{
diff --git a/sync/internal_api/syncapi_server_connection_manager_unittest.cc b/sync/internal_api/syncapi_server_connection_manager_unittest.cc
index f90c5e8..a0fe420 100644
--- a/sync/internal_api/syncapi_server_connection_manager_unittest.cc
+++ b/sync/internal_api/syncapi_server_connection_manager_unittest.cc
@@ -45,7 +45,7 @@ class BlockingHttpPost : public HttpPostProviderInterface {
}
virtual const std::string GetResponseHeaderValue(
const std::string& name) const OVERRIDE {
- return "";
+ return std::string();
}
virtual void Abort() OVERRIDE {
wait_for_abort_.Signal();
diff --git a/sync/notifier/p2p_invalidator.cc b/sync/notifier/p2p_invalidator.cc
index dd9a34d..7825757 100644
--- a/sync/notifier/p2p_invalidator.cc
+++ b/sync/notifier/p2p_invalidator.cc
@@ -40,7 +40,7 @@ std::string P2PNotificationTargetToString(P2PNotificationTarget target) {
return kNotifyAll;
default:
NOTREACHED();
- return "";
+ return std::string();
}
}
@@ -171,8 +171,9 @@ void P2PInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
ObjectIdLessThan());
registrar_.UpdateRegisteredIds(handler, ids);
const P2PNotificationData notification_data(
- invalidator_client_id_, NOTIFY_SELF,
- ObjectIdSetToInvalidationMap(new_ids, ""));
+ invalidator_client_id_,
+ NOTIFY_SELF,
+ ObjectIdSetToInvalidationMap(new_ids, std::string()));
SendNotificationData(notification_data);
}
@@ -224,8 +225,10 @@ void P2PInvalidator::OnNotificationsEnabled() {
registrar_.UpdateInvalidatorState(INVALIDATIONS_ENABLED);
if (just_turned_on) {
const P2PNotificationData notification_data(
- invalidator_client_id_, NOTIFY_SELF,
- ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), ""));
+ invalidator_client_id_,
+ NOTIFY_SELF,
+ ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(),
+ std::string()));
SendNotificationData(notification_data);
}
}
@@ -256,10 +259,11 @@ void P2PInvalidator::OnIncomingNotification(
if (!notification_data.ResetFromString(notification.data)) {
LOG(WARNING) << "Could not parse notification data from "
<< notification.data;
- notification_data =
- P2PNotificationData(
- invalidator_client_id_, NOTIFY_ALL,
- ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), ""));
+ notification_data = P2PNotificationData(
+ invalidator_client_id_,
+ NOTIFY_ALL,
+ ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(),
+ std::string()));
}
if (!notification_data.IsTargeted(invalidator_client_id_)) {
DVLOG(1) << "Not a target of the notification -- "
diff --git a/sync/notifier/p2p_invalidator_unittest.cc b/sync/notifier/p2p_invalidator_unittest.cc
index 1b7aad4..6acc3d1 100644
--- a/sync/notifier/p2p_invalidator_unittest.cc
+++ b/sync/notifier/p2p_invalidator_unittest.cc
@@ -69,7 +69,7 @@ class P2PInvalidatorTestDelegate {
void TriggerOnIncomingInvalidation(
const ObjectIdInvalidationMap& invalidation_map) {
const P2PNotificationData notification_data(
- "", NOTIFY_ALL, invalidation_map);
+ std::string(), NOTIFY_ALL, invalidation_map);
notifier::Notification notification;
notification.channel = kSyncP2PNotificationChannel;
notification.data = notification_data.ToString();
@@ -160,7 +160,7 @@ TEST_F(P2PInvalidatorTest, P2PNotificationDataIsTargeted) {
// default-constructed P2PNotificationData.
TEST_F(P2PInvalidatorTest, P2PNotificationDataDefault) {
const P2PNotificationData notification_data;
- EXPECT_TRUE(notification_data.IsTargeted(""));
+ EXPECT_TRUE(notification_data.IsTargeted(std::string()));
EXPECT_FALSE(notification_data.IsTargeted("other1"));
EXPECT_FALSE(notification_data.IsTargeted("other2"));
EXPECT_TRUE(notification_data.GetIdInvalidationMap().empty());
@@ -179,7 +179,8 @@ TEST_F(P2PInvalidatorTest, P2PNotificationDataDefault) {
TEST_F(P2PInvalidatorTest, P2PNotificationDataNonDefault) {
const ObjectIdInvalidationMap& invalidation_map =
ObjectIdSetToInvalidationMap(
- ModelTypeSetToObjectIdSet(ModelTypeSet(BOOKMARKS, THEMES)), "");
+ ModelTypeSetToObjectIdSet(ModelTypeSet(BOOKMARKS, THEMES)),
+ std::string());
const P2PNotificationData notification_data(
"sender", NOTIFY_ALL, invalidation_map);
EXPECT_TRUE(notification_data.IsTargeted("sender"));
@@ -247,7 +248,8 @@ TEST_F(P2PInvalidatorTest, NotificationsBasic) {
{
const ObjectIdInvalidationMap& invalidation_map =
ObjectIdSetToInvalidationMap(
- ModelTypeSetToObjectIdSet(ModelTypeSet(THEMES, APPS)), "");
+ ModelTypeSetToObjectIdSet(ModelTypeSet(THEMES, APPS)),
+ std::string());
invalidator->SendInvalidation(invalidation_map);
}
@@ -264,8 +266,8 @@ TEST_F(P2PInvalidatorTest, SendNotificationData) {
const ModelTypeSet expected_types(THEMES);
const ObjectIdInvalidationMap& invalidation_map =
- ObjectIdSetToInvalidationMap(
- ModelTypeSetToObjectIdSet(changed_types), "");
+ ObjectIdSetToInvalidationMap(ModelTypeSetToObjectIdSet(changed_types),
+ std::string());
P2PInvalidator* const invalidator = delegate_.GetInvalidator();
notifier::FakePushClient* const push_client = delegate_.GetPushClient();
diff --git a/sync/notifier/push_client_channel_unittest.cc b/sync/notifier/push_client_channel_unittest.cc
index ffe90e7..d017e1b 100644
--- a/sync/notifier/push_client_channel_unittest.cc
+++ b/sync/notifier/push_client_channel_unittest.cc
@@ -73,7 +73,7 @@ TEST_F(PushClientChannelTest, EncodeDecode) {
TEST_F(PushClientChannelTest, EncodeDecodeNoContext) {
const notifier::Notification& notification =
PushClientChannel::EncodeMessageForTest(
- kMessage, "", kSchedulingHash);
+ kMessage, std::string(), kSchedulingHash);
std::string message;
std::string service_context = kServiceContext;
int64 scheduling_hash = kSchedulingHash + 1;
diff --git a/sync/notifier/sync_invalidation_listener_unittest.cc b/sync/notifier/sync_invalidation_listener_unittest.cc
index 8177327..dba4728 100644
--- a/sync/notifier/sync_invalidation_listener_unittest.cc
+++ b/sync/notifier/sync_invalidation_listener_unittest.cc
@@ -148,7 +148,7 @@ class FakeDelegate : public SyncInvalidationListener::Delegate {
std::string GetPayload(const ObjectId& id) const {
ObjectIdInvalidationMap::const_iterator it = invalidations_.find(id);
- return (it == invalidations_.end()) ? "" : it->second.payload;
+ return (it == invalidations_.end()) ? std::string() : it->second.payload;
}
InvalidatorState GetInvalidatorState() const {
diff --git a/sync/notifier/sync_system_resources.cc b/sync/notifier/sync_system_resources.cc
index 5328657..3fc31fc 100644
--- a/sync/notifier/sync_system_resources.cc
+++ b/sync/notifier/sync_system_resources.cc
@@ -181,14 +181,15 @@ void SyncStorage::SetSystemResources(
void SyncStorage::RunAndDeleteWriteKeyCallback(
invalidation::WriteKeyCallback* callback) {
- callback->Run(invalidation::Status(invalidation::Status::SUCCESS, ""));
+ callback->Run(
+ invalidation::Status(invalidation::Status::SUCCESS, std::string()));
delete callback;
}
void SyncStorage::RunAndDeleteReadKeyCallback(
invalidation::ReadKeyCallback* callback, const std::string& value) {
callback->Run(std::make_pair(
- invalidation::Status(invalidation::Status::SUCCESS, ""),
+ invalidation::Status(invalidation::Status::SUCCESS, std::string()),
value));
delete callback;
}
diff --git a/sync/notifier/sync_system_resources_unittest.cc b/sync/notifier/sync_system_resources_unittest.cc
index 77423b3..cb406da 100644
--- a/sync/notifier/sync_system_resources_unittest.cc
+++ b/sync/notifier/sync_system_resources_unittest.cc
@@ -168,9 +168,10 @@ TEST_F(SyncSystemResourcesTest, WriteState) {
EXPECT_CALL(mock_storage_callback, Run(_))
.WillOnce(SaveArg<0>(&results));
sync_system_resources_.storage()->WriteKey(
- "", "state", mock_storage_callback.CreateCallback());
+ std::string(), "state", mock_storage_callback.CreateCallback());
message_loop_.RunUntilIdle();
- EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, ""), results);
+ EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, std::string()),
+ results);
}
} // namespace
diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc
index f0b87be..6d11e7f 100644
--- a/sync/syncable/directory_backing_store.cc
+++ b/sync/syncable/directory_backing_store.cc
@@ -1269,7 +1269,7 @@ bool DirectoryBackingStore::CreateTables() {
"?);")); // bag_of_chips
s.BindString(0, dir_name_); // id
s.BindString(1, dir_name_); // name
- s.BindString(2, ""); // store_birthday
+ s.BindString(2, std::string()); // store_birthday
// TODO(akalin): Remove this unused db_create_version field. (Or
// actually use it for something.) http://crbug.com/118356
s.BindString(3, "Unknown"); // db_create_version
diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc
index 2657ebc..eb28f37 100644
--- a/sync/syncable/model_type.cc
+++ b/sync/syncable/model_type.cc
@@ -523,7 +523,7 @@ base::StringValue* ModelTypeToValue(ModelType model_type) {
return new base::StringValue("Unspecified");
}
NOTREACHED();
- return new base::StringValue("");
+ return new base::StringValue(std::string());
}
ModelType ModelTypeFromValue(const base::Value& value) {
diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc
index f99ad23..affaeb4 100644
--- a/sync/syncable/syncable_unittest.cc
+++ b/sync/syncable/syncable_unittest.cc
@@ -2253,7 +2253,7 @@ TEST_F(SyncableClientTagTest, TestClientTagClear) {
WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get());
MutableEntry me(&trans, GET_BY_CLIENT_TAG, test_tag_);
EXPECT_TRUE(me.good());
- me.Put(UNIQUE_CLIENT_TAG, "");
+ me.Put(UNIQUE_CLIENT_TAG, std::string());
}
{
ReadTransaction trans(FROM_HERE, dir_.get());
diff --git a/sync/syncable/syncable_write_transaction.cc b/sync/syncable/syncable_write_transaction.cc
index 788d922..5b884e7 100644
--- a/sync/syncable/syncable_write_transaction.cc
+++ b/sync/syncable/syncable_write_transaction.cc
@@ -175,7 +175,7 @@ std::string WriterTagToString(WriterTag writer_tag) {
ENUM_CASE(SYNCAPI);
};
NOTREACHED();
- return "";
+ return std::string();
}
#undef ENUM_CASE
diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc
index e5fd452..6ddd866 100644
--- a/sync/test/engine/mock_connection_manager.cc
+++ b/sync/test/engine/mock_connection_manager.cc
@@ -43,7 +43,6 @@ MockConnectionManager::MockConnectionManager(syncable::Directory* directory)
store_birthday_("Store BDay!"),
store_birthday_sent_(false),
client_stuck_(false),
- commit_time_rename_prepended_string_(""),
countdown_to_postbuffer_fail_(0),
directory_(directory),
mid_commit_observer_(NULL),
diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc
index 61b5e63..0fed51e 100644
--- a/sync/util/cryptographer.cc
+++ b/sync/util/cryptographer.cc
@@ -110,12 +110,12 @@ std::string Cryptographer::DecryptToString(
NigoriMap::const_iterator it = nigoris_.find(encrypted.key_name());
if (nigoris_.end() == it) {
NOTREACHED() << "Cannot decrypt message";
- return std::string(""); // Caller should have called CanDecrypt(encrypt).
+ return std::string(); // Caller should have called CanDecrypt(encrypt).
}
std::string plaintext;
if (!it->second->Decrypt(encrypted.blob(), &plaintext)) {
- return std::string("");
+ return std::string();
}
return plaintext;
@@ -271,18 +271,18 @@ bool Cryptographer::GetBootstrapToken(std::string* token) const {
std::string Cryptographer::UnpackBootstrapToken(
const std::string& token) const {
if (token.empty())
- return "";
+ return std::string();
std::string encrypted_data;
if (!base::Base64Decode(token, &encrypted_data)) {
DLOG(WARNING) << "Could not decode token.";
- return "";
+ return std::string();
}
std::string unencrypted_token;
if (!encryptor_->DecryptString(encrypted_data, &unencrypted_token)) {
DLOG(WARNING) << "Decryption of bootstrap token failed.";
- return "";
+ return std::string();
}
return unencrypted_token;
}
@@ -328,15 +328,15 @@ bool Cryptographer::KeybagIsStale(
std::string Cryptographer::GetDefaultNigoriKey() const {
if (!is_initialized())
- return "";
+ return std::string();
NigoriMap::const_iterator iter = nigoris_.find(default_nigori_name_);
if (iter == nigoris_.end())
- return "";
+ return std::string();
sync_pb::NigoriKey key;
if (!iter->second->ExportKeys(key.mutable_user_key(),
key.mutable_encryption_key(),
key.mutable_mac_key()))
- return "";
+ return std::string();
return key.SerializeAsString();
}