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

Unified Diff: chrome/browser/devtools/devtools_embedder_message_dispatcher.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various builds. Created 4 years, 7 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/devtools/devtools_embedder_message_dispatcher.cc
diff --git a/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc b/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc
index d15f47a9ea823a758032ab068e491edad4683947..0c99c3a131e23dfef39194d42f7426b8eb5949ed 100644
--- a/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc
+++ b/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc
@@ -11,21 +11,21 @@ namespace {
using DispatchCallback = DevToolsEmbedderMessageDispatcher::DispatchCallback;
-bool GetValue(const base::Value* value, std::string* result) {
- return value->GetAsString(result);
+bool GetValue(const base::Value& value, std::string* result) {
+ return value.GetAsString(result);
}
-bool GetValue(const base::Value* value, int* result) {
- return value->GetAsInteger(result);
+bool GetValue(const base::Value& value, int* result) {
+ return value.GetAsInteger(result);
}
-bool GetValue(const base::Value* value, bool* result) {
- return value->GetAsBoolean(result);
+bool GetValue(const base::Value& value, bool* result) {
+ return value.GetAsBoolean(result);
}
-bool GetValue(const base::Value* value, gfx::Rect* rect) {
+bool GetValue(const base::Value& value, gfx::Rect* rect) {
const base::DictionaryValue* dict;
- if (!value->GetAsDictionary(&dict))
+ if (!value.GetAsDictionary(&dict))
return false;
int x = 0;
int y = 0;
@@ -67,7 +67,8 @@ template <typename T, typename... Ts>
struct ParamTuple<T, Ts...> {
bool Parse(const base::ListValue& list,
const base::ListValue::const_iterator& it) {
- return it != list.end() && GetValue(*it, &head) && tail.Parse(list, it + 1);
+ return it != list.end() && GetValue(**it, &head) &&
+ tail.Parse(list, it + 1);
}
template <typename H, typename... As>

Powered by Google App Engine
This is Rietveld 408576698