Commit 1eecf420 authored by Kushagra Sinha's avatar Kushagra Sinha Committed by Commit Bot

crOS Account Manager: Remove usages of DISALLOW_COPY_AND_ASSIGN

Change-Id: Ia9a8794d62e11ca294583c524a9f6256ee7b048a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2256218
Commit-Queue: Kush Sinha <sinhak@chromium.org>
Reviewed-by: default avatarAnastasiia N <anastasiian@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781789}
parent 6cf5b9cf
...@@ -94,7 +94,9 @@ class AccountManager::GaiaTokenRevocationRequest : public GaiaAuthConsumer { ...@@ -94,7 +94,9 @@ class AccountManager::GaiaTokenRevocationRequest : public GaiaAuthConsumer {
&GaiaTokenRevocationRequest::Start, weak_factory_.GetWeakPtr()); &GaiaTokenRevocationRequest::Start, weak_factory_.GetWeakPtr());
delay_network_call_runner.Run(std::move(start_revoke_token)); delay_network_call_runner.Run(std::move(start_revoke_token));
} }
GaiaTokenRevocationRequest(const GaiaTokenRevocationRequest&) = delete;
GaiaTokenRevocationRequest& operator=(const GaiaTokenRevocationRequest&) =
delete;
~GaiaTokenRevocationRequest() override = default; ~GaiaTokenRevocationRequest() override = default;
// GaiaAuthConsumer overrides. // GaiaAuthConsumer overrides.
...@@ -125,7 +127,6 @@ class AccountManager::GaiaTokenRevocationRequest : public GaiaAuthConsumer { ...@@ -125,7 +127,6 @@ class AccountManager::GaiaTokenRevocationRequest : public GaiaAuthConsumer {
std::string refresh_token_; std::string refresh_token_;
base::WeakPtrFactory<GaiaTokenRevocationRequest> weak_factory_{this}; base::WeakPtrFactory<GaiaTokenRevocationRequest> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(GaiaTokenRevocationRequest);
}; };
bool AccountManager::AccountKey::IsValid() const { bool AccountManager::AccountKey::IsValid() const {
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "base/component_export.h" #include "base/component_export.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
...@@ -93,6 +92,8 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager { ...@@ -93,6 +92,8 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager {
class Observer { class Observer {
public: public:
Observer(); Observer();
Observer(const Observer&) = delete;
Observer& operator=(const Observer&) = delete;
virtual ~Observer(); virtual ~Observer();
// Called when the token for |account| is updated/inserted. // Called when the token for |account| is updated/inserted.
...@@ -110,13 +111,12 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager { ...@@ -110,13 +111,12 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager {
// |AccountManager::CreateAccessTokenFetcher|), must clear their cache entry // |AccountManager::CreateAccessTokenFetcher|), must clear their cache entry
// for this |account| on receiving this callback. // for this |account| on receiving this callback.
virtual void OnAccountRemoved(const Account& account) = 0; virtual void OnAccountRemoved(const Account& account) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(Observer);
}; };
// Note: |Initialize| MUST be called at least once on this object. // Note: |Initialize| MUST be called at least once on this object.
AccountManager(); AccountManager();
AccountManager(const AccountManager&) = delete;
AccountManager& operator=(const AccountManager&) = delete;
virtual ~AccountManager(); virtual ~AccountManager();
static void RegisterPrefs(PrefRegistrySimple* registry); static void RegisterPrefs(PrefRegistrySimple* registry);
...@@ -400,7 +400,6 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager { ...@@ -400,7 +400,6 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager {
SEQUENCE_CHECKER(sequence_checker_); SEQUENCE_CHECKER(sequence_checker_);
base::WeakPtrFactory<AccountManager> weak_factory_{this}; base::WeakPtrFactory<AccountManager> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(AccountManager);
}; };
// For logging. // For logging.
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <unordered_map> #include <unordered_map>
#include "base/component_export.h" #include "base/component_export.h"
#include "base/macros.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "chromeos/components/account_manager/account_manager.h" #include "chromeos/components/account_manager/account_manager.h"
...@@ -28,6 +27,8 @@ namespace chromeos { ...@@ -28,6 +27,8 @@ namespace chromeos {
class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManagerFactory { class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManagerFactory {
public: public:
AccountManagerFactory(); AccountManagerFactory();
AccountManagerFactory(const AccountManagerFactory&) = delete;
AccountManagerFactory& operator=(const AccountManagerFactory&) = delete;
~AccountManagerFactory(); ~AccountManagerFactory();
// Returns the |AccountManager| corresponding to the given |profile_path|. // Returns the |AccountManager| corresponding to the given |profile_path|.
...@@ -40,8 +41,6 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManagerFactory { ...@@ -40,8 +41,6 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManagerFactory {
account_managers_; account_managers_;
SEQUENCE_CHECKER(sequence_checker_); SEQUENCE_CHECKER(sequence_checker_);
DISALLOW_COPY_AND_ASSIGN(AccountManagerFactory);
}; };
} // namespace chromeos } // namespace chromeos
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h" #include "base/files/scoped_temp_dir.h"
#include "base/macros.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/stl_util.h" #include "base/stl_util.h"
...@@ -56,17 +55,18 @@ bool IsAccountKeyPresent(const std::vector<AccountManager::Account>& accounts, ...@@ -56,17 +55,18 @@ bool IsAccountKeyPresent(const std::vector<AccountManager::Account>& accounts,
class AccountManagerSpy : public AccountManager { class AccountManagerSpy : public AccountManager {
public: public:
AccountManagerSpy() = default; AccountManagerSpy() = default;
AccountManagerSpy(const AccountManagerSpy&) = delete;
AccountManagerSpy& operator=(const AccountManagerSpy&) = delete;
~AccountManagerSpy() override = default; ~AccountManagerSpy() override = default;
MOCK_METHOD(void, RevokeGaiaTokenOnServer, (const std::string&)); MOCK_METHOD(void, RevokeGaiaTokenOnServer, (const std::string&));
private:
DISALLOW_COPY_AND_ASSIGN(AccountManagerSpy);
}; };
class AccountManagerTest : public testing::Test { class AccountManagerTest : public testing::Test {
public: public:
AccountManagerTest() = default; AccountManagerTest() = default;
AccountManagerTest(const AccountManagerTest&) = delete;
AccountManagerTest& operator=(const AccountManagerTest&) = delete;
~AccountManagerTest() override = default; ~AccountManagerTest() override = default;
protected: protected:
...@@ -185,13 +185,13 @@ class AccountManagerTest : public testing::Test { ...@@ -185,13 +185,13 @@ class AccountManagerTest : public testing::Test {
TestingPrefServiceSimple pref_service_; TestingPrefServiceSimple pref_service_;
network::TestURLLoaderFactory test_url_loader_factory_; network::TestURLLoaderFactory test_url_loader_factory_;
std::unique_ptr<AccountManagerSpy> account_manager_; std::unique_ptr<AccountManagerSpy> account_manager_;
DISALLOW_COPY_AND_ASSIGN(AccountManagerTest);
}; };
class AccountManagerObserver : public AccountManager::Observer { class AccountManagerObserver : public AccountManager::Observer {
public: public:
AccountManagerObserver() = default; AccountManagerObserver() = default;
AccountManagerObserver(const AccountManagerObserver&) = delete;
AccountManagerObserver& operator=(const AccountManagerObserver&) = delete;
~AccountManagerObserver() override = default; ~AccountManagerObserver() override = default;
void OnTokenUpserted(const AccountManager::Account& account) override { void OnTokenUpserted(const AccountManager::Account& account) override {
...@@ -254,8 +254,6 @@ class AccountManagerObserver : public AccountManager::Observer { ...@@ -254,8 +254,6 @@ class AccountManagerObserver : public AccountManager::Observer {
AccountManager::AccountKey last_removed_account_key_; AccountManager::AccountKey last_removed_account_key_;
std::string last_removed_account_email_; std::string last_removed_account_email_;
std::set<AccountManager::AccountKey> accounts_; std::set<AccountManager::AccountKey> accounts_;
DISALLOW_COPY_AND_ASSIGN(AccountManagerObserver);
}; };
TEST(AccountManagerKeyTest, TestValidity) { TEST(AccountManagerKeyTest, TestValidity) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment