Chromium Code Reviews| Index: chrome/browser/media/router/cast_media_sink.cc |
| diff --git a/chrome/browser/media/router/cast_media_sink.cc b/chrome/browser/media/router/cast_media_sink.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4c192f3d43650e819e419fc0ab265ec6f57d4b0e |
| --- /dev/null |
| +++ b/chrome/browser/media/router/cast_media_sink.cc |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/media/router/cast_media_sink.h" |
| + |
| +#include "base/logging.h" |
| + |
| +namespace media_router { |
| + |
| +CastMediaSink::CastMediaSink(const MediaSink::Id& sink_id, |
| + const std::string& name, |
| + const MediaSink::IconType icon_type) |
| + : MediaSink(sink_id, name, icon_type), |
| + capabilities_(0), |
| + cast_channel_id_(0) { |
| + 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.
|
| +} |
| + |
| +CastMediaSink::CastMediaSink(const CastMediaSink& other) = default; |
| + |
| +CastMediaSink::~CastMediaSink() = default; |
| + |
| +// static |
| +const CastMediaSink* CastMediaSink::Cast(const MediaSink* sink) { |
| + DCHECK(sink->type() == MediaSink::SinkType::CAST); |
| + return static_cast<const CastMediaSink*>(sink); |
| +} |
| + |
| +// static |
| +CastMediaSink* CastMediaSink::Cast(MediaSink* sink) { |
| + DCHECK(sink->type() == MediaSink::SinkType::CAST); |
| + return static_cast<CastMediaSink*>(sink); |
| +} |
| + |
| +} // namespace media_router |