| OLD | NEW |
| 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 import 'dart:typed_data'; | 8 import 'dart:typed_data'; |
| 9 | 9 |
| 10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojom/mojo/asset_bundle/asset_bundle.mojom.dart'; | 11 import 'package:mojom/mojo/asset_bundle/asset_bundle.mojom.dart'; |
| 12 | 12 import 'package:sky/mojo/net/fetch.dart'; |
| 13 import 'net/fetch.dart'; | 13 import 'package:sky/mojo/net/image_cache.dart' as image_cache; |
| 14 import 'net/image_cache.dart' as image_cache; | 14 import 'package:sky/mojo/shell.dart' as shell; |
| 15 import 'shell.dart' as shell; | |
| 16 | 15 |
| 17 abstract class AssetBundle { | 16 abstract class AssetBundle { |
| 18 void close(); | 17 void close(); |
| 19 Future<sky.Image> loadImage(String key); | 18 Future<sky.Image> loadImage(String key); |
| 20 Future<String> loadString(String key); | 19 Future<String> loadString(String key); |
| 21 } | 20 } |
| 22 | 21 |
| 23 class NetworkAssetBundle extends AssetBundle { | 22 class NetworkAssetBundle extends AssetBundle { |
| 24 NetworkAssetBundle(Uri baseUrl) : _baseUrl = baseUrl; | 23 NetworkAssetBundle(Uri baseUrl) : _baseUrl = baseUrl; |
| 25 | 24 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 try { | 87 try { |
| 89 AssetBundleProxy bundle = new AssetBundleProxy.fromHandle( | 88 AssetBundleProxy bundle = new AssetBundleProxy.fromHandle( |
| 90 new core.MojoHandle(internals.takeRootBundleHandle())); | 89 new core.MojoHandle(internals.takeRootBundleHandle())); |
| 91 return new MojoAssetBundle(bundle); | 90 return new MojoAssetBundle(bundle); |
| 92 } catch (e) { | 91 } catch (e) { |
| 93 return null; | 92 return null; |
| 94 } | 93 } |
| 95 } | 94 } |
| 96 | 95 |
| 97 final AssetBundle rootBundle = _initRootBundle(); | 96 final AssetBundle rootBundle = _initRootBundle(); |
| OLD | NEW |