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

Unified Diff: tools/dom/templates/html/dart2js/impl_RTCPeerConnection.darttemplate

Issue 12224101: Move RTCPeerConnection to correct location to generate the supported check for (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months 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: tools/dom/templates/html/dart2js/impl_RTCPeerConnection.darttemplate
===================================================================
--- tools/dom/templates/html/dart2js/impl_RTCPeerConnection.darttemplate (revision 18326)
+++ tools/dom/templates/html/dart2js/impl_RTCPeerConnection.darttemplate (working copy)
@@ -1,43 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of $LIBRARYNAME;
-
-$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
- factory $CLASSNAME(Map rtcIceServers, [Map mediaConstraints]) {
- var constructorName = JS('RtcPeerConnection', 'window[#]',
- '${_browserPropertyPrefix}RTCPeerConnection');
- if (?mediaConstraints) {
- return JS('RtcPeerConnection', 'new #(#,#)', constructorName,
- convertDartToNative_SerializedScriptValue(rtcIceServers),
- convertDartToNative_SerializedScriptValue(mediaConstraints));
- } else {
- return JS('RtcPeerConnection', 'new #(#)', constructorName,
- convertDartToNative_SerializedScriptValue(rtcIceServers));
- }
- }
-
- /**
- * Checks if Real Time Communication (RTC) APIs are supported and enabled on
- * the current platform.
- */
-$if DART2JS
- static bool get supported {
- // Currently in Firefox some of the RTC elements are defined but throw an
- // error unless the user has specifically enabled them in their
- // about:config. So we have to construct an element to actually test if RTC
- // is supported at at the given time.
- try {
- var c = new RtcPeerConnection({"iceServers": [ {"url":"stun:foo.com"}]});
- return c is RtcPeerConnection;
- } catch (_) {}
- return false;
- }
-$else
- static bool get supported => true;
-$endif
-$!MEMBERS
-}
-
-
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698