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

Side by Side Diff: sky/sdk/lib/mojo/asset_bundle.dart

Issue 1226113007: Add @override annotation to known overriden methods (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « sky/sdk/lib/editing/editable_text.dart ('k') | sky/sdk/lib/painting/box_painter.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 import "dart:sky.internals" as internals; 7 import "dart:sky.internals" as internals;
8 8
9 import 'package:mojo/core.dart' as core; 9 import 'package:mojo/core.dart' as core;
10 import 'package:mojom/mojo/asset_bundle/asset_bundle.mojom.dart'; 10 import 'package:mojom/mojo/asset_bundle/asset_bundle.mojom.dart';
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 factory MojoAssetBundle.fromNetwork(String relativeUrl) { 45 factory MojoAssetBundle.fromNetwork(String relativeUrl) {
46 AssetBundleProxy bundle = new AssetBundleProxy.unbound(); 46 AssetBundleProxy bundle = new AssetBundleProxy.unbound();
47 _fetchAndUnpackBundle(relativeUrl, bundle); 47 _fetchAndUnpackBundle(relativeUrl, bundle);
48 return new MojoAssetBundle(bundle); 48 return new MojoAssetBundle(bundle);
49 } 49 }
50 50
51 AssetBundleProxy _bundle; 51 AssetBundleProxy _bundle;
52 Map<String, Future<sky.Image>> _imageCache = new Map<String, Future<sky.Image> >(); 52 Map<String, Future<sky.Image>> _imageCache = new Map<String, Future<sky.Image> >();
53 53
54 @override
54 void close() { 55 void close() {
55 _bundle.close(); 56 _bundle.close();
56 _bundle = null; 57 _bundle = null;
57 _imageCache = null; 58 _imageCache = null;
58 } 59 }
59 60
61 @override
60 Future<sky.Image> loadImage(String name) { 62 Future<sky.Image> loadImage(String name) {
61 return _imageCache.putIfAbsent(name, () { 63 return _imageCache.putIfAbsent(name, () {
62 Completer<sky.Image> completer = new Completer<sky.Image>(); 64 Completer<sky.Image> completer = new Completer<sky.Image>();
63 _bundle.ptr.getAsStream(name).then((response) { 65 _bundle.ptr.getAsStream(name).then((response) {
64 new sky.ImageDecoder(response.assetData.handle.h, completer.complete); 66 new sky.ImageDecoder(response.assetData.handle.h, completer.complete);
65 }); 67 });
66 return completer.future; 68 return completer.future;
67 }); 69 });
68 } 70 }
69 } 71 }
70 72
71 AssetBundle _initRootBundle() { 73 AssetBundle _initRootBundle() {
72 try { 74 try {
73 AssetBundleProxy bundle = new AssetBundleProxy.fromHandle( 75 AssetBundleProxy bundle = new AssetBundleProxy.fromHandle(
74 new core.MojoHandle(internals.takeRootBundleHandle())); 76 new core.MojoHandle(internals.takeRootBundleHandle()));
75 return new MojoAssetBundle(bundle); 77 return new MojoAssetBundle(bundle);
76 } catch (e) { 78 } catch (e) {
77 return null; 79 return null;
78 } 80 }
79 } 81 }
80 82
81 final AssetBundle rootBundle = _initRootBundle(); 83 final AssetBundle rootBundle = _initRootBundle();
OLDNEW
« no previous file with comments | « sky/sdk/lib/editing/editable_text.dart ('k') | sky/sdk/lib/painting/box_painter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698