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

Side by Side Diff: chrome/browser/devtools/devtools_embedder_message_dispatcher.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h" 5 #include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 9
10 namespace { 10 namespace {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 template <typename H, typename... As> 60 template <typename H, typename... As>
61 void Apply(const H& handler, As... args) { 61 void Apply(const H& handler, As... args) {
62 handler.Run(args...); 62 handler.Run(args...);
63 } 63 }
64 }; 64 };
65 65
66 template <typename T, typename... Ts> 66 template <typename T, typename... Ts>
67 struct ParamTuple<T, Ts...> { 67 struct ParamTuple<T, Ts...> {
68 bool Parse(const base::ListValue& list, 68 bool Parse(const base::ListValue& list,
69 const base::ListValue::const_iterator& it) { 69 const base::ListValue::const_iterator& it) {
70 return it != list.end() && GetValue(*it, &head) && tail.Parse(list, it + 1); 70 return it != list.end() && GetValue(**it, &head) &&
71 tail.Parse(list, it + 1);
71 } 72 }
72 73
73 template <typename H, typename... As> 74 template <typename H, typename... As>
74 void Apply(const H& handler, As... args) { 75 void Apply(const H& handler, As... args) {
75 tail.template Apply<H, As..., T>(handler, args..., head); 76 tail.template Apply<H, As..., T>(handler, args..., head);
76 } 77 }
77 78
78 typename StorageTraits<T>::StorageType head; 79 typename StorageTraits<T>::StorageType head;
79 ParamTuple<Ts...> tail; 80 ParamTuple<Ts...> tail;
80 }; 81 };
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 d->RegisterHandler("removePreference", 211 d->RegisterHandler("removePreference",
211 &Delegate::RemovePreference, delegate); 212 &Delegate::RemovePreference, delegate);
212 d->RegisterHandler("clearPreferences", 213 d->RegisterHandler("clearPreferences",
213 &Delegate::ClearPreferences, delegate); 214 &Delegate::ClearPreferences, delegate);
214 d->RegisterHandlerWithCallback("reattach", 215 d->RegisterHandlerWithCallback("reattach",
215 &Delegate::Reattach, delegate); 216 &Delegate::Reattach, delegate);
216 d->RegisterHandler("readyForTest", 217 d->RegisterHandler("readyForTest",
217 &Delegate::ReadyForTest, delegate); 218 &Delegate::ReadyForTest, delegate);
218 return d; 219 return d;
219 } 220 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/devtools_device_discovery.cc ('k') | chrome/browser/devtools/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698