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

Unified Diff: chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js

Issue 83043005: Cast Extensions API: Factory method for creating a cast session (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 7 years, 1 month 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
Index: chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js b/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
new file mode 100644
index 0000000000000000000000000000000000000000..75a402274869988ae65672a3e454fa333fd6ae6f
--- /dev/null
+++ b/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
@@ -0,0 +1,18 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Custom binding for the Cast streaming API.
+
+var binding = require('binding').Binding.create('cast.streaming.session');
+var natives = requireNative('webrtc_natives');
+
+binding.registerCustomHook(function(bindingsAPI, extensionId) {
+ var apiFunctions = bindingsAPI.apiFunctions;
+ apiFunctions.setHandleRequest('create',
+ function(audioTrack, videoTrack, callback) {
+ natives.CreateSession(audioTrack, videoTrack, callback);
Nico 2013/11/27 23:57:12 nit: indent 4 more
+ });
+});
+
+exports.binding = binding.generate();

Powered by Google App Engine
This is Rietveld 408576698