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

Unified Diff: media/formats/mp2t/mp2t_stream_parser.cc

Issue 1553493002: Global conversion of Pass()→std::move() on OS=linux chromecast=1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix fragile include order Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/common/stream_parser_test_base.cc ('k') | media/formats/mp4/avc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp2t/mp2t_stream_parser.cc
diff --git a/media/formats/mp2t/mp2t_stream_parser.cc b/media/formats/mp2t/mp2t_stream_parser.cc
index 37d4797fa9229338a431e0cd8733e3131c221891..8ebe5a5399d9dc1646406c20608c49d4cfdcaaa0 100644
--- a/media/formats/mp2t/mp2t_stream_parser.cc
+++ b/media/formats/mp2t/mp2t_stream_parser.cc
@@ -4,6 +4,8 @@
#include "media/formats/mp2t/mp2t_stream_parser.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/stl_util.h"
@@ -72,13 +74,14 @@ class PidState {
int continuity_counter_;
};
-PidState::PidState(int pid, PidType pid_type,
+PidState::PidState(int pid,
+ PidType pid_type,
scoped_ptr<TsSection> section_parser)
- : pid_(pid),
- pid_type_(pid_type),
- section_parser_(section_parser.Pass()),
- enable_(false),
- continuity_counter_(-1) {
+ : pid_(pid),
+ pid_type_(pid_type),
+ section_parser_(std::move(section_parser)),
+ enable_(false),
+ continuity_counter_(-1) {
DCHECK(section_parser_);
}
@@ -281,9 +284,8 @@ bool Mp2tStreamParser::Parse(const uint8_t* buf, int size) {
new TsSectionPat(
base::Bind(&Mp2tStreamParser::RegisterPmt,
base::Unretained(this))));
- scoped_ptr<PidState> pat_pid_state(
- new PidState(ts_packet->pid(), PidState::kPidPat,
- pat_section_parser.Pass()));
+ scoped_ptr<PidState> pat_pid_state(new PidState(
+ ts_packet->pid(), PidState::kPidPat, std::move(pat_section_parser)));
pat_pid_state->Enable();
it = pids_.insert(
std::pair<int, PidState*>(ts_packet->pid(),
@@ -330,7 +332,7 @@ void Mp2tStreamParser::RegisterPmt(int program_number, int pmt_pid) {
base::Bind(&Mp2tStreamParser::RegisterPes,
base::Unretained(this), pmt_pid)));
scoped_ptr<PidState> pmt_pid_state(
- new PidState(pmt_pid, PidState::kPidPmt, pmt_section_parser.Pass()));
+ new PidState(pmt_pid, PidState::kPidPmt, std::move(pmt_section_parser)));
pmt_pid_state->Enable();
pids_.insert(std::pair<int, PidState*>(pmt_pid, pmt_pid_state.release()));
}
@@ -384,11 +386,11 @@ void Mp2tStreamParser::RegisterPes(int pmt_pid,
// Create the PES state here.
DVLOG(1) << "Create a new PES state";
scoped_ptr<TsSection> pes_section_parser(
- new TsSectionPes(es_parser.Pass(), &timestamp_unroller_));
+ new TsSectionPes(std::move(es_parser), &timestamp_unroller_));
PidState::PidType pid_type =
is_audio ? PidState::kPidAudioPes : PidState::kPidVideoPes;
scoped_ptr<PidState> pes_pid_state(
- new PidState(pes_pid, pid_type, pes_section_parser.Pass()));
+ new PidState(pes_pid, pid_type, std::move(pes_section_parser)));
pids_.insert(std::pair<int, PidState*>(pes_pid, pes_pid_state.release()));
// A new PES pid has been added, the PID filter might change.
« no previous file with comments | « media/formats/common/stream_parser_test_base.cc ('k') | media/formats/mp4/avc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698