Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4938)

Unified Diff: chrome/browser/chromeos/customization/customization_document.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/customization/customization_document.cc
diff --git a/chrome/browser/chromeos/customization/customization_document.cc b/chrome/browser/chromeos/customization/customization_document.cc
index aa17dc1df98c678c928fb04e98c0cf86cf41c76d..fb5492e05f9cfe2d87012ee368f8c8b1c769a2fa 100644
--- a/chrome/browser/chromeos/customization/customization_document.cc
+++ b/chrome/browser/chromeos/customization/customization_document.cc
@@ -169,7 +169,7 @@ class ServicesCustomizationExternalLoader
Profile* profile() { return profile_; }
// Used by the ServicesCustomizationDocument to update the current apps.
- void SetCurrentApps(scoped_ptr<base::DictionaryValue> prefs) {
+ void SetCurrentApps(std::unique_ptr<base::DictionaryValue> prefs) {
apps_.Swap(prefs.get());
is_apps_set_ = true;
StartLoading();
@@ -226,7 +226,7 @@ bool CustomizationDocument::LoadManifestFromString(
const std::string& manifest) {
int error_code = 0;
std::string error;
- scoped_ptr<base::Value> root = base::JSONReader::ReadAndReturnError(
+ std::unique_ptr<base::Value> root = base::JSONReader::ReadAndReturnError(
manifest, base::JSON_ALLOW_TRAILING_COMMAS, &error_code, &error);
if (error_code != base::JSONReader::JSON_NO_ERROR)
LOG(ERROR) << error;
@@ -599,14 +599,14 @@ void ServicesCustomizationDocument::OnManifestLoaded() {
if (!WasOOBECustomizationApplied())
ApplyOOBECustomization();
- scoped_ptr<base::DictionaryValue> prefs =
+ std::unique_ptr<base::DictionaryValue> prefs =
GetDefaultAppsInProviderFormat(*root_);
for (ExternalLoaders::iterator it = external_loaders_.begin();
it != external_loaders_.end(); ++it) {
if (*it) {
UpdateCachedManifest((*it)->profile());
(*it)->SetCurrentApps(
- scoped_ptr<base::DictionaryValue>(prefs->DeepCopy()));
+ std::unique_ptr<base::DictionaryValue>(prefs->DeepCopy()));
SetOemFolderName((*it)->profile(), *root_);
}
}
@@ -668,10 +668,10 @@ bool ServicesCustomizationDocument::GetDefaultWallpaperUrl(
return true;
}
-scoped_ptr<base::DictionaryValue>
+std::unique_ptr<base::DictionaryValue>
ServicesCustomizationDocument::GetDefaultApps() const {
if (!IsReady())
- return scoped_ptr<base::DictionaryValue>();
+ return std::unique_ptr<base::DictionaryValue>();
return GetDefaultAppsInProviderFormat(*root_);
}
@@ -684,16 +684,16 @@ std::string ServicesCustomizationDocument::GetOemAppsFolderName(
return GetOemAppsFolderNameImpl(locale, *root_);
}
-scoped_ptr<base::DictionaryValue>
+std::unique_ptr<base::DictionaryValue>
ServicesCustomizationDocument::GetDefaultAppsInProviderFormat(
const base::DictionaryValue& root) {
- scoped_ptr<base::DictionaryValue> prefs(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> prefs(new base::DictionaryValue);
const base::ListValue* apps_list = NULL;
if (root.GetList(kDefaultAppsAttr, &apps_list)) {
for (size_t i = 0; i < apps_list->GetSize(); ++i) {
std::string app_id;
const base::DictionaryValue* app_entry = nullptr;
- scoped_ptr<base::DictionaryValue> entry;
+ std::unique_ptr<base::DictionaryValue> entry;
if (apps_list->GetString(i, &app_id)) {
entry.reset(new base::DictionaryValue());
} else if (apps_list->GetDictionary(i, &app_entry)) {
@@ -798,7 +798,7 @@ void ServicesCustomizationDocument::ShutdownForTesting() {
void ServicesCustomizationDocument::StartOEMWallpaperDownload(
const GURL& wallpaper_url,
- scoped_ptr<ServicesCustomizationDocument::ApplyingTask> applying) {
+ std::unique_ptr<ServicesCustomizationDocument::ApplyingTask> applying) {
DCHECK(wallpaper_url.is_valid());
const base::FilePath dir = GetCustomizedWallpaperCacheDir();
@@ -823,7 +823,7 @@ void ServicesCustomizationDocument::CheckAndApplyWallpaper() {
VLOG(1) << "CheckAndApplyWallpaper(): download has already started.";
return;
}
- scoped_ptr<ServicesCustomizationDocument::ApplyingTask> applying(
+ std::unique_ptr<ServicesCustomizationDocument::ApplyingTask> applying(
new ServicesCustomizationDocument::ApplyingTask(this));
GURL wallpaper_url;
@@ -852,7 +852,7 @@ void ServicesCustomizationDocument::CheckAndApplyWallpaper() {
return;
}
- scoped_ptr<bool> exists(new bool(false));
+ std::unique_ptr<bool> exists(new bool(false));
base::Closure check_file_exists =
base::Bind(&CheckWallpaperCacheExists,
@@ -869,8 +869,8 @@ void ServicesCustomizationDocument::CheckAndApplyWallpaper() {
}
void ServicesCustomizationDocument::OnCheckedWallpaperCacheExists(
- scoped_ptr<bool> exists,
- scoped_ptr<ServicesCustomizationDocument::ApplyingTask> applying) {
+ std::unique_ptr<bool> exists,
+ std::unique_ptr<ServicesCustomizationDocument::ApplyingTask> applying) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(exists);
DCHECK(applying);
@@ -880,7 +880,7 @@ void ServicesCustomizationDocument::OnCheckedWallpaperCacheExists(
void ServicesCustomizationDocument::ApplyWallpaper(
bool default_wallpaper_file_exists,
- scoped_ptr<ServicesCustomizationDocument::ApplyingTask> applying) {
+ std::unique_ptr<ServicesCustomizationDocument::ApplyingTask> applying) {
GURL wallpaper_url;
const bool wallpaper_url_present = GetDefaultWallpaperUrl(&wallpaper_url);
@@ -925,7 +925,7 @@ void ServicesCustomizationDocument::ApplyWallpaper(
}
void ServicesCustomizationDocument::OnOEMWallpaperDownloaded(
- scoped_ptr<ServicesCustomizationDocument::ApplyingTask> applying,
+ std::unique_ptr<ServicesCustomizationDocument::ApplyingTask> applying,
bool success,
const GURL& wallpaper_url) {
if (success) {

Powered by Google App Engine
This is Rietveld 408576698