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

Unified Diff: content/browser/devtools/protocol/power_handler.cc

Issue 642263004: [DevTools] Make generated protocol structs wrappers around DictionaryValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix that will be needed for browser protocol Created 6 years, 1 month 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: content/browser/devtools/protocol/power_handler.cc
diff --git a/content/browser/devtools/protocol/power_handler.cc b/content/browser/devtools/protocol/power_handler.cc
index c121ac3cf2d5d30d448777b7f3ec0a69b8d99937..c88097b86d7b92c95ce20b62d4927c8f7b0ec921 100644
--- a/content/browser/devtools/protocol/power_handler.cc
+++ b/content/browser/devtools/protocol/power_handler.cc
@@ -25,21 +25,19 @@ void PowerHandler::SetClient(scoped_ptr<Client> client) {
}
void PowerHandler::OnPowerEvent(const PowerEventVector& events) {
- std::vector<PowerEvent> event_list;
+ std::vector<scoped_refptr<PowerEvent>> event_list;
for (const auto& event : events) {
- PowerEvent event_body;
DCHECK(event.type < content::PowerEvent::ID_COUNT);
- event_body.set_type(kPowerTypeNames[event.type]);
// Use internal value to be consistent with Blink's
// monotonicallyIncreasingTime.
- event_body.set_timestamp(event.time.ToInternalValue() /
- static_cast<double>(base::Time::kMicrosecondsPerMillisecond));
- event_body.set_value(event.value);
- event_list.push_back(event_body);
+ double timestamp = event.time.ToInternalValue() /
+ static_cast<double>(base::Time::kMicrosecondsPerMillisecond);
+ event_list.push_back(PowerEvent::Create()
+ ->set_type(kPowerTypeNames[event.type])
+ ->set_timestamp(timestamp)
+ ->set_value(event.value));
}
- DataAvailableParams params;
- params.set_value(event_list);
- client_->DataAvailable(params);
+ client_->DataAvailable(DataAvailableParams::Create()->set_value(event_list));
}
void PowerHandler::Detached() {
« no previous file with comments | « content/browser/devtools/protocol/page_handler.cc ('k') | content/browser/devtools/protocol/tracing_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698