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

Unified Diff: content/browser/devtools/protocol/tracing_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: Applied to tracing Created 6 years, 2 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: content/browser/devtools/protocol/tracing_handler.cc
diff --git a/content/browser/devtools/protocol/tracing_handler.cc b/content/browser/devtools/protocol/tracing_handler.cc
index 3db56293dda72f476847ff279f98a295a61eefa9..41cb0e5d09dfe9b543508e80ca2fbf4cb683bb45 100644
--- a/content/browser/devtools/protocol/tracing_handler.cc
+++ b/content/browser/devtools/protocol/tracing_handler.cc
@@ -80,8 +80,7 @@ void TracingHandler::OnTraceDataCollected(const std::string& trace_fragment) {
}
void TracingHandler::OnTraceComplete() {
- TracingCompleteParams params;
- client_->TracingComplete(params);
+ client_->TracingComplete(TracingCompleteParams::Create().Pass());
}
scoped_refptr<DevToolsProtocol::Response> TracingHandler::Start(
@@ -140,23 +139,21 @@ scoped_refptr<DevToolsProtocol::Response> TracingHandler::GetCategories(
void TracingHandler::OnRecordingEnabled(
scoped_refptr<DevToolsProtocol::Command> command) {
- StartResponse response;
- client_->SendStartResponse(command, response);
+ client_->SendStartResponse(command, StartResponse::Create().Pass());
}
void TracingHandler::OnBufferUsage(float usage) {
- BufferUsageParams params;
- params.set_value(usage);
- client_->BufferUsage(params);
+ client_->BufferUsage(BufferUsageParams::Create().set_value(usage).Pass());
}
void TracingHandler::OnCategoriesReceived(
scoped_refptr<DevToolsProtocol::Command> command,
const std::set<std::string>& category_set) {
- std::vector<std::string> categories(category_set.begin(), category_set.end());
- GetCategoriesResponse response;
- response.set_categories(categories);
- client_->SendGetCategoriesResponse(command, response);
+ ListBuilder<std::string> categories;
+ for (const std::string& category : category_set)
+ categories.push_back(category);
+ client_->SendGetCategoriesResponse(command,
+ GetCategoriesResponse::Create().set_categories(categories.Pass()).Pass());
}
base::debug::TraceOptions TracingHandler::TraceOptionsFromString(

Powered by Google App Engine
This is Rietveld 408576698