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

Side by Side Diff: content/shell/renderer/layout_test/leak_detector.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/shell/renderer/layout_test/leak_detector.h" 5 #include "content/shell/renderer/layout_test/leak_detector.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/shell/renderer/layout_test/blink_test_runner.h" 10 #include "content/shell/renderer/layout_test/blink_test_runner.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 if (previous_result_.numberOfLiveResources < result.numberOfLiveResources) { 79 if (previous_result_.numberOfLiveResources < result.numberOfLiveResources) {
80 base::ListValue* list = new base::ListValue(); 80 base::ListValue* list = new base::ListValue();
81 list->AppendInteger(previous_result_.numberOfLiveResources); 81 list->AppendInteger(previous_result_.numberOfLiveResources);
82 list->AppendInteger(result.numberOfLiveResources); 82 list->AppendInteger(result.numberOfLiveResources);
83 detail.Set("numberOfLiveResources", list); 83 detail.Set("numberOfLiveResources", list);
84 } 84 }
85 85
86 if (!detail.empty()) { 86 if (!detail.empty()) {
87 std::string detail_str; 87 std::string detail_str;
88 base::JSONWriter::Write(&detail, &detail_str); 88 base::JSONWriter::Write(detail, &detail_str);
89 report.detail = detail_str; 89 report.detail = detail_str;
90 report.leaked = true; 90 report.leaked = true;
91 } 91 }
92 92
93 previous_result_ = result; 93 previous_result_ = result;
94 test_runner_->ReportLeakDetectionResult(report); 94 test_runner_->ReportLeakDetectionResult(report);
95 } 95 }
96 96
97 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_devtools_frontend.cc ('k') | content/shell/renderer/test_runner/test_interfaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698