| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/manual_constructor.h" | 10 #include "base/memory/manual_constructor.h" |
| 11 #include "chrome/browser/media/router/media_sink.h" | 11 #include "chrome/browser/media/router/media_sink.h" |
| 12 #include "net/base/ip_address.h" | 12 #include "net/base/ip_address.h" |
| 13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 14 | 14 |
| 15 namespace media_router { | 15 namespace media_router { |
| 16 | 16 |
| 17 // Extra data for DIAL media sink. | 17 // Extra data for DIAL media sink. |
| 18 struct DialSinkExtraData { | 18 struct DialSinkExtraData { |
| 19 net::IPAddress ip_address; | 19 net::IPAddress ip_address; |
| 20 | 20 |
| 21 // Model name of the sink. | 21 // Model name of the sink. |
| 22 std::string model_name; | 22 std::string model_name; |
| 23 | 23 |
| 24 // The base URL used for DIAL operations. | 24 // The base URL used for DIAL operations. |
| 25 GURL app_url; | 25 GURL app_url; |
| 26 | 26 |
| 27 DialSinkExtraData(); | 27 DialSinkExtraData(); |
| 28 // Used by unit test. |
| 29 DialSinkExtraData(const std::string& ip_address, |
| 30 const std::string& model_name, |
| 31 const std::string& app_url); |
| 28 DialSinkExtraData(const DialSinkExtraData& other); | 32 DialSinkExtraData(const DialSinkExtraData& other); |
| 29 ~DialSinkExtraData(); | 33 ~DialSinkExtraData(); |
| 30 | 34 |
| 31 bool operator==(const DialSinkExtraData& other) const; | 35 bool operator==(const DialSinkExtraData& other) const; |
| 32 }; | 36 }; |
| 33 | 37 |
| 34 // Extra data for cast media sink. | 38 // Extra data for cast media sink. |
| 35 struct CastSinkExtraData { | 39 struct CastSinkExtraData { |
| 36 net::IPAddress ip_address; | 40 net::IPAddress ip_address; |
| 37 | 41 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 MediaSinkInternal(const MediaSink& sink, const CastSinkExtraData& cast_data); | 74 MediaSinkInternal(const MediaSink& sink, const CastSinkExtraData& cast_data); |
| 71 | 75 |
| 72 // Used to push instance of this class into vector. | 76 // Used to push instance of this class into vector. |
| 73 MediaSinkInternal(const MediaSinkInternal& other); | 77 MediaSinkInternal(const MediaSinkInternal& other); |
| 74 | 78 |
| 75 ~MediaSinkInternal(); | 79 ~MediaSinkInternal(); |
| 76 | 80 |
| 77 // Used by unit test. | 81 // Used by unit test. |
| 78 MediaSinkInternal& operator=(const MediaSinkInternal& other); | 82 MediaSinkInternal& operator=(const MediaSinkInternal& other); |
| 79 bool operator==(const MediaSinkInternal& other) const; | 83 bool operator==(const MediaSinkInternal& other) const; |
| 84 bool operator!=(const MediaSinkInternal& other) const; |
| 80 | 85 |
| 81 // Used by mojo. | 86 // Used by mojo. |
| 82 void set_sink_id(const MediaSink::Id& sink_id) { sink_.set_sink_id(sink_id); } | 87 void set_sink_id(const MediaSink::Id& sink_id) { sink_.set_sink_id(sink_id); } |
| 83 void set_name(const std::string& name) { sink_.set_name(name); } | 88 void set_name(const std::string& name) { sink_.set_name(name); } |
| 84 void set_description(const std::string& description) { | 89 void set_description(const std::string& description) { |
| 85 sink_.set_description(description); | 90 sink_.set_description(description); |
| 86 } | 91 } |
| 87 void set_domain(const std::string& domain) { sink_.set_domain(domain); } | 92 void set_domain(const std::string& domain) { sink_.set_domain(domain); } |
| 88 void set_icon_type(MediaSink::IconType icon_type) { | 93 void set_icon_type(MediaSink::IconType icon_type) { |
| 89 sink_.set_icon_type(icon_type); | 94 sink_.set_icon_type(icon_type); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 base::ManualConstructor<DialSinkExtraData> dial_data_; | 128 base::ManualConstructor<DialSinkExtraData> dial_data_; |
| 124 | 129 |
| 125 // Set if sink is Cast sink. | 130 // Set if sink is Cast sink. |
| 126 base::ManualConstructor<CastSinkExtraData> cast_data_; | 131 base::ManualConstructor<CastSinkExtraData> cast_data_; |
| 127 }; | 132 }; |
| 128 }; | 133 }; |
| 129 | 134 |
| 130 } // namespace media_router | 135 } // namespace media_router |
| 131 | 136 |
| 132 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ | 137 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ |
| OLD | NEW |