summaryrefslogtreecommitdiffstats
path: root/media/cast
diff options
context:
space:
mode:
authorestade <estade@chromium.org>2015-05-15 18:02:34 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-16 01:02:46 +0000
commit8d04646294767ea1f3a7da596547b465d50cb4d1 (patch)
tree6bd6194b6fe2ac226114f9125570bd605e9b6d42 /media/cast
parentf39e5aff5aae8451a7ef190a2fc822bf80c4e30d (diff)
downloadchromium_src-8d04646294767ea1f3a7da596547b465d50cb4d1.zip
chromium_src-8d04646294767ea1f3a7da596547b465d50cb4d1.tar.gz
chromium_src-8d04646294767ea1f3a7da596547b465d50cb4d1.tar.bz2
Convert JsonWriter::Write to taking a const ref for the in-param
Clearer API; flushes out a lot of unnecessary heap allocations. depends on https://codereview.chromium.org/1129083003/ BUG=none Review URL: https://codereview.chromium.org/1131113004 Cr-Commit-Position: refs/heads/master@{#330255}
Diffstat (limited to 'media/cast')
-rw-r--r--media/cast/sender/fake_software_video_encoder.cc2
-rw-r--r--media/cast/test/sender.cc4
-rw-r--r--media/cast/test/simulator.cc2
3 files changed, 4 insertions, 4 deletions
diff --git a/media/cast/sender/fake_software_video_encoder.cc b/media/cast/sender/fake_software_video_encoder.cc
index 7a2a333..0cd0139 100644
--- a/media/cast/sender/fake_software_video_encoder.cc
+++ b/media/cast/sender/fake_software_video_encoder.cc
@@ -57,7 +57,7 @@ void FakeSoftwareVideoEncoder::Encode(
values.SetInteger("ref", encoded_frame->referenced_frame_id);
values.SetInteger("id", encoded_frame->frame_id);
values.SetInteger("size", frame_size_);
- base::JSONWriter::Write(&values, &encoded_frame->data);
+ base::JSONWriter::Write(values, &encoded_frame->data);
encoded_frame->data.resize(
std::max<size_t>(encoded_frame->data.size(), frame_size_), ' ');
}
diff --git a/media/cast/test/sender.cc b/media/cast/test/sender.cc
index e34ecf1..7398698 100644
--- a/media/cast/test/sender.cc
+++ b/media/cast/test/sender.cc
@@ -187,13 +187,13 @@ void WriteStatsAndDestroySubscribers(
scoped_ptr<base::DictionaryValue> stats = video_event_subscriber->GetStats();
std::string json;
base::JSONWriter::WriteWithOptions(
- stats.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &json);
+ *stats, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json);
VLOG(0) << "Video stats: " << json;
stats = audio_event_subscriber->GetStats();
json.clear();
base::JSONWriter::WriteWithOptions(
- stats.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &json);
+ *stats, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json);
VLOG(0) << "Audio stats: " << json;
}
diff --git a/media/cast/test/simulator.cc b/media/cast/test/simulator.cc
index 6c277d5..a3a560e 100644
--- a/media/cast/test/simulator.cc
+++ b/media/cast/test/simulator.cc
@@ -766,7 +766,7 @@ int main(int argc, char** argv) {
values.SetString("sim-id", sim_id);
std::string extra_data;
- base::JSONWriter::Write(&values, &extra_data);
+ base::JSONWriter::Write(values, &extra_data);
// Run.
media::cast::RunSimulation(source_path, log_output_path, metrics_output_path,