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

Unified Diff: base/debug/trace_event.cc

Issue 7397021: Re-land r93365 - add RefCountedString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased onto r93582 Created 9 years, 5 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: base/debug/trace_event.cc
diff --git a/base/debug/trace_event.cc b/base/debug/trace_event.cc
index cc8c49c520dbebb825f071bad434d90833806dbe..d467055be9646f6aea8216eaf80f89a0b68a48e4 100644
--- a/base/debug/trace_event.cc
+++ b/base/debug/trace_event.cc
@@ -12,6 +12,7 @@
#include "base/process_util.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
+#include "base/stl_util.h"
#include "base/time.h"
#define USE_UNRELIABLE_NOW
@@ -170,9 +171,9 @@ TraceEvent::TraceEvent(unsigned long process_id,
alloc_size += GetAllocLength(arg2_val.as_string());
if (alloc_size) {
- parameter_copy_storage_ = new RefCountedBytes;
- parameter_copy_storage_->data.resize(alloc_size);
- char* ptr = reinterpret_cast<char*>(&parameter_copy_storage_->data[0]);
+ parameter_copy_storage_ = new base::RefCountedString;
+ parameter_copy_storage_->data().resize(alloc_size);
+ char* ptr = string_as_array(&parameter_copy_storage_->data());
const char* end = ptr + alloc_size;
if (copy) {
CopyTraceEventParameter(&ptr, &name_, end);

Powered by Google App Engine
This is Rietveld 408576698