Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: chrome/renderer/extensions/webrtc_native_handler.h

Issue 83043005: Cast Extensions API: Factory method for creating a cast session (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed scope Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/extensions/webrtc_native_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/webrtc_native_handler.h
diff --git a/chrome/renderer/extensions/webrtc_native_handler.h b/chrome/renderer/extensions/webrtc_native_handler.h
index d2fcd9fe34b52feb592077cdf4d239ca58594f2f..99d20cc8bda284137a5efd7e94c4d175cb2080e5 100644
--- a/chrome/renderer/extensions/webrtc_native_handler.h
+++ b/chrome/renderer/extensions/webrtc_native_handler.h
@@ -8,7 +8,9 @@
#include <map>
#include "base/memory/linked_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/renderer/extensions/object_backed_native_handler.h"
+#include "chrome/renderer/extensions/scoped_persistent.h"
#include "v8/include/v8.h"
class CastSendTransport;
@@ -25,8 +27,9 @@ class WebRtcNativeHandler : public ObjectBackedNativeHandler {
virtual ~WebRtcNativeHandler();
private:
- void CreateCastSendTransport(
+ void CreateCastSession(
const v8::FunctionCallbackInfo<v8::Value>& args);
+
void DestroyCastSendTransport(
const v8::FunctionCallbackInfo<v8::Value>& args);
void CreateParamsCastSendTransport(
@@ -38,8 +41,6 @@ class WebRtcNativeHandler : public ObjectBackedNativeHandler {
void StopCastSendTransport(
const v8::FunctionCallbackInfo<v8::Value>& args);
- void CreateCastUdpTransport(
- const v8::FunctionCallbackInfo<v8::Value>& args);
void DestroyCastUdpTransport(
const v8::FunctionCallbackInfo<v8::Value>& args);
void StartCastUdpTransport(
@@ -47,6 +48,12 @@ class WebRtcNativeHandler : public ObjectBackedNativeHandler {
void StopCastUdpTransport(
const v8::FunctionCallbackInfo<v8::Value>& args);
+ // Helper method to call the v8 callback function after a session is
+ // created.
+ void CallCreateCallback(scoped_ptr<CastSendTransport> stream1,
+ scoped_ptr<CastSendTransport> stream2,
+ scoped_ptr<CastUdpTransport> udp_transport);
+
// Gets the Send or UDP transport indexed by |transport_id|.
// If not found, returns NULL and throws a V8 exception.
CastSendTransport* GetSendTransportOrThrow(int transport_id) const;
@@ -60,6 +67,10 @@ class WebRtcNativeHandler : public ObjectBackedNativeHandler {
typedef std::map<int, linked_ptr<CastUdpTransport> > UdpTransportMap;
UdpTransportMap udp_transport_map_;
+ base::WeakPtrFactory<WebRtcNativeHandler> weak_factory_;
+
+ extensions::ScopedPersistent<v8::Function> create_callback_;
+
DISALLOW_COPY_AND_ASSIGN(WebRtcNativeHandler);
};
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/extensions/webrtc_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698