OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MEDIA_SINKS_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // receive results. It can then interpret / process the results accordingly. | 21 // receive results. It can then interpret / process the results accordingly. |
22 class MediaSinksObserver { | 22 class MediaSinksObserver { |
23 public: | 23 public: |
24 // Constructs an observer that will observe for sinks compatible | 24 // Constructs an observer that will observe for sinks compatible |
25 // with |source|. | 25 // with |source|. |
26 MediaSinksObserver(MediaRouter* router, const MediaSource& source); | 26 MediaSinksObserver(MediaRouter* router, const MediaSource& source); |
27 virtual ~MediaSinksObserver(); | 27 virtual ~MediaSinksObserver(); |
28 | 28 |
29 // This function is invoked when the list of sinks compatible | 29 // This function is invoked when the list of sinks compatible |
30 // with |source_| has been updated. | 30 // with |source_| has been updated. |
| 31 // Implementations may not perform operations that modify the Media Router's |
| 32 // observer list. In particular, invoking this observer's destructor within |
| 33 // OnSinksReceived will result in undefined behavior. |
31 virtual void OnSinksReceived(const std::vector<MediaSink>& sinks) {} | 34 virtual void OnSinksReceived(const std::vector<MediaSink>& sinks) {} |
32 | 35 |
33 const MediaSource& source() const { return source_; } | 36 const MediaSource& source() const { return source_; } |
34 | 37 |
35 private: | 38 private: |
36 const MediaSource source_; | 39 const MediaSource source_; |
37 MediaRouter* router_; | 40 MediaRouter* router_; |
38 | 41 |
39 DISALLOW_COPY_AND_ASSIGN(MediaSinksObserver); | 42 DISALLOW_COPY_AND_ASSIGN(MediaSinksObserver); |
40 }; | 43 }; |
41 | 44 |
42 } // namespace media_router | 45 } // namespace media_router |
43 | 46 |
44 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_ | 47 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_ |
OLD | NEW |