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

Unified Diff: sdk/lib/html/src/dart2js_Conversions.dart

Issue 11691009: Moved most of html lib generating scripts into tools. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « sdk/lib/html/src/_Testing.dart ('k') | sdk/lib/html/src/dart2js_DOMImplementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/src/dart2js_Conversions.dart
diff --git a/sdk/lib/html/src/dart2js_Conversions.dart b/sdk/lib/html/src/dart2js_Conversions.dart
deleted file mode 100644
index 8b75d7176d4aa001c6e558061dc307e6b2a8878f..0000000000000000000000000000000000000000
--- a/sdk/lib/html/src/dart2js_Conversions.dart
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) 2012, 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.
-
-
-// Conversions for Window. These check if the window is the local
-// window, and if it's not, wraps or unwraps it with a secure wrapper.
-// We need to test for EventTarget here as well as it's a base type.
-// We omit an unwrapper for Window as no methods take a non-local
-// window as a parameter.
-
-part of html;
-
-WindowBase _convertNativeToDart_Window(win) {
- return _DOMWindowCrossFrame._createSafe(win);
-}
-
-EventTarget _convertNativeToDart_EventTarget(e) {
- // Assume it's a Window if it contains the setInterval property. It may be
- // from a different frame - without a patched prototype - so we cannot
- // rely on Dart type checking.
- if (JS('bool', r'"setInterval" in #', e))
- return _DOMWindowCrossFrame._createSafe(e);
- else
- return e;
-}
-
-EventTarget _convertDartToNative_EventTarget(e) {
- if (e is _DOMWindowCrossFrame) {
- return e._window;
- } else {
- return e;
- }
-}
-
-// Conversions for ImageData
-//
-// On Firefox, the returned ImageData is a plain object.
-
-class _TypedImageData implements ImageData {
- final Uint8ClampedArray data;
- final int height;
- final int width;
-
- _TypedImageData(this.data, this.height, this.width);
-}
-
-ImageData _convertNativeToDart_ImageData(nativeImageData) {
-
- // None of the native getters that return ImageData have the type ImageData
- // since that is incorrect for FireFox (which returns a plain Object). So we
- // need something that tells the compiler that the ImageData class has been
- // instantiated.
- // TODO(sra): Remove this when all the ImageData returning APIs have been
- // annotated as returning the union ImageData + Object.
- JS('ImageData', '0');
-
- if (nativeImageData is ImageData) return nativeImageData;
-
- // On Firefox the above test fails because imagedata is a plain object.
- // So we create a _TypedImageData.
-
- return new _TypedImageData(
- JS('var', '#.data', nativeImageData),
- JS('var', '#.height', nativeImageData),
- JS('var', '#.width', nativeImageData));
-}
-
-// We can get rid of this conversion if _TypedImageData implements the fields
-// with native names.
-_convertDartToNative_ImageData(ImageData imageData) {
- if (imageData is _TypedImageData) {
- return JS('', '{data: #, height: #, width: #}',
- imageData.data, imageData.height, imageData.width);
- }
- return imageData;
-}
« no previous file with comments | « sdk/lib/html/src/_Testing.dart ('k') | sdk/lib/html/src/dart2js_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698