summaryrefslogtreecommitdiffstats
path: root/cc/debug/traced_value.h
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 04:25:02 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 04:25:02 +0000
commitdb144e7ce2db08607d7e9348f20824a9cd592585 (patch)
treef7e354800c372782d67fef69db4bab5419540ca4 /cc/debug/traced_value.h
parent0b05803f198b77967a24148e3cc42e5ec0444d82 (diff)
downloadchromium_src-db144e7ce2db08607d7e9348f20824a9cd592585.zip
chromium_src-db144e7ce2db08607d7e9348f20824a9cd592585.tar.gz
chromium_src-db144e7ce2db08607d7e9348f20824a9cd592585.tar.bz2
Make ConvertableToTraceFormat ref-counted
Previously though TraceEvent is copyable, the copy has side-effect that will clear the convertable pointers in the source TraceEvent. This hadn't been a problem before https://codereview.chromium.org/23531042/ which added TraceBuffer::Clone() so exposed the potential problem. Make ConvertableToTraceFormat ref-counted to allow copying of TraceEvents. This also simplifies the client code and trace_event.h because scoped_refptrs can be assigned just like other types of variables. TEST=existing tests BUG=none Review URL: https://codereview.chromium.org/26266003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug/traced_value.h')
-rw-r--r--cc/debug/traced_value.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/cc/debug/traced_value.h b/cc/debug/traced_value.h
index 148aca8..fe17695 100644
--- a/cc/debug/traced_value.h
+++ b/cc/debug/traced_value.h
@@ -26,15 +26,14 @@ class TracedValue : public base::debug::ConvertableToTraceFormat {
base::DictionaryValue* dict,
const char* object_name,
const void* id);
- static scoped_ptr<ConvertableToTraceFormat> FromValue(
+ static scoped_refptr<base::debug::ConvertableToTraceFormat> FromValue(
base::Value* value);
- virtual ~TracedValue();
-
virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE;
private:
explicit TracedValue(base::Value* value);
+ virtual ~TracedValue();
scoped_ptr<base::Value> value_;