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

Unified Diff: chrome/browser/chromeos/file_system_provider/registry.cc

Issue 2806283002: Revert of Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Created 3 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/file_system_provider/registry.cc
diff --git a/chrome/browser/chromeos/file_system_provider/registry.cc b/chrome/browser/chromeos/file_system_provider/registry.cc
index bc0e4c3ba6155a12d653fafa23aae4a21dbe4746..b7ae09d6dad617aab251d02a9c01b065d9a77527 100644
--- a/chrome/browser/chromeos/file_system_provider/registry.cc
+++ b/chrome/browser/chromeos/file_system_provider/registry.cc
@@ -3,8 +3,6 @@
// found in the LICENSE file.
#include "chrome/browser/chromeos/file_system_provider/registry.h"
-
-#include <utility>
#include "base/files/file_path.h"
#include "base/memory/ptr_util.h"
@@ -50,7 +48,7 @@
void Registry::RememberFileSystem(
const ProvidedFileSystemInfo& file_system_info,
const Watchers& watchers) {
- auto file_system = base::MakeUnique<base::DictionaryValue>();
+ base::DictionaryValue* const file_system = new base::DictionaryValue();
file_system->SetStringWithoutPathExpansion(kPrefKeyFileSystemId,
file_system_info.file_system_id());
file_system->SetStringWithoutPathExpansion(kPrefKeyDisplayName,
@@ -62,30 +60,29 @@
file_system->SetIntegerWithoutPathExpansion(
kPrefKeyOpenedFilesLimit, file_system_info.opened_files_limit());
- auto watchers_value = base::MakeUnique<base::DictionaryValue>();
+ base::DictionaryValue* const watchers_value = new base::DictionaryValue();
+ file_system->SetWithoutPathExpansion(kPrefKeyWatchers, watchers_value);
for (const auto& it : watchers) {
- auto watcher = base::MakeUnique<base::DictionaryValue>();
+ base::DictionaryValue* const watcher = new base::DictionaryValue();
+ watchers_value->SetWithoutPathExpansion(it.second.entry_path.value(),
+ watcher);
watcher->SetStringWithoutPathExpansion(kPrefKeyWatcherEntryPath,
it.second.entry_path.value());
watcher->SetBooleanWithoutPathExpansion(kPrefKeyWatcherRecursive,
it.second.recursive);
watcher->SetStringWithoutPathExpansion(kPrefKeyWatcherLastTag,
it.second.last_tag);
- auto persistent_origins_value = base::MakeUnique<base::ListValue>();
+ base::ListValue* const persistent_origins_value = new base::ListValue();
+ watcher->SetWithoutPathExpansion(kPrefKeyWatcherPersistentOrigins,
+ persistent_origins_value);
for (const auto& subscriber_it : it.second.subscribers) {
// Only persistent subscribers should be stored in persistent storage.
// Other ones should not be restired after a restart.
if (subscriber_it.second.persistent)
persistent_origins_value->AppendString(subscriber_it.first.spec());
}
- watcher->SetWithoutPathExpansion(kPrefKeyWatcherPersistentOrigins,
- std::move(persistent_origins_value));
- watchers_value->SetWithoutPathExpansion(it.second.entry_path.value(),
- std::move(watcher));
- }
- file_system->SetWithoutPathExpansion(kPrefKeyWatchers,
- std::move(watchers_value));
+ }
PrefService* const pref_service = profile_->GetPrefs();
DCHECK(pref_service);
@@ -93,17 +90,16 @@
DictionaryPrefUpdate dict_update(pref_service,
prefs::kFileSystemProviderMounted);
- base::DictionaryValue* file_systems_per_extension_weak = NULL;
+ base::DictionaryValue* file_systems_per_extension = NULL;
if (!dict_update->GetDictionaryWithoutPathExpansion(
- file_system_info.extension_id(), &file_systems_per_extension_weak)) {
- auto file_systems_per_extension = base::MakeUnique<base::DictionaryValue>();
- file_systems_per_extension_weak = file_systems_per_extension.get();
+ file_system_info.extension_id(), &file_systems_per_extension)) {
+ file_systems_per_extension = new base::DictionaryValue();
dict_update->SetWithoutPathExpansion(file_system_info.extension_id(),
- std::move(file_systems_per_extension));
- }
-
- file_systems_per_extension_weak->SetWithoutPathExpansion(
- file_system_info.file_system_id(), std::move(file_system));
+ file_systems_per_extension);
+ }
+
+ file_systems_per_extension->SetWithoutPathExpansion(
+ file_system_info.file_system_id(), file_system);
}
void Registry::ForgetFileSystem(const std::string& extension_id,

Powered by Google App Engine
This is Rietveld 408576698