diff options
Diffstat (limited to 'sync/internal_api')
8 files changed, 44 insertions, 38 deletions
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(); |