Commit 1e9f6a75 authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Remove DISALLOW_COPY_AND_ASSIGN from more profile classes

Other miscellaneous cleanup, no functional changes.

Bug: 1010217
Change-Id: I6b86bf6467d360d2e8a7732f350b4c4a9b8427f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363671
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799906}
parent d5813383
......@@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_PROFILES_CHROME_BROWSER_MAIN_EXTRA_PARTS_PROFILES_H_
#define CHROME_BROWSER_PROFILES_CHROME_BROWSER_MAIN_EXTRA_PARTS_PROFILES_H_
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "chrome/browser/chrome_browser_main_extra_parts.h"
class ChromeBrowserMainParts;
......@@ -18,6 +16,10 @@ void AddProfilesExtraParts(ChromeBrowserMainParts* main_parts);
class ChromeBrowserMainExtraPartsProfiles : public ChromeBrowserMainExtraParts {
public:
ChromeBrowserMainExtraPartsProfiles();
ChromeBrowserMainExtraPartsProfiles(
const ChromeBrowserMainExtraPartsProfiles&) = delete;
ChromeBrowserMainExtraPartsProfiles& operator=(
const ChromeBrowserMainExtraPartsProfiles&) = delete;
~ChromeBrowserMainExtraPartsProfiles() override;
// Instantiates all chrome KeyedService factories, which is
......@@ -27,9 +29,6 @@ class ChromeBrowserMainExtraPartsProfiles : public ChromeBrowserMainExtraParts {
// Overridden from ChromeBrowserMainExtraParts:
void PreProfileInit() override;
private:
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsProfiles);
};
#endif // CHROME_BROWSER_PROFILES_CHROME_BROWSER_MAIN_EXTRA_PARTS_PROFILES_H_
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <utility>
#include <vector>
#include "base/hash/hash.h"
#include "base/logging.h"
......@@ -133,10 +134,7 @@ void ProfileAttributesEntry::RegisterLocalStatePrefs(
registry->RegisterIntegerPref(kNextMetricsBucketIndex, 1);
}
ProfileAttributesEntry::ProfileAttributesEntry()
: profile_info_cache_(nullptr),
prefs_(nullptr),
profile_path_(base::FilePath()) {}
ProfileAttributesEntry::ProfileAttributesEntry() = default;
void ProfileAttributesEntry::Initialize(ProfileInfoCache* cache,
const base::FilePath& path,
......
......@@ -13,7 +13,6 @@
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/optional.h"
#include "base/strings/string16.h"
#include "base/time/time.h"
......@@ -54,7 +53,9 @@ class ProfileAttributesEntry {
static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
ProfileAttributesEntry();
virtual ~ProfileAttributesEntry() {}
ProfileAttributesEntry(const ProfileAttributesEntry&) = delete;
ProfileAttributesEntry& operator=(const ProfileAttributesEntry&) = delete;
virtual ~ProfileAttributesEntry() = default;
// Returns whether the profile name is the concatenation of the Gaia name and
// of the local profile name.
......@@ -307,8 +308,8 @@ class ProfileAttributesEntry {
// when this class holds the members required to fulfill its own contract.
size_t profile_index() const;
ProfileInfoCache* profile_info_cache_;
PrefService* prefs_;
ProfileInfoCache* profile_info_cache_ = nullptr;
PrefService* prefs_ = nullptr;
base::FilePath profile_path_;
std::string storage_key_;
base::string16 last_name_to_display_;
......@@ -318,8 +319,6 @@ class ProfileAttributesEntry {
// memory only and can be easily reset once the policy is turned off.
bool is_force_signin_profile_locked_ = false;
bool is_force_signin_enabled_;
DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry);
};
#endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_
......@@ -149,7 +149,7 @@ bool ProfileAttributesSortComparator::operator()(
MultiProfileUserType GetMultiProfileUserType(
const std::vector<ProfileAttributesEntry*>& entries) {
DCHECK(entries.size() > 0);
DCHECK_GT(entries.size(), 0u);
if (entries.size() == 1u)
return MultiProfileUserType::kSingleProfile;
......
......@@ -15,7 +15,6 @@
#include "base/callback_forward.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
......@@ -41,6 +40,8 @@ class ProfileAttributesStorage
using Observer = ProfileInfoCacheObserver;
explicit ProfileAttributesStorage(PrefService* prefs);
ProfileAttributesStorage(const ProfileAttributesStorage&) = delete;
ProfileAttributesStorage& operator=(const ProfileAttributesStorage&) = delete;
virtual ~ProfileAttributesStorage();
// If the |supervised_user_id| is non-empty, the profile will be marked to be
......@@ -210,8 +211,6 @@ class ProfileAttributesStorage
// Notifies observers.
void NotifyOnProfileHighResAvatarLoaded(
const base::FilePath& profile_path) const;
DISALLOW_COPY_AND_ASSIGN(ProfileAttributesStorage);
};
#endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_STORAGE_H_
......@@ -68,7 +68,7 @@ ProfileInfoCache::ProfileInfoCache(PrefService* prefs,
base::DictionaryValue* cache = update.Get();
for (base::DictionaryValue::Iterator it(*cache);
!it.IsAtEnd(); it.Advance()) {
base::DictionaryValue* info = NULL;
base::DictionaryValue* info = nullptr;
cache->GetDictionaryWithoutPathExpansion(it.key(), &info);
#if BUILDFLAG(ENABLE_SUPERVISED_USERS) && !defined(OS_ANDROID) && \
!defined(OS_CHROMEOS)
......@@ -239,7 +239,7 @@ void ProfileInfoCache::DeleteProfileFromCache(
DictionaryPrefUpdate update(prefs_, prefs::kProfileInfoCache);
base::DictionaryValue* cache = update.Get();
std::string key = CacheKeyFromProfilePath(profile_path);
cache->Remove(key, NULL);
cache->Remove(key, nullptr);
keys_.erase(std::find(keys_.begin(), keys_.end(), key));
profile_attributes_entries_.erase(profile_path.value());
......@@ -280,7 +280,7 @@ const gfx::Image* ProfileInfoCache::GetGAIAPictureOfProfileAtIndex(
// If the picture is not on disk then return NULL.
if (file_name.empty())
return NULL;
return nullptr;
base::FilePath image_path = path.AppendASCII(file_name);
return LoadAvatarPictureFromPath(path, key, image_path);
......@@ -497,7 +497,7 @@ const base::DictionaryValue* ProfileInfoCache::GetInfoForProfileAtIndex(
DCHECK_LT(index, GetNumberOfProfiles());
const base::DictionaryValue* cache =
prefs_->GetDictionary(prefs::kProfileInfoCache);
const base::DictionaryValue* info = NULL;
const base::DictionaryValue* info = nullptr;
cache->GetDictionaryWithoutPathExpansion(keys_[index], &info);
return info;
}
......
......@@ -15,7 +15,6 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
......@@ -48,6 +47,8 @@ class ProfileInfoCache : public ProfileInfoInterface,
public base::SupportsWeakPtr<ProfileInfoCache> {
public:
ProfileInfoCache(PrefService* prefs, const base::FilePath& user_data_dir);
ProfileInfoCache(const ProfileInfoCache&) = delete;
ProfileInfoCache& operator=(const ProfileInfoCache&) = delete;
~ProfileInfoCache() override;
// If the |supervised_user_id| is non-empty, the profile will be marked to be
......@@ -188,8 +189,6 @@ class ProfileInfoCache : public ProfileInfoInterface,
std::vector<std::string> keys_;
const base::FilePath user_data_dir_;
base::WeakPtrFactory<ProfileInfoCache> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache);
};
#endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_
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