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

Side by Side Diff: cc/debug/traced_picture.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « base/values.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/debug/traced_picture.h" 5 #include "cc/debug/traced_picture.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 10
(...skipping 22 matching lines...) Expand all
33 if (is_alias_) 33 if (is_alias_)
34 AppendPictureAlias(out); 34 AppendPictureAlias(out);
35 else 35 else
36 AppendPicture(out); 36 AppendPicture(out);
37 } 37 }
38 38
39 void TracedPicture::AppendPictureAlias(std::string* out) const { 39 void TracedPicture::AppendPictureAlias(std::string* out) const {
40 scoped_ptr<base::DictionaryValue> alias(new base::DictionaryValue()); 40 scoped_ptr<base::DictionaryValue> alias(new base::DictionaryValue());
41 alias->SetString("id_ref", base::StringPrintf("%p", picture_.get())); 41 alias->SetString("id_ref", base::StringPrintf("%p", picture_.get()));
42 42
43 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); 43 base::DictionaryValue res;
44 res->Set("alias", alias.release()); 44 res.Set("alias", alias.release());
45
46 std::string tmp; 45 std::string tmp;
47 base::JSONWriter::Write(res.get(), &tmp); 46 base::JSONWriter::Write(res, &tmp);
48 out->append(tmp); 47 out->append(tmp);
49 } 48 }
50 49
51 void TracedPicture::AppendPicture(std::string* out) const { 50 void TracedPicture::AppendPicture(std::string* out) const {
52 scoped_ptr<base::Value> value = picture_->AsValue();
53 std::string tmp; 51 std::string tmp;
54 base::JSONWriter::Write(value.get(), &tmp); 52 base::JSONWriter::Write(*picture_->AsValue(), &tmp);
55 out->append(tmp); 53 out->append(tmp);
56 } 54 }
57 55
58 } // namespace cc 56 } // namespace cc
OLDNEW
« no previous file with comments | « base/values.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698