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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void CallCreateCallback(scoped_ptr<CastRtpStream> stream1, | 57 void CallCreateCallback(scoped_ptr<CastRtpStream> stream1, |
58 scoped_ptr<CastRtpStream> stream2, | 58 scoped_ptr<CastRtpStream> stream2, |
59 scoped_ptr<CastUdpTransport> udp_transport); | 59 scoped_ptr<CastUdpTransport> udp_transport); |
60 | 60 |
61 void CallStartCallback(int stream_id); | 61 void CallStartCallback(int stream_id); |
62 void CallStopCallback(int stream_id); | 62 void CallStopCallback(int stream_id); |
63 void CallErrorCallback(int stream_id, const std::string& message); | 63 void CallErrorCallback(int stream_id, const std::string& message); |
64 | 64 |
65 void CallGetRawEventsCallback(int transport_id, | 65 void CallGetRawEventsCallback(int transport_id, |
66 scoped_ptr<std::string> raw_events); | 66 scoped_ptr<std::string> raw_events); |
| 67 void CallGetStatsCallback(int transport_id, scoped_ptr<std::string> stats); |
67 | 68 |
68 // Gets the RTP stream or UDP transport indexed by an ID. | 69 // Gets the RTP stream or UDP transport indexed by an ID. |
69 // If not found, returns NULL and throws a V8 exception. | 70 // If not found, returns NULL and throws a V8 exception. |
70 CastRtpStream* GetRtpStreamOrThrow(int stream_id) const; | 71 CastRtpStream* GetRtpStreamOrThrow(int stream_id) const; |
71 CastUdpTransport* GetUdpTransportOrThrow(int transport_id) const; | 72 CastUdpTransport* GetUdpTransportOrThrow(int transport_id) const; |
72 | 73 |
73 int last_transport_id_; | 74 int last_transport_id_; |
74 | 75 |
75 typedef std::map<int, linked_ptr<CastRtpStream> > RtpStreamMap; | 76 typedef std::map<int, linked_ptr<CastRtpStream> > RtpStreamMap; |
76 RtpStreamMap rtp_stream_map_; | 77 RtpStreamMap rtp_stream_map_; |
77 | 78 |
78 typedef std::map<int, linked_ptr<CastUdpTransport> > UdpTransportMap; | 79 typedef std::map<int, linked_ptr<CastUdpTransport> > UdpTransportMap; |
79 UdpTransportMap udp_transport_map_; | 80 UdpTransportMap udp_transport_map_; |
80 | 81 |
81 base::WeakPtrFactory<CastStreamingNativeHandler> weak_factory_; | 82 base::WeakPtrFactory<CastStreamingNativeHandler> weak_factory_; |
82 | 83 |
83 extensions::ScopedPersistent<v8::Function> create_callback_; | 84 extensions::ScopedPersistent<v8::Function> create_callback_; |
84 | 85 |
85 typedef std::map<int, | 86 typedef std::map<int, |
86 linked_ptr<extensions::ScopedPersistent<v8::Function> > > | 87 linked_ptr<extensions::ScopedPersistent<v8::Function> > > |
87 RtpStreamCallbackMap; | 88 RtpStreamCallbackMap; |
88 RtpStreamCallbackMap get_raw_events_callbacks_; | 89 RtpStreamCallbackMap get_raw_events_callbacks_; |
| 90 RtpStreamCallbackMap get_stats_callbacks_; |
89 | 91 |
90 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); | 92 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); |
91 }; | 93 }; |
92 | 94 |
93 } // namespace extensions | 95 } // namespace extensions |
94 | 96 |
95 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 97 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
OLD | NEW |