| 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_SERVICE_BASE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_SERVICE_BASE_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_SERVICE_BASE_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_SERVICE_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // exists. | 30 // exists. |
| 31 void StartTimer(); | 31 void StartTimer(); |
| 32 | 32 |
| 33 // Helper function to stop |finish_timer_|. | 33 // Helper function to stop |finish_timer_|. |
| 34 void StopTimer(); | 34 void StopTimer(); |
| 35 | 35 |
| 36 // Helper function to restart |finish_timer|. No-op if timer does not exist or | 36 // Helper function to restart |finish_timer|. No-op if timer does not exist or |
| 37 // timer is currently running. | 37 // timer is currently running. |
| 38 void RestartTimer(); | 38 void RestartTimer(); |
| 39 | 39 |
| 40 // Overriden by subclass to report device counts. |
| 41 virtual void RecordDeviceCounts() {} |
| 42 |
| 40 // Time out value for |finish_timer_| | 43 // Time out value for |finish_timer_| |
| 41 int fetch_complete_timeout_secs_; | 44 int fetch_complete_timeout_secs_; |
| 42 | 45 |
| 43 // Sorted sinks from current round of discovery. | 46 // Sorted sinks from current round of discovery. |
| 44 std::set<MediaSinkInternal> current_sinks_; | 47 std::set<MediaSinkInternal> current_sinks_; |
| 45 | 48 |
| 46 // Sorted sinks sent to Media Router Provider in last FetchCompleted(). | 49 // Sorted sinks sent to Media Router Provider in last FetchCompleted(). |
| 47 std::set<MediaSinkInternal> mrp_sinks_; | 50 std::set<MediaSinkInternal> mrp_sinks_; |
| 48 | 51 |
| 49 private: | 52 private: |
| 50 friend class MediaSinkServiceBaseTest; | 53 friend class MediaSinkServiceBaseTest; |
| 51 FRIEND_TEST_ALL_PREFIXES(MediaSinkServiceBaseTest, | 54 FRIEND_TEST_ALL_PREFIXES(MediaSinkServiceBaseTest, |
| 52 TestFetchCompleted_SameSink); | 55 TestFetchCompleted_SameSink); |
| 53 | 56 |
| 54 // Timer for finishing fetching. | 57 // Timer for finishing fetching. |
| 55 std::unique_ptr<base::Timer> finish_timer_; | 58 std::unique_ptr<base::Timer> finish_timer_; |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 } // namespace media_router | 61 } // namespace media_router |
| 59 | 62 |
| 60 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_SERVICE_BASE_H_ | 63 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_SERVICE_BASE_H_ |
| OLD | NEW |