OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CAST_TRANSPORT_HOST_FILTER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_CAST_TRANSPORT_HOST_FILTER_H_ |
6 #define CHROME_BROWSER_MEDIA_CAST_TRANSPORT_HOST_FILTER_H_ | 6 #define CHROME_BROWSER_MEDIA_CAST_TRANSPORT_HOST_FILTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/id_map.h" | 12 #include "base/id_map.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/time/default_tick_clock.h" | 15 #include "base/time/default_tick_clock.h" |
16 #include "content/public/browser/browser_message_filter.h" | 16 #include "content/public/browser/browser_message_filter.h" |
17 #include "media/cast/cast_sender.h" | 17 #include "media/cast/cast_sender.h" |
18 #include "media/cast/logging/logging_defines.h" | 18 #include "media/cast/logging/logging_defines.h" |
19 #include "media/cast/net/cast_transport.h" | 19 #include "media/cast/net/cast_transport.h" |
20 #include "media/cast/net/udp_transport.h" | 20 #include "media/cast/net/udp_transport.h" |
21 | 21 |
22 namespace content { | 22 namespace device { |
23 class PowerSaveBlocker; | 23 class PowerSaveBlocker; |
24 } // namespace content | 24 } // namespace device |
25 | 25 |
26 namespace cast { | 26 namespace cast { |
27 | 27 |
28 class CastTransportHostFilter : public content::BrowserMessageFilter { | 28 class CastTransportHostFilter : public content::BrowserMessageFilter { |
29 public: | 29 public: |
30 CastTransportHostFilter(); | 30 CastTransportHostFilter(); |
31 | 31 |
32 private: | 32 private: |
33 ~CastTransportHostFilter() override; | 33 ~CastTransportHostFilter() override; |
34 | 34 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const net::IPEndPoint& remote_end_point, | 84 const net::IPEndPoint& remote_end_point, |
85 const base::DictionaryValue& options); | 85 const base::DictionaryValue& options); |
86 void OnDelete(int32_t channel_id); | 86 void OnDelete(int32_t channel_id); |
87 | 87 |
88 IDMap<media::cast::CastTransport, IDMapOwnPointer> id_map_; | 88 IDMap<media::cast::CastTransport, IDMapOwnPointer> id_map_; |
89 | 89 |
90 // Clock used by Cast transport. | 90 // Clock used by Cast transport. |
91 base::DefaultTickClock clock_; | 91 base::DefaultTickClock clock_; |
92 | 92 |
93 // While |id_map_| is non-empty, hold an instance of | 93 // While |id_map_| is non-empty, hold an instance of |
94 // content::PowerSaveBlocker. This prevents Chrome from being suspended while | 94 // device::PowerSaveBlocker. This prevents Chrome from being suspended while |
95 // remoting content. | 95 // remoting content. |
96 std::unique_ptr<content::PowerSaveBlocker> power_save_blocker_; | 96 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; |
97 | 97 |
98 base::WeakPtrFactory<CastTransportHostFilter> weak_factory_; | 98 base::WeakPtrFactory<CastTransportHostFilter> weak_factory_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(CastTransportHostFilter); | 100 DISALLOW_COPY_AND_ASSIGN(CastTransportHostFilter); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace cast | 103 } // namespace cast |
104 | 104 |
105 #endif // CHROME_BROWSER_MEDIA_CAST_TRANSPORT_HOST_FILTER_H_ | 105 #endif // CHROME_BROWSER_MEDIA_CAST_TRANSPORT_HOST_FILTER_H_ |
OLD | NEW |