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

Side by Side Diff: content/browser/devtools/protocol/tracing_handler.cc

Issue 2776043002: Revert of DevTools: fix mixed arguments in Tracing.bufferUsage event (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/devtools/protocol/tracing_handler.h" 5 #include "content/browser/devtools/protocol/tracing_handler.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 "TracingStartedInBrowser", TRACE_EVENT_SCOPE_THREAD, 262 "TracingStartedInBrowser", TRACE_EVENT_SCOPE_THREAD,
263 "frameTreeNodeId", frame_tree_node_id_); 263 "frameTreeNodeId", frame_tree_node_id_);
264 if (target_ != Renderer) 264 if (target_ != Renderer)
265 callback->sendSuccess(); 265 callback->sendSuccess();
266 } 266 }
267 267
268 void TracingHandler::OnBufferUsage(float percent_full, 268 void TracingHandler::OnBufferUsage(float percent_full,
269 size_t approximate_event_count) { 269 size_t approximate_event_count) {
270 // TODO(crbug426117): remove set_value once all clients have switched to 270 // TODO(crbug426117): remove set_value once all clients have switched to
271 // the new interface of the event. 271 // the new interface of the event.
272 frontend_->BufferUsage(percent_full, approximate_event_count, percent_full); 272 frontend_->BufferUsage(percent_full, percent_full, approximate_event_count);
273 } 273 }
274 274
275 void TracingHandler::OnCategoriesReceived( 275 void TracingHandler::OnCategoriesReceived(
276 std::unique_ptr<GetCategoriesCallback> callback, 276 std::unique_ptr<GetCategoriesCallback> callback,
277 const std::set<std::string>& category_set) { 277 const std::set<std::string>& category_set) {
278 std::unique_ptr<protocol::Array<std::string>> categories = 278 std::unique_ptr<protocol::Array<std::string>> categories =
279 protocol::Array<std::string>::create(); 279 protocol::Array<std::string>::create();
280 for (const std::string& category : category_set) 280 for (const std::string& category : category_set)
281 categories->addItem(category); 281 categories->addItem(category);
282 callback->sendSuccess(std::move(categories)); 282 callback->sendSuccess(std::move(categories));
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 359
360 std::string mode; 360 std::string mode;
361 if (tracing_dict->GetString(kRecordModeParam, &mode)) 361 if (tracing_dict->GetString(kRecordModeParam, &mode))
362 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-')); 362 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-'));
363 363
364 return base::trace_event::TraceConfig(*tracing_dict); 364 return base::trace_event::TraceConfig(*tracing_dict);
365 } 365 }
366 366
367 } // namespace tracing 367 } // namespace tracing
368 } // namespace protocol 368 } // namespace protocol
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698