| 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 | 9 |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void StopCastRtpStream( | 41 void StopCastRtpStream( |
| 42 const v8::FunctionCallbackInfo<v8::Value>& args); | 42 const v8::FunctionCallbackInfo<v8::Value>& args); |
| 43 | 43 |
| 44 void DestroyCastUdpTransport( | 44 void DestroyCastUdpTransport( |
| 45 const v8::FunctionCallbackInfo<v8::Value>& args); | 45 const v8::FunctionCallbackInfo<v8::Value>& args); |
| 46 void SetDestinationCastUdpTransport( | 46 void SetDestinationCastUdpTransport( |
| 47 const v8::FunctionCallbackInfo<v8::Value>& args); | 47 const v8::FunctionCallbackInfo<v8::Value>& args); |
| 48 void StopCastUdpTransport( | 48 void StopCastUdpTransport( |
| 49 const v8::FunctionCallbackInfo<v8::Value>& args); | 49 const v8::FunctionCallbackInfo<v8::Value>& args); |
| 50 | 50 |
| 51 void ToggleLogging(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 52 void GetRawEvents(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 53 void GetStats(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 54 |
| 51 // Helper method to call the v8 callback function after a session is | 55 // Helper method to call the v8 callback function after a session is |
| 52 // created. | 56 // created. |
| 53 void CallCreateCallback(scoped_ptr<CastRtpStream> stream1, | 57 void CallCreateCallback(scoped_ptr<CastRtpStream> stream1, |
| 54 scoped_ptr<CastRtpStream> stream2, | 58 scoped_ptr<CastRtpStream> stream2, |
| 55 scoped_ptr<CastUdpTransport> udp_transport); | 59 scoped_ptr<CastUdpTransport> udp_transport); |
| 56 | 60 |
| 57 void CallStartCallback(int stream_id); | 61 void CallStartCallback(int stream_id); |
| 58 void CallStopCallback(int stream_id); | 62 void CallStopCallback(int stream_id); |
| 59 void CallErrorCallback(int stream_id, const std::string& message); | 63 void CallErrorCallback(int stream_id, const std::string& message); |
| 60 | 64 |
| 65 void CallGetRawEventsCallback(int transport_id, |
| 66 scoped_ptr<std::string> raw_events); |
| 67 |
| 61 // Gets the RTP stream or UDP transport indexed by an ID. | 68 // Gets the RTP stream or UDP transport indexed by an ID. |
| 62 // If not found, returns NULL and throws a V8 exception. | 69 // If not found, returns NULL and throws a V8 exception. |
| 63 CastRtpStream* GetRtpStreamOrThrow(int stream_id) const; | 70 CastRtpStream* GetRtpStreamOrThrow(int stream_id) const; |
| 64 CastUdpTransport* GetUdpTransportOrThrow(int transport_id) const; | 71 CastUdpTransport* GetUdpTransportOrThrow(int transport_id) const; |
| 65 | 72 |
| 66 int last_transport_id_; | 73 int last_transport_id_; |
| 67 | 74 |
| 68 typedef std::map<int, linked_ptr<CastRtpStream> > RtpStreamMap; | 75 typedef std::map<int, linked_ptr<CastRtpStream> > RtpStreamMap; |
| 69 RtpStreamMap rtp_stream_map_; | 76 RtpStreamMap rtp_stream_map_; |
| 70 | 77 |
| 71 typedef std::map<int, linked_ptr<CastUdpTransport> > UdpTransportMap; | 78 typedef std::map<int, linked_ptr<CastUdpTransport> > UdpTransportMap; |
| 72 UdpTransportMap udp_transport_map_; | 79 UdpTransportMap udp_transport_map_; |
| 73 | 80 |
| 74 base::WeakPtrFactory<CastStreamingNativeHandler> weak_factory_; | 81 base::WeakPtrFactory<CastStreamingNativeHandler> weak_factory_; |
| 75 | 82 |
| 76 extensions::ScopedPersistent<v8::Function> create_callback_; | 83 extensions::ScopedPersistent<v8::Function> create_callback_; |
| 77 | 84 |
| 85 typedef std::map<int, |
| 86 linked_ptr<extensions::ScopedPersistent<v8::Function> > > |
| 87 RtpStreamCallbackMap; |
| 88 RtpStreamCallbackMap get_raw_events_callbacks_; |
| 89 |
| 78 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); | 90 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); |
| 79 }; | 91 }; |
| 80 | 92 |
| 81 } // namespace extensions | 93 } // namespace extensions |
| 82 | 94 |
| 83 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 95 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
| OLD | NEW |