OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace media { | 29 namespace media { |
30 class AudioCapturerSource; | 30 class AudioCapturerSource; |
31 class AudioParameters; | 31 class AudioParameters; |
32 class VideoCapturerSource; | 32 class VideoCapturerSource; |
33 namespace cast { | 33 namespace cast { |
34 struct FrameReceiverConfig; | 34 struct FrameReceiverConfig; |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 namespace extensions { | 38 namespace extensions { |
| 39 class ExtensionBindingsSystem; |
39 | 40 |
40 // Native code that handle chrome.webrtc custom bindings. | 41 // Native code that handle chrome.webrtc custom bindings. |
41 class CastStreamingNativeHandler : public ObjectBackedNativeHandler { | 42 class CastStreamingNativeHandler : public ObjectBackedNativeHandler { |
42 public: | 43 public: |
43 explicit CastStreamingNativeHandler(ScriptContext* context); | 44 CastStreamingNativeHandler(ScriptContext* context, |
| 45 ExtensionBindingsSystem* bindings_system); |
44 ~CastStreamingNativeHandler() override; | 46 ~CastStreamingNativeHandler() override; |
45 | 47 |
46 protected: | 48 protected: |
47 // Shut down all sessions and cancel any in-progress operations because the | 49 // Shut down all sessions and cancel any in-progress operations because the |
48 // ScriptContext is about to become invalid. | 50 // ScriptContext is about to become invalid. |
49 void Invalidate() override; | 51 void Invalidate() override; |
50 | 52 |
51 private: | 53 private: |
52 void CreateCastSession( | 54 void CreateCastSession( |
53 const v8::FunctionCallbackInfo<v8::Value>& args); | 55 const v8::FunctionCallbackInfo<v8::Value>& args); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 135 |
134 using UdpTransportMap = std::map<int, std::unique_ptr<CastUdpTransport>>; | 136 using UdpTransportMap = std::map<int, std::unique_ptr<CastUdpTransport>>; |
135 UdpTransportMap udp_transport_map_; | 137 UdpTransportMap udp_transport_map_; |
136 | 138 |
137 v8::Global<v8::Function> create_callback_; | 139 v8::Global<v8::Function> create_callback_; |
138 | 140 |
139 using RtpStreamCallbackMap = std::map<int, v8::Global<v8::Function>>; | 141 using RtpStreamCallbackMap = std::map<int, v8::Global<v8::Function>>; |
140 RtpStreamCallbackMap get_raw_events_callbacks_; | 142 RtpStreamCallbackMap get_raw_events_callbacks_; |
141 RtpStreamCallbackMap get_stats_callbacks_; | 143 RtpStreamCallbackMap get_stats_callbacks_; |
142 | 144 |
| 145 ExtensionBindingsSystem* bindings_system_; |
| 146 |
143 base::WeakPtrFactory<CastStreamingNativeHandler> weak_factory_; | 147 base::WeakPtrFactory<CastStreamingNativeHandler> weak_factory_; |
144 | 148 |
145 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); | 149 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); |
146 }; | 150 }; |
147 | 151 |
148 } // namespace extensions | 152 } // namespace extensions |
149 | 153 |
150 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 154 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
OLD | NEW |