diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 06:41:12 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 06:41:12 +0000 |
commit | 69d7f89d6a93e0fbce451960287066195c6d4ea0 (patch) | |
tree | 51c8c1f971d39d652ec38ed76070539bb33e85c7 /sync | |
parent | e3748a79b523a8d365d4a33ef986eebb4186fa78 (diff) | |
download | chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.zip chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.tar.gz chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.tar.bz2 |
Revert "Rewrite std::string("") to std::string(), Linux edition."
This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6.
Revert "Fix build after r193020."
This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a.
Revert "Really fix build after r193020."
This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193030 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
23 files changed, 81 insertions, 96 deletions
diff --git a/sync/api/sync_data.cc b/sync/api/sync_data.cc index e0b6f1a..b9e2ca9 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, std::string(), specifics); + return CreateLocalData(sync_tag, "", specifics); } // Static. diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc index 2dcc4b7..5ee9e47 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, std::string(), 1, 10, foreign_cache_guid(), "-1"); + mock_server_->AddUpdateDirectory(1, 0, "", 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, std::string(), 2, 20, foreign_cache_guid(), "-2"); + mock_server_->AddUpdateDirectory(2, 0, "", 2, 20, + foreign_cache_guid(), "-2"); mock_server_->SetLastUpdateDeleted(); SyncShareNudge(); } @@ -4044,11 +4044,9 @@ TEST_F(SyncerTest, UniqueServerTagUpdates) { } // Now download some tagged items as updates. - mock_server_->AddUpdateDirectory( - 1, 0, "update1", 1, 10, std::string(), std::string()); + mock_server_->AddUpdateDirectory(1, 0, "update1", 1, 10, "", ""); mock_server_->SetLastUpdateServerTag("alpha"); - mock_server_->AddUpdateDirectory( - 2, 0, "update2", 2, 20, std::string(), std::string()); + mock_server_->AddUpdateDirectory(2, 0, "update2", 2, 20, "", ""); mock_server_->SetLastUpdateServerTag("bob"); SyncShareNudge(); @@ -4254,7 +4252,7 @@ TEST_F(SyncerTest, GetKeyEmpty) { EXPECT_TRUE(directory()->GetNigoriHandler()->NeedKeystoreKey(&rtrans)); } - mock_server_->SetKeystoreKey(std::string()); + mock_server_->SetKeystoreKey(""); 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 d1bde98..c571b10 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, std::string()); + target->Put(UNIQUE_CLIENT_TAG, ""); 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 772ee7e..f051479 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(std::string(), *value, "Apps"); + ExpectDictStringValue("", *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 8c77d6d..20a6d19 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(std::string()).IsValid()); + EXPECT_FALSE(TestOrdinal("").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 b6c18ef..a47d42b 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(std::string(), suffix); + return UniquePosition("", suffix); } // static. @@ -175,7 +175,7 @@ std::string UniquePosition::FindSmallerWithSuffix( if (suffix_zeroes > ref_zeroes) { // Implies suffix < ref. - return std::string(); + return ""; } 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 std::string(); + return ""; } 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 std::string(); + return ""; } 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 655feb2..1a645bf 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 std::string(); + return ""; 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, std::string(), trans, nigori_node); + FinishSetPassphrase(false, "", 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, std::string(), trans, nigori_node); + FinishSetPassphrase(false, "", 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 919a65d..8abbd7e 100644 --- a/sync/internal_api/sync_encryption_handler_impl_unittest.cc +++ b/sync/internal_api/sync_encryption_handler_impl_unittest.cc @@ -91,8 +91,7 @@ class SyncEncryptionHandlerImplTest : public ::testing::Test { encryption_handler_.reset( new SyncEncryptionHandlerImpl(user_share(), &encryptor_, - std::string(), - std::string() /* bootstrap tokens */)); + "", "" /* bootstrap tokens */)); encryption_handler_->AddObserver(&observer_); } @@ -348,8 +347,7 @@ TEST_F(SyncEncryptionHandlerImplTest, NigoriEncryptionTypes) { StrictMock<SyncEncryptionHandlerObserverMock> observer2; SyncEncryptionHandlerImpl handler2(user_share(), &encryptor_, - std::string(), - std::string() /* bootstrap tokens */); + "", "" /* bootstrap tokens */); handler2.AddObserver(&observer2); // Just set the sensitive types (shouldn't trigger any notifications). @@ -613,8 +611,9 @@ 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(std::string()), trans.GetWrappedTrans())); + EXPECT_FALSE( + encryption_handler()->SetKeystoreKeys(BuildEncryptionKeyProto(""), + trans.GetWrappedTrans())); EXPECT_TRUE(encryption_handler()->NeedKeystoreKey(trans.GetWrappedTrans())); } Mock::VerifyAndClearExpectations(observer()); @@ -680,7 +679,7 @@ TEST_F(SyncEncryptionHandlerImplTest, SetKeystoreMigratesAndUpdatesBootstrap) { // token. SyncEncryptionHandlerImpl handler2(user_share(), &encryptor_, - std::string(), // Cryptographer bootstrap. + "", // Cryptographer bootstrap. keystore_bootstrap); { diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc index 7413b71..97d03ba 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, std::string()); + ModelTypeSetToInvalidationMap(types, ""); 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 7f96f49..9a6ddee 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 std::string(); + return ""; } virtual void Abort() OVERRIDE {} }; @@ -820,25 +820,20 @@ 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", - std::string(), - std::string(), // 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", + "", "", // bootstrap tokens + scoped_ptr<InternalComponentsFactory>(GetFactory()), + &encryptor_, + &handler_, + NULL); sync_manager_.GetEncryptionHandler()->AddObserver(&encryption_observer_); @@ -1186,9 +1181,9 @@ class SyncManagerGetNodesByIdTest : public SyncManagerTest { base::ListValue args; base::ListValue* ids = new base::ListValue(); args.Append(ids); - ids->Append(new base::StringValue(std::string())); - SendJsMessage( - message_name, JsArgList(&args), reply_handler.AsWeakHandle()); + ids->Append(new base::StringValue("")); + SendJsMessage(message_name, + JsArgList(&args), reply_handler.AsWeakHandle()); } { @@ -1278,9 +1273,9 @@ TEST_F(SyncManagerTest, GetChildNodeIdsFailure) { { base::ListValue args; - args.Append(new base::StringValue(std::string())); - SendJsMessage( - "getChildNodeIds", JsArgList(&args), reply_handler.AsWeakHandle()); + args.Append(new base::StringValue("")); + 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 a0fe420..f90c5e8 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 std::string(); + return ""; } virtual void Abort() OVERRIDE { wait_for_abort_.Signal(); diff --git a/sync/notifier/p2p_invalidator.cc b/sync/notifier/p2p_invalidator.cc index 7825757..dd9a34d 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 std::string(); + return ""; } } @@ -171,9 +171,8 @@ void P2PInvalidator::UpdateRegisteredIds(InvalidationHandler* handler, ObjectIdLessThan()); registrar_.UpdateRegisteredIds(handler, ids); const P2PNotificationData notification_data( - invalidator_client_id_, - NOTIFY_SELF, - ObjectIdSetToInvalidationMap(new_ids, std::string())); + invalidator_client_id_, NOTIFY_SELF, + ObjectIdSetToInvalidationMap(new_ids, "")); SendNotificationData(notification_data); } @@ -225,10 +224,8 @@ void P2PInvalidator::OnNotificationsEnabled() { registrar_.UpdateInvalidatorState(INVALIDATIONS_ENABLED); if (just_turned_on) { const P2PNotificationData notification_data( - invalidator_client_id_, - NOTIFY_SELF, - ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), - std::string())); + invalidator_client_id_, NOTIFY_SELF, + ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), "")); SendNotificationData(notification_data); } } @@ -259,11 +256,10 @@ 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(), - std::string())); + notification_data = + P2PNotificationData( + invalidator_client_id_, NOTIFY_ALL, + ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), "")); } 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 6acc3d1..1b7aad4 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( - std::string(), NOTIFY_ALL, invalidation_map); + "", 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(std::string())); + EXPECT_TRUE(notification_data.IsTargeted("")); EXPECT_FALSE(notification_data.IsTargeted("other1")); EXPECT_FALSE(notification_data.IsTargeted("other2")); EXPECT_TRUE(notification_data.GetIdInvalidationMap().empty()); @@ -179,8 +179,7 @@ TEST_F(P2PInvalidatorTest, P2PNotificationDataDefault) { TEST_F(P2PInvalidatorTest, P2PNotificationDataNonDefault) { const ObjectIdInvalidationMap& invalidation_map = ObjectIdSetToInvalidationMap( - ModelTypeSetToObjectIdSet(ModelTypeSet(BOOKMARKS, THEMES)), - std::string()); + ModelTypeSetToObjectIdSet(ModelTypeSet(BOOKMARKS, THEMES)), ""); const P2PNotificationData notification_data( "sender", NOTIFY_ALL, invalidation_map); EXPECT_TRUE(notification_data.IsTargeted("sender")); @@ -248,8 +247,7 @@ TEST_F(P2PInvalidatorTest, NotificationsBasic) { { const ObjectIdInvalidationMap& invalidation_map = ObjectIdSetToInvalidationMap( - ModelTypeSetToObjectIdSet(ModelTypeSet(THEMES, APPS)), - std::string()); + ModelTypeSetToObjectIdSet(ModelTypeSet(THEMES, APPS)), ""); invalidator->SendInvalidation(invalidation_map); } @@ -266,8 +264,8 @@ TEST_F(P2PInvalidatorTest, SendNotificationData) { const ModelTypeSet expected_types(THEMES); const ObjectIdInvalidationMap& invalidation_map = - ObjectIdSetToInvalidationMap(ModelTypeSetToObjectIdSet(changed_types), - std::string()); + ObjectIdSetToInvalidationMap( + ModelTypeSetToObjectIdSet(changed_types), ""); 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 d017e1b..ffe90e7 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, std::string(), kSchedulingHash); + kMessage, "", 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 dba4728..8177327 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()) ? std::string() : it->second.payload; + return (it == invalidations_.end()) ? "" : it->second.payload; } InvalidatorState GetInvalidatorState() const { diff --git a/sync/notifier/sync_system_resources.cc b/sync/notifier/sync_system_resources.cc index 3fc31fc..5328657 100644 --- a/sync/notifier/sync_system_resources.cc +++ b/sync/notifier/sync_system_resources.cc @@ -181,15 +181,14 @@ void SyncStorage::SetSystemResources( void SyncStorage::RunAndDeleteWriteKeyCallback( invalidation::WriteKeyCallback* callback) { - callback->Run( - invalidation::Status(invalidation::Status::SUCCESS, std::string())); + callback->Run(invalidation::Status(invalidation::Status::SUCCESS, "")); delete callback; } void SyncStorage::RunAndDeleteReadKeyCallback( invalidation::ReadKeyCallback* callback, const std::string& value) { callback->Run(std::make_pair( - invalidation::Status(invalidation::Status::SUCCESS, std::string()), + invalidation::Status(invalidation::Status::SUCCESS, ""), value)); delete callback; } diff --git a/sync/notifier/sync_system_resources_unittest.cc b/sync/notifier/sync_system_resources_unittest.cc index cb406da..77423b3 100644 --- a/sync/notifier/sync_system_resources_unittest.cc +++ b/sync/notifier/sync_system_resources_unittest.cc @@ -168,10 +168,9 @@ TEST_F(SyncSystemResourcesTest, WriteState) { EXPECT_CALL(mock_storage_callback, Run(_)) .WillOnce(SaveArg<0>(&results)); sync_system_resources_.storage()->WriteKey( - std::string(), "state", mock_storage_callback.CreateCallback()); + "", "state", mock_storage_callback.CreateCallback()); message_loop_.RunUntilIdle(); - EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, std::string()), - results); + EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, ""), results); } } // namespace diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc index 6d11e7f..f0b87be 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, std::string()); // store_birthday + s.BindString(2, ""); // 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 eb28f37..2657ebc 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(std::string()); + return new base::StringValue(""); } ModelType ModelTypeFromValue(const base::Value& value) { diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc index affaeb4..f99ad23 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, std::string()); + me.Put(UNIQUE_CLIENT_TAG, ""); } { ReadTransaction trans(FROM_HERE, dir_.get()); diff --git a/sync/syncable/syncable_write_transaction.cc b/sync/syncable/syncable_write_transaction.cc index 5b884e7..788d922 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 std::string(); + return ""; } #undef ENUM_CASE diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc index 6ddd866..e5fd452 100644 --- a/sync/test/engine/mock_connection_manager.cc +++ b/sync/test/engine/mock_connection_manager.cc @@ -43,6 +43,7 @@ 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 0fed51e..61b5e63 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 std::string(); + return ""; std::string encrypted_data; if (!base::Base64Decode(token, &encrypted_data)) { DLOG(WARNING) << "Could not decode token."; - return std::string(); + return ""; } std::string unencrypted_token; if (!encryptor_->DecryptString(encrypted_data, &unencrypted_token)) { DLOG(WARNING) << "Decryption of bootstrap token failed."; - return std::string(); + return ""; } return unencrypted_token; } @@ -328,15 +328,15 @@ bool Cryptographer::KeybagIsStale( std::string Cryptographer::GetDefaultNigoriKey() const { if (!is_initialized()) - return std::string(); + return ""; NigoriMap::const_iterator iter = nigoris_.find(default_nigori_name_); if (iter == nigoris_.end()) - return std::string(); + return ""; sync_pb::NigoriKey key; if (!iter->second->ExportKeys(key.mutable_user_key(), key.mutable_encryption_key(), key.mutable_mac_key())) - return std::string(); + return ""; return key.SerializeAsString(); } |