diff options
-rw-r--r-- | default_profile.cc | 3 | ||||
-rw-r--r-- | ephemeral_profile.cc | 3 | ||||
-rw-r--r-- | manager.h | 2 | ||||
-rw-r--r-- | manager_unittest.cc | 12 | ||||
-rw-r--r-- | mock_profile.cc | 6 | ||||
-rw-r--r-- | profile.cc | 2 | ||||
-rw-r--r-- | profile.h | 2 | ||||
-rw-r--r-- | profile_unittest.cc | 40 |
8 files changed, 35 insertions, 35 deletions
diff --git a/default_profile.cc b/default_profile.cc index 10a432af..3bf89a30 100644 --- a/default_profile.cc +++ b/default_profile.cc @@ -82,7 +82,8 @@ DefaultProfile::DefaultProfile(ControlInterface* control, const FilePath& storage_path, const string& profile_id, const Manager::Properties& manager_props) - : Profile(control, metrics, manager, Identifier(profile_id), "", true), + : Profile(control, metrics, manager, Identifier(profile_id), + FilePath(), true), storage_path_(storage_path), profile_id_(profile_id), props_(manager_props), diff --git a/ephemeral_profile.cc b/ephemeral_profile.cc index 17a3ba3c..5239cd41 100644 --- a/ephemeral_profile.cc +++ b/ephemeral_profile.cc @@ -38,7 +38,8 @@ const char EphemeralProfile::kFriendlyName[] = "(ephemeral)"; EphemeralProfile::EphemeralProfile(ControlInterface* control_interface, Metrics* metrics, Manager* manager) - : Profile(control_interface, metrics, manager, Identifier(), "", false) { + : Profile(control_interface, metrics, manager, Identifier(), + base::FilePath(), false) { } EphemeralProfile::~EphemeralProfile() {} @@ -743,7 +743,7 @@ class Manager : public base::SupportsWeakPtr<Manager> { EventDispatcher* dispatcher_; const base::FilePath run_path_; const base::FilePath storage_path_; - const std::string user_storage_path_; + const base::FilePath user_storage_path_; base::FilePath user_profile_list_path_; // Changed in tests. std::unique_ptr<ManagerAdaptorInterface> adaptor_; DeviceInfo device_info_; diff --git a/manager_unittest.cc b/manager_unittest.cc index b59a7362..ba13a32a 100644 --- a/manager_unittest.cc +++ b/manager_unittest.cc @@ -216,12 +216,8 @@ class ManagerTest : public PropertyStoreTest { std::unique_ptr<FakeStore> storage(new FakeStore()); if (!storage->Open()) return nullptr; - Profile* profile(new Profile(control_interface(), - metrics(), - manager, - id, - "", - false)); + Profile* profile(new Profile( + control_interface(), metrics(), manager, id, FilePath(), false)); profile->set_storage(storage.release()); // Passes ownership of "storage". return profile; // Passes ownership of "profile". } @@ -828,8 +824,8 @@ TEST_F(ManagerTest, MoveService) { // Inject an actual profile, backed by a fake StoreInterface { Profile::Identifier id("irrelevant"); - ProfileRefPtr profile( - new Profile(control_interface(), metrics(), &manager, id, "", false)); + ProfileRefPtr profile(new Profile( + control_interface(), metrics(), &manager, id, FilePath(), false)); MockStore* storage = new MockStore; EXPECT_CALL(*storage, ContainsGroup(s2->GetStorageIdentifier())) .WillRepeatedly(Return(true)); diff --git a/mock_profile.cc b/mock_profile.cc index 4757b7bb..d30ff612 100644 --- a/mock_profile.cc +++ b/mock_profile.cc @@ -29,14 +29,16 @@ namespace shill { MockProfile::MockProfile(ControlInterface* control, Metrics* metrics, Manager* manager) - : Profile(control, metrics, manager, Identifier("mock"), "", false) { + : Profile(control, metrics, manager, Identifier("mock"), base::FilePath(), + false) { } MockProfile::MockProfile(ControlInterface* control, Metrics* metrics, Manager* manager, const std::string& identifier) - : Profile(control, metrics, manager, Identifier(identifier), "", false) { + : Profile(control, metrics, manager, Identifier(identifier), + base::FilePath(), false) { } MockProfile::~MockProfile() {} @@ -52,7 +52,7 @@ Profile::Profile(ControlInterface* control_interface, Metrics* metrics, Manager* manager, const Identifier& name, - const string& user_storage_directory, + const base::FilePath& user_storage_directory, bool connect_to_rpc) : metrics_(metrics), manager_(manager), @@ -75,7 +75,7 @@ class Profile : public base::RefCounted<Profile> { Metrics* metrics, Manager* manager, const Identifier& name, - const std::string& user_storage_directory, + const base::FilePath& user_storage_directory, bool connect_to_rpc); virtual ~Profile(); diff --git a/profile_unittest.cc b/profile_unittest.cc index cb3e477c..234af314 100644 --- a/profile_unittest.cc +++ b/profile_unittest.cc @@ -51,8 +51,8 @@ class ProfileTest : public PropertyStoreTest { public: ProfileTest() : mock_metrics_(new MockMetrics(nullptr)) { Profile::Identifier id("rather", "irrelevant"); - profile_ = - new Profile(control_interface(), metrics(), manager(), id, "", false); + profile_ = new Profile( + control_interface(), metrics(), manager(), id, FilePath(), false); // Install a FakeStore by default. In tests that actually care // about the interaction between Profile and StoreInterface, we'll @@ -76,7 +76,7 @@ class ProfileTest : public PropertyStoreTest { Error error; ProfileRefPtr profile( new Profile(control_interface(), mock_metrics_.get(), manager(), id, - storage_path(), false)); + FilePath(storage_path()), false)); bool ret = profile->InitStorage(storage_option, &error); EXPECT_EQ(error_type, error.type()); if (ret && save) { @@ -201,12 +201,12 @@ TEST_F(ProfileTest, GetFriendlyName) { static const char kUser[] = "theUser"; static const char kIdentifier[] = "theIdentifier"; Profile::Identifier id(kIdentifier); - ProfileRefPtr profile( - new Profile(control_interface(), metrics(), manager(), id, "", false)); + ProfileRefPtr profile(new Profile( + control_interface(), metrics(), manager(), id, FilePath(), false)); EXPECT_EQ(kIdentifier, profile->GetFriendlyName()); id.user = kUser; - profile = - new Profile(control_interface(), metrics(), manager(), id, "", false); + profile = new Profile( + control_interface(), metrics(), manager(), id, FilePath(), false); EXPECT_EQ(string(kUser) + "/" + kIdentifier, profile->GetFriendlyName()); } @@ -216,13 +216,13 @@ TEST_F(ProfileTest, GetStoragePath) { static const char kDirectory[] = "/a/place/for/"; FilePath path; Profile::Identifier id(kIdentifier); - ProfileRefPtr profile( - new Profile(control_interface(), metrics(), manager(), id, "", false)); + ProfileRefPtr profile(new Profile( + control_interface(), metrics(), manager(), id, FilePath(), false)); EXPECT_FALSE(profile->GetStoragePath(&path)); id.user = kUser; - profile = - new Profile(control_interface(), metrics(), manager(), id, kDirectory, - false); + profile = new Profile( + control_interface(), metrics(), manager(), id, FilePath(kDirectory), + false); EXPECT_TRUE(profile->GetStoragePath(&path)); EXPECT_EQ("/a/place/for/chronos/someprofile.profile", path.value()); } @@ -369,24 +369,24 @@ TEST_F(ProfileTest, SaveUserProfileList) { const char kHash0[] = "hash0"; id0.user_hash = kHash0; vector<ProfileRefPtr> profiles; - profiles.push_back(new Profile(control_interface(), metrics(), manager(), - id0, "", false)); + profiles.push_back(new Profile( + control_interface(), metrics(), manager(), id0, FilePath(), false)); const char kUser1[] = "user1"; const char kIdentifier1[] = "id1"; Profile::Identifier id1(kUser1, kIdentifier1); const char kHash1[] = "hash1"; id1.user_hash = kHash1; - profiles.push_back(new Profile(control_interface(), metrics(), manager(), - id1, "", false)); + profiles.push_back(new Profile( + control_interface(), metrics(), manager(), id1, FilePath(), false)); const char kIdentifier2[] = "id2"; Profile::Identifier id2("", kIdentifier2); const char kHash2[] = "hash2"; id1.user_hash = kHash2; - profiles.push_back(new Profile(control_interface(), metrics(), manager(), - id2, "", false)); + profiles.push_back(new Profile( + control_interface(), metrics(), manager(), id2, FilePath(), false)); FilePath list_path(FilePath(storage_path()).Append("test.profile")); EXPECT_TRUE(Profile::SaveUserProfileList(list_path, profiles)); @@ -403,8 +403,8 @@ TEST_F(ProfileTest, MatchesIdentifier) { static const char kUser[] = "theUser"; static const char kIdentifier[] = "theIdentifier"; Profile::Identifier id(kUser, kIdentifier); - ProfileRefPtr profile( - new Profile(control_interface(), metrics(), manager(), id, "", false)); + ProfileRefPtr profile(new Profile( + control_interface(), metrics(), manager(), id, FilePath(), false)); EXPECT_TRUE(profile->MatchesIdentifier(id)); EXPECT_FALSE(profile->MatchesIdentifier(Profile::Identifier(kUser, ""))); EXPECT_FALSE( |