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

Side by Side Diff: base/debug/trace_event_impl.cc

Issue 14244010: Correctly handle multiple convertable argument names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « base/debug/trace_event.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/debug/trace_event_impl.h" 5 #include "base/debug/trace_event_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/leak_annotations.h" 10 #include "base/debug/leak_annotations.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 328 }
329 329
330 if (alloc_size) { 330 if (alloc_size) {
331 parameter_copy_storage_ = new RefCountedString; 331 parameter_copy_storage_ = new RefCountedString;
332 parameter_copy_storage_->data().resize(alloc_size); 332 parameter_copy_storage_->data().resize(alloc_size);
333 char* ptr = string_as_array(&parameter_copy_storage_->data()); 333 char* ptr = string_as_array(&parameter_copy_storage_->data());
334 const char* end = ptr + alloc_size; 334 const char* end = ptr + alloc_size;
335 if (copy) { 335 if (copy) {
336 CopyTraceEventParameter(&ptr, &name_, end); 336 CopyTraceEventParameter(&ptr, &name_, end);
337 for (i = 0; i < num_args; ++i) { 337 for (i = 0; i < num_args; ++i) {
338 if (arg_types_[i] == TRACE_VALUE_TYPE_CONVERTABLE)
339 continue;
340 CopyTraceEventParameter(&ptr, &arg_names_[i], end); 338 CopyTraceEventParameter(&ptr, &arg_names_[i], end);
341 } 339 }
342 } 340 }
343 for (i = 0; i < num_args; ++i) { 341 for (i = 0; i < num_args; ++i) {
344 if (arg_types_[i] == TRACE_VALUE_TYPE_CONVERTABLE) 342 if (arg_types_[i] == TRACE_VALUE_TYPE_CONVERTABLE)
345 continue; 343 continue;
346 if (arg_is_copy[i]) 344 if (arg_is_copy[i])
347 CopyTraceEventParameter(&ptr, &arg_values_[i].as_string, end); 345 CopyTraceEventParameter(&ptr, &arg_values_[i].as_string, end);
348 } 346 }
349 DCHECK_EQ(end, ptr) << "Overrun by " << ptr - end; 347 DCHECK_EQ(end, ptr) << "Overrun by " << ptr - end;
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 NULL, // arg_names 1419 NULL, // arg_names
1422 NULL, // arg_types 1420 NULL, // arg_types
1423 NULL, // arg_values 1421 NULL, // arg_values
1424 NULL, // convertable values 1422 NULL, // convertable values
1425 TRACE_EVENT_FLAG_NONE); // flags 1423 TRACE_EVENT_FLAG_NONE); // flags
1426 } 1424 }
1427 } 1425 }
1428 1426
1429 } // namespace trace_event_internal 1427 } // namespace trace_event_internal
1430 1428
OLDNEW
« no previous file with comments | « base/debug/trace_event.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698