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

Unified Diff: chrome/browser/ui/webui/predictors/predictors_handler.cc

Issue 2820823005: Revert of Stop passing raw pointers to base::Value API in c/b/ui (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/ui/webui/predictors/predictors_handler.cc
diff --git a/chrome/browser/ui/webui/predictors/predictors_handler.cc b/chrome/browser/ui/webui/predictors/predictors_handler.cc
index d9dce056699c2e72ac19793b8f2751a516b2ec64..bd03c65f205d354fadcc992c19ef796e640646b0 100644
--- a/chrome/browser/ui/webui/predictors/predictors_handler.cc
+++ b/chrome/browser/ui/webui/predictors/predictors_handler.cc
@@ -9,7 +9,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "chrome/browser/predictors/autocomplete_action_predictor.h"
#include "chrome/browser/predictors/autocomplete_action_predictor_factory.h"
@@ -69,7 +68,7 @@
base::DictionaryValue dict;
dict.SetBoolean("enabled", enabled);
if (enabled) {
- auto db = base::MakeUnique<base::ListValue>();
+ base::ListValue* db = new base::ListValue();
for (AutocompleteActionPredictor::DBCacheMap::const_iterator it =
autocomplete_action_predictor_->db_cache_.begin();
it != autocomplete_action_predictor_->db_cache_.end();
@@ -83,7 +82,7 @@
autocomplete_action_predictor_->CalculateConfidenceForDbEntry(it));
db->Append(std::move(entry));
}
- dict.Set("db", std::move(db));
+ dict.Set("db", db);
}
web_ui()->CallJavascriptFunctionUnsafe("updateAutocompleteActionPredictorDb",
@@ -98,15 +97,15 @@
if (enabled) {
// Url Database cache.
- auto db = base::MakeUnique<base::ListValue>();
+ base::ListValue* db = new base::ListValue();
AddPrefetchDataMapToListValue(
- *resource_prefetch_predictor_->url_table_cache_, db.get());
- dict.Set("url_db", std::move(db));
+ *resource_prefetch_predictor_->url_table_cache_, db);
+ dict.Set("url_db", db);
- db = base::MakeUnique<base::ListValue>();
+ db = new base::ListValue();
AddPrefetchDataMapToListValue(
- *resource_prefetch_predictor_->host_table_cache_, db.get());
- dict.Set("host_db", std::move(db));
+ *resource_prefetch_predictor_->host_table_cache_, db);
+ dict.Set("host_db", db);
}
web_ui()->CallJavascriptFunctionUnsafe("updateResourcePrefetchPredictorDb",
@@ -119,7 +118,7 @@
for (const auto& p : data_map) {
std::unique_ptr<base::DictionaryValue> main(new base::DictionaryValue());
main->SetString("main_frame_url", p.first);
- auto resources = base::MakeUnique<base::ListValue>();
+ base::ListValue* resources = new base::ListValue();
for (const predictors::ResourceData& r : p.second.resources()) {
std::unique_ptr<base::DictionaryValue> resource(
new base::DictionaryValue());
@@ -137,7 +136,7 @@
resource_prefetch_predictor_->IsResourcePrefetchable(r));
resources->Append(std::move(resource));
}
- main->Set("resources", std::move(resources));
+ main->Set("resources", resources);
db->Append(std::move(main));
}
}
« no previous file with comments | « chrome/browser/ui/webui/policy_ui_handler.cc ('k') | chrome/browser/ui/webui/settings/certificates_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698