[Autofill] Remove hide_called_ from AutofillPopupView
[chromium-blink-merge.git] / cc / debug / traced_value.cc
blob637c700552571c2ffe0e63dfe630e0d77cd84283
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.
5 #include "cc/debug/traced_value.h"
7 #include "base/json/json_writer.h"
8 #include "base/strings/stringprintf.h"
9 #include "base/values.h"
11 namespace cc {
13 scoped_ptr<base::Value> TracedValue::CreateIDRef(const void* id) {
14 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
15 res->SetString("id_ref", base::StringPrintf("%p", id));
16 return res.PassAs<base::Value>();
19 void TracedValue::MakeDictIntoImplicitSnapshot(
20 base::DictionaryValue* dict, const char* object_name, const void* id) {
21 dict->SetString("id", base::StringPrintf("%s/%p", object_name, id));
24 scoped_ptr<base::debug::ConvertableToTraceFormat> TracedValue::FromValue(
25 base::Value* value) {
26 TracedValue* ptr = new TracedValue(value);
27 scoped_ptr<TracedValue> result(ptr);
28 return result.PassAs<base::debug::ConvertableToTraceFormat>();
31 TracedValue::TracedValue(base::Value* value)
32 : value_(value) {
35 TracedValue::~TracedValue() {
38 void TracedValue::AppendAsTraceFormat(std::string* out) const {
39 std::string tmp;
40 base::JSONWriter::Write(value_.get(), &tmp);
41 *out += tmp;
44 } // namespace cc