Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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. | |
| 4 | |
| 5 #include "chrome/browser/media/router/cast_media_sink.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 | |
| 9 namespace media_router { | |
| 10 | |
| 11 CastMediaSink::CastMediaSink(const MediaSink::Id& sink_id, | |
| 12 const std::string& name, | |
| 13 const MediaSink::IconType icon_type) | |
| 14 : MediaSink(sink_id, name, icon_type), | |
| 15 capabilities_(0), | |
| 16 cast_channel_id_(0) { | |
| 17 type_ = SinkType::CAST; | |
|
imcheng
2017/02/08 01:28:08
Can the type be passed into the base constructor?
zhaobin
2017/02/09 00:13:52
Done.
| |
| 18 } | |
| 19 | |
| 20 CastMediaSink::CastMediaSink(const CastMediaSink& other) = default; | |
| 21 | |
| 22 CastMediaSink::~CastMediaSink() = default; | |
| 23 | |
| 24 // static | |
| 25 const CastMediaSink* CastMediaSink::Cast(const MediaSink* sink) { | |
| 26 DCHECK(sink->type() == MediaSink::SinkType::CAST); | |
| 27 return static_cast<const CastMediaSink*>(sink); | |
| 28 } | |
| 29 | |
| 30 // static | |
| 31 CastMediaSink* CastMediaSink::Cast(MediaSink* sink) { | |
| 32 DCHECK(sink->type() == MediaSink::SinkType::CAST); | |
| 33 return static_cast<CastMediaSink*>(sink); | |
| 34 } | |
| 35 | |
| 36 } // namespace media_router | |
| OLD | NEW |