| 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" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/renderer/extensions/object_backed_native_handler.h" | 12 #include "chrome/renderer/extensions/object_backed_native_handler.h" |
| 13 #include "chrome/renderer/extensions/scoped_persistent.h" | 13 #include "chrome/renderer/extensions/scoped_persistent.h" |
| 14 #include "v8/include/v8.h" | 14 #include "v8/include/v8.h" |
| 15 | 15 |
| 16 class CastRtpStream; | 16 class CastRtpStream; |
| 17 class CastUdpTransport; | 17 class CastUdpTransport; |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class BinaryValue; |
| 20 class DictionaryValue; | 21 class DictionaryValue; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace extensions { | 24 namespace extensions { |
| 24 | 25 |
| 25 class ChromeV8Context; | 26 class ChromeV8Context; |
| 26 | 27 |
| 27 // Native code that handle chrome.webrtc custom bindings. | 28 // Native code that handle chrome.webrtc custom bindings. |
| 28 class CastStreamingNativeHandler : public ObjectBackedNativeHandler { | 29 class CastStreamingNativeHandler : public ObjectBackedNativeHandler { |
| 29 public: | 30 public: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 60 // created. | 61 // created. |
| 61 void CallCreateCallback(scoped_ptr<CastRtpStream> stream1, | 62 void CallCreateCallback(scoped_ptr<CastRtpStream> stream1, |
| 62 scoped_ptr<CastRtpStream> stream2, | 63 scoped_ptr<CastRtpStream> stream2, |
| 63 scoped_ptr<CastUdpTransport> udp_transport); | 64 scoped_ptr<CastUdpTransport> udp_transport); |
| 64 | 65 |
| 65 void CallStartCallback(int stream_id); | 66 void CallStartCallback(int stream_id); |
| 66 void CallStopCallback(int stream_id); | 67 void CallStopCallback(int stream_id); |
| 67 void CallErrorCallback(int stream_id, const std::string& message); | 68 void CallErrorCallback(int stream_id, const std::string& message); |
| 68 | 69 |
| 69 void CallGetRawEventsCallback(int transport_id, | 70 void CallGetRawEventsCallback(int transport_id, |
| 70 scoped_ptr<std::string> raw_events); | 71 scoped_ptr<base::BinaryValue> raw_events); |
| 71 void CallGetStatsCallback(int transport_id, | 72 void CallGetStatsCallback(int transport_id, |
| 72 scoped_ptr<base::DictionaryValue> stats); | 73 scoped_ptr<base::DictionaryValue> stats); |
| 73 | 74 |
| 74 // Gets the RTP stream or UDP transport indexed by an ID. | 75 // Gets the RTP stream or UDP transport indexed by an ID. |
| 75 // If not found, returns NULL and throws a V8 exception. | 76 // If not found, returns NULL and throws a V8 exception. |
| 76 CastRtpStream* GetRtpStreamOrThrow(int stream_id) const; | 77 CastRtpStream* GetRtpStreamOrThrow(int stream_id) const; |
| 77 CastUdpTransport* GetUdpTransportOrThrow(int transport_id) const; | 78 CastUdpTransport* GetUdpTransportOrThrow(int transport_id) const; |
| 78 | 79 |
| 79 int last_transport_id_; | 80 int last_transport_id_; |
| 80 | 81 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 93 RtpStreamCallbackMap; | 94 RtpStreamCallbackMap; |
| 94 RtpStreamCallbackMap get_raw_events_callbacks_; | 95 RtpStreamCallbackMap get_raw_events_callbacks_; |
| 95 RtpStreamCallbackMap get_stats_callbacks_; | 96 RtpStreamCallbackMap get_stats_callbacks_; |
| 96 | 97 |
| 97 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); | 98 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 } // namespace extensions | 101 } // namespace extensions |
| 101 | 102 |
| 102 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 103 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
| OLD | NEW |