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

Unified Diff: base/trace_event/trace_event_argument.h

Issue 1451943002: Make base::trace_event::TracedValue use StringPiece where possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | base/trace_event/trace_event_argument.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_argument.h
diff --git a/base/trace_event/trace_event_argument.h b/base/trace_event/trace_event_argument.h
index 55d5ca33feea1d5c8a7b7965f00b4f975a02f1af..dbdd67f9fcb1248ce4dab1d457ec9864f85386bf 100644
--- a/base/trace_event/trace_event_argument.h
+++ b/base/trace_event/trace_event_argument.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/pickle.h"
+#include "base/strings/string_piece.h"
#include "base/trace_event/trace_event_impl.h"
namespace base {
@@ -30,26 +31,26 @@ class BASE_EXPORT TracedValue : public ConvertableToTraceFormat {
void SetInteger(const char* name, int value);
void SetDouble(const char* name, double value);
void SetBoolean(const char* name, bool value);
- void SetString(const char* name, const std::string& value);
+ void SetString(const char* name, base::StringPiece value);
void SetValue(const char* name, const TracedValue& value);
void BeginDictionary(const char* name);
void BeginArray(const char* name);
// These, instead, can be safely passed a temporary string.
- void SetIntegerWithCopiedName(const std::string& name, int value);
- void SetDoubleWithCopiedName(const std::string& name, double value);
- void SetBooleanWithCopiedName(const std::string& name, bool value);
- void SetStringWithCopiedName(const std::string& name,
- const std::string& value);
- void SetValueWithCopiedName(const std::string& name,
+ void SetIntegerWithCopiedName(base::StringPiece name, int value);
+ void SetDoubleWithCopiedName(base::StringPiece name, double value);
+ void SetBooleanWithCopiedName(base::StringPiece name, bool value);
+ void SetStringWithCopiedName(base::StringPiece name,
+ base::StringPiece value);
+ void SetValueWithCopiedName(base::StringPiece name,
const TracedValue& value);
- void BeginDictionaryWithCopiedName(const std::string& name);
- void BeginArrayWithCopiedName(const std::string& name);
+ void BeginDictionaryWithCopiedName(base::StringPiece name);
+ void BeginArrayWithCopiedName(base::StringPiece name);
void AppendInteger(int);
void AppendDouble(double);
void AppendBoolean(bool);
- void AppendString(const std::string&);
+ void AppendString(base::StringPiece);
void BeginArray();
void BeginDictionary();
@@ -63,7 +64,7 @@ class BASE_EXPORT TracedValue : public ConvertableToTraceFormat {
// TODO(primiano): migrate the (three) existing clients to the cheaper
// SetValue(TracedValue) API. crbug.com/495628.
void SetValue(const char* name, scoped_ptr<base::Value> value);
- void SetBaseValueWithCopiedName(const std::string& name,
+ void SetBaseValueWithCopiedName(base::StringPiece name,
const base::Value& value);
void AppendBaseValue(const base::Value& value);
« no previous file with comments | « no previous file | base/trace_event/trace_event_argument.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698