OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/debug/traced_value.h" |
| 6 |
| 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/trace_event/trace_event_argument.h" |
| 9 |
| 10 namespace cc { |
| 11 |
| 12 void TracedValue::AppendIDRef(const void* id, |
| 13 base::trace_event::TracedValue* state) { |
| 14 state->BeginDictionary(); |
| 15 state->SetString("id_ref", base::StringPrintf("%p", id)); |
| 16 state->EndDictionary(); |
| 17 } |
| 18 |
| 19 void TracedValue::SetIDRef(const void* id, |
| 20 base::trace_event::TracedValue* state, |
| 21 const char* name) { |
| 22 state->BeginDictionary(name); |
| 23 state->SetString("id_ref", base::StringPrintf("%p", id)); |
| 24 state->EndDictionary(); |
| 25 } |
| 26 |
| 27 void TracedValue::MakeDictIntoImplicitSnapshot( |
| 28 base::trace_event::TracedValue* dict, |
| 29 const char* object_name, |
| 30 const void* id) { |
| 31 dict->SetString("id", base::StringPrintf("%s/%p", object_name, id)); |
| 32 } |
| 33 |
| 34 void TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
| 35 const char* category, |
| 36 base::trace_event::TracedValue* dict, |
| 37 const char* object_name, |
| 38 const void* id) { |
| 39 dict->SetString("cat", category); |
| 40 MakeDictIntoImplicitSnapshot(dict, object_name, id); |
| 41 } |
| 42 |
| 43 void TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
| 44 const char* category, |
| 45 base::trace_event::TracedValue* dict, |
| 46 const char* object_base_type_name, |
| 47 const char* object_name, |
| 48 const void* id) { |
| 49 dict->SetString("cat", category); |
| 50 dict->SetString("base_type", object_base_type_name); |
| 51 MakeDictIntoImplicitSnapshot(dict, object_name, id); |
| 52 } |
| 53 |
| 54 } // namespace cc |
OLD | NEW |