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

Side by Side Diff: lib/html/src/dartium_FactoryProviders.dart

Issue 10915245: Removing interfaces from dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporating review feedback. Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class _AudioContextFactoryProvider { 5 class _AudioContextFactoryProvider {
6 factory AudioContext() => _createAudioContext(); 6 static AudioContext createAudioContext() => _createAudioContext();
7 static _createAudioContext([int numberOfChannels, 7 static _createAudioContext([int numberOfChannels,
8 int numberOfFrames, 8 int numberOfFrames,
9 int sampleRate]) 9 int sampleRate])
10 native "AudioContext_constructor_Callback"; 10 native "AudioContext_constructor_Callback";
11 } 11 }
12 12
13 class _IDBKeyRangeFactoryProvider { 13 class _IDBKeyRangeFactoryProvider {
14 14
15 factory IDBKeyRange.only(/*IDBKey*/ value) => 15 static IDBKeyRange createIDBKeyRange_only(/*IDBKey*/ value) =>
16 _IDBKeyRangeImpl.only(value); 16 _IDBKeyRangeImpl.only(value);
17 17
18 factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) => 18 static IDBKeyRange createIDBKeyRange_lowerBound(
19 /*IDBKey*/ bound, [bool open = false]) =>
19 _IDBKeyRangeImpl.lowerBound(bound, open); 20 _IDBKeyRangeImpl.lowerBound(bound, open);
20 21
21 factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) => 22 static IDBKeyRange createIDBKeyRange_upperBound(
23 /*IDBKey*/ bound, [bool open = false]) =>
22 _IDBKeyRangeImpl.upperBound(bound, open); 24 _IDBKeyRangeImpl.upperBound(bound, open);
23 25
24 factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper, 26 static IDBKeyRange createIDBKeyRange_bound(
25 [bool lowerOpen = false, bool upperOpen = false]) => 27 /*IDBKey*/ lower, /*IDBKey*/ upper,
28 [bool lowerOpen = false, bool upperOpen = false]) =>
26 _IDBKeyRangeImpl.bound(lower, upper, lowerOpen, upperOpen); 29 _IDBKeyRangeImpl.bound(lower, upper, lowerOpen, upperOpen);
27 } 30 }
28 31
29 class _TypedArrayFactoryProvider { 32 class _TypedArrayFactoryProvider {
30 factory Float32Array(int length) => _F32(length); 33 static Float32Array createFloat32Array(int length) => _F32(length);
31 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list)); 34 static Float32Array createFloat32Array_fromList(List<num> list) =>
32 factory Float32Array.fromBuffer(ArrayBuffer buffer, 35 _F32(ensureNative(list));
33 [int byteOffset = 0, int length]) => 36 static Float32Array createFloat32Array_fromBuffer(ArrayBuffer buffer,
34 _F32(buffer, byteOffset, length); 37 [int byteOffset = 0, int length]) => _F32(buffer, byteOffset, length);
35 static _F32(arg0, [arg1, arg2]) native "Float32Array_constructor_Callback"; 38 static _F32(arg0, [arg1, arg2]) native "Float32Array_constructor_Callback";
36 39
37 factory Float64Array(int length) => _F64(length); 40 static Float64Array createFloat64Array(int length) => _F64(length);
38 factory Float64Array.fromList(List<num> list) => _F64(ensureNative(list)); 41 static Float64Array createFloat64Array_fromList(List<num> list) =>
39 factory Float64Array.fromBuffer(ArrayBuffer buffer, 42 _F64(ensureNative(list));
40 [int byteOffset = 0, int length]) => 43 static Float64Array createFloat64Array_fromBuffer(ArrayBuffer buffer,
41 _F64(buffer, byteOffset, length); 44 [int byteOffset = 0, int length]) => _F64(buffer, byteOffset, length);
42 static _F64(arg0, [arg1, arg2]) native "Float64Array_constructor_Callback"; 45 static _F64(arg0, [arg1, arg2]) native "Float64Array_constructor_Callback";
43 46
44 factory Int8Array(int length) => _I8(length); 47 static Int8Array createInt8Array(int length) => _I8(length);
45 factory Int8Array.fromList(List<num> list) => _I8(ensureNative(list)); 48 static Int8Array createInt8Array_fromList(List<num> list) =>
46 factory Int8Array.fromBuffer(ArrayBuffer buffer, 49 _I8(ensureNative(list));
47 [int byteOffset = 0, int length]) => 50 static Int8Array createInt8Array_fromBuffer(ArrayBuffer buffer,
48 _I8(buffer, byteOffset, length); 51 [int byteOffset = 0, int length]) => _I8(buffer, byteOffset, length);
49 static _I8(arg0, [arg1, arg2]) native "Int8Array_constructor_Callback"; 52 static _I8(arg0, [arg1, arg2]) native "Int8Array_constructor_Callback";
50 53
51 factory Int16Array(int length) => _I16(length); 54 static Int16Array createInt16Array(int length) => _I16(length);
52 factory Int16Array.fromList(List<num> list) => _I16(ensureNative(list)); 55 static Int16Array createInt16Array_fromList(List<num> list) =>
53 factory Int16Array.fromBuffer(ArrayBuffer buffer, 56 _I16(ensureNative(list));
54 [int byteOffset = 0, int length]) => 57 static Int16Array createInt16Array_fromBuffer(ArrayBuffer buffer,
55 _I16(buffer, byteOffset, length); 58 [int byteOffset = 0, int length]) => _I16(buffer, byteOffset, length);
56 static _I16(arg0, [arg1, arg2]) native "Int16Array_constructor_Callback"; 59 static _I16(arg0, [arg1, arg2]) native "Int16Array_constructor_Callback";
57 60
58 factory Int32Array(int length) => _I32(length); 61 static Int32Array createInt32Array(int length) => _I32(length);
59 factory Int32Array.fromList(List<num> list) => _I32(ensureNative(list)); 62 static Int32Array createInt32Array_fromList(List<num> list) =>
60 factory Int32Array.fromBuffer(ArrayBuffer buffer, 63 _I32(ensureNative(list));
61 [int byteOffset = 0, int length]) => 64 static Int32Array createInt32Array_fromBuffer(ArrayBuffer buffer,
62 _I32(buffer, byteOffset, length); 65 [int byteOffset = 0, int length]) => _I32(buffer, byteOffset, length);
63 static _I32(arg0, [arg1, arg2]) native "Int32Array_constructor_Callback"; 66 static _I32(arg0, [arg1, arg2]) native "Int32Array_constructor_Callback";
64 67
65 factory Uint8Array(int length) => _U8(length); 68 static Uint8Array createUint8Array(int length) => _U8(length);
66 factory Uint8Array.fromList(List<num> list) => _U8(ensureNative(list)); 69 static Uint8Array createUint8Array_fromList(List<num> list) =>
67 factory Uint8Array.fromBuffer(ArrayBuffer buffer, 70 _U8(ensureNative(list));
68 [int byteOffset = 0, int length]) => 71 static Uint8Array createUint8Array_fromBuffer(ArrayBuffer buffer,
69 _U8(buffer, byteOffset, length); 72 [int byteOffset = 0, int length]) => _U8(buffer, byteOffset, length);
70 static _U8(arg0, [arg1, arg2]) native "Uint8Array_constructor_Callback"; 73 static _U8(arg0, [arg1, arg2]) native "Uint8Array_constructor_Callback";
71 74
72 factory Uint16Array(int length) => _U16(length); 75 static Uint16Array createUint16Array(int length) => _U16(length);
73 factory Uint16Array.fromList(List<num> list) => _U16(ensureNative(list)); 76 static Uint16Array createUint16Array_fromList(List<num> list) =>
74 factory Uint16Array.fromBuffer(ArrayBuffer buffer, 77 _U16(ensureNative(list));
75 [int byteOffset = 0, int length]) => 78 static Uint16Array createUint16Array_fromBuffer(ArrayBuffer buffer,
76 _U16(buffer, byteOffset, length); 79 [int byteOffset = 0, int length]) => _U16(buffer, byteOffset, length);
77 static _U16(arg0, [arg1, arg2]) native "Uint16Array_constructor_Callback"; 80 static _U16(arg0, [arg1, arg2]) native "Uint16Array_constructor_Callback";
78 81
79 factory Uint32Array(int length) => _U32(length); 82 static Uint32Array createUint32Array(int length) => _U32(length);
80 factory Uint32Array.fromList(List<num> list) => _U32(ensureNative(list)); 83 static Uint32Array createUint32Array_fromList(List<num> list) =>
81 factory Uint32Array.fromBuffer(ArrayBuffer buffer, 84 _U32(ensureNative(list));
82 [int byteOffset = 0, int length]) => 85 static Uint32Array createUint32Array_fromBuffer(ArrayBuffer buffer,
83 _U32(buffer, byteOffset, length); 86 [int byteOffset = 0, int length]) => _U32(buffer, byteOffset, length);
84 static _U32(arg0, [arg1, arg2]) native "Uint32Array_constructor_Callback"; 87 static _U32(arg0, [arg1, arg2]) native "Uint32Array_constructor_Callback";
85 88
86 factory Uint8ClampedArray(int length) => _U8C(length); 89 static Uint8ClampedArray createUint8ClampedArray(int length) => _U8C(length);
87 factory Uint8ClampedArray.fromList(List<num> list) => _U8C(ensureNative(list)) ; 90 static Uint8ClampedArray createUint8ClampedArrayUint8ClampedArray_fromList(
88 factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer, 91 List<num> list) => _U8C(ensureNative(list));
89 [int byteOffset = 0, int length]) => 92 static Uint8ClampedArray createUint8ClampedArrayUint8ClampedArray_fromBuffer(
93 ArrayBuffer buffer, [int byteOffset = 0, int length]) =>
90 _U8C(buffer, byteOffset, length); 94 _U8C(buffer, byteOffset, length);
91 static _U8C(arg0, [arg1, arg2]) native "Uint8ClampedArray_constructor_Callback "; 95 static _U8C(arg0, [arg1, arg2]) native "Uint8ClampedArray_constructor_Callback ";
92 96
93 static ensureNative(List list) => list; // TODO: make sure. 97 static ensureNative(List list) => list; // TODO: make sure.
94 } 98 }
95 99
96 class _PointFactoryProvider { 100 class _PointFactoryProvider {
97 factory Point(num x, num y) => _createWebKitPoint(x, y); 101 static Point createPoint(num x, num y) => _createWebKitPoint(x, y);
98 static _createWebKitPoint(num x, num y) native "WebKitPoint_constructor_Callba ck"; 102 static _createWebKitPoint(num x, num y) native "WebKitPoint_constructor_Callba ck";
99 } 103 }
100 104
101 class _WebSocketFactoryProvider { 105 class _WebSocketFactoryProvider {
102 factory WebSocket(String url) => _createWebSocket(url); 106 static WebSocket createWebSocket(String url) => _createWebSocket(url);
103 static _createWebSocket(String url) native "WebSocket_constructor_Callback"; 107 static _createWebSocket(String url) native "WebSocket_constructor_Callback";
104 } 108 }
105 109
106 class _TextFactoryProvider { 110 class _TextFactoryProvider {
107 factory Text(String data) => _document.$dom_createTextNode(data); 111 static Text createText(String data) => _document.$dom_createTextNode(data);
108 } 112 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698