9 Commits

Author SHA1 Message Date
Adam Barth
d6cbdb4081 Fix data loading in the stocks app
We can't have two copies of |embedder.dart| or |shell.dart| because they take
ownership of some underlying Mojo handles. Instead of duplicating the code,
this CL makes the old locations just export all the symbols from the new
location. I've also done the same with fetch.dart to avoid code duplication.

Finally, I've removed image_cache.dart in the old location because the only
clients already live in the new world and ought to use the new location.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1179923004.
2015-06-18 09:14:51 -07:00
Eric Seidel
52fd41bc88 Make Sky not crash when an image 404s.
I also fixed image_cache to not even bother
to call ImageDecoder in the 404 case, but I also
fixed CanvasImageDecoder not to blow up if the
buffer is empty and its not able to allocate
an ImageDecoder.

Closes https://github.com/domokit/mojo/issues/229

R=abarth@chromium.org, jackson@google.com

Review URL: https://codereview.chromium.org/1170413002.
2015-06-09 17:29:00 -07:00
Eric Seidel
9f337a62e6 Fix typo in fetch.dart
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1169253002.
2015-06-09 12:17:50 -07:00
Eric Seidel
8f975399e1 Move image loading out of C++ into Dart
We already know how to talk to the network_service from Dart
via fetch.dart.  Might as well use that for Image loading
as well insetad of having ImageLoader do it.

As part of this I've renamed *ImageLoader to *ImageDecoder
and moved all the image loading logic into Dart.  This required
me to teach the idl system about mojo handles so that I could
pass the resulting MojoHandle from fetch.dart up through to
ImageDecoder.

R=abarth@chromium.org, jackson@google.com, hansmuller@google.com

Review URL: https://codereview.chromium.org/1173703002.
2015-06-09 12:14:13 -07:00
Benjamin Lerman
f054a99b83 Sky: Use the authenticated network service.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1146813013
2015-06-09 09:46:18 +02:00
Adam Barth
bd7af16cf5 Make fetch work in the DOM-less world
R=eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1166953005
2015-06-04 15:00:08 -07:00
Przemyslaw Pietrzkiewicz
7cffe65163 Fix a missing url_request mojom import in fetch.dart.
Not exactly sure what I'm doing, but this makes the stocks example:

  `sky/tools/skydb start out/Debug/ sky/examples/stocks/main.sky`

work again, fixing the UrlRequest import issue:

[0603/143348:ERROR:dart_error.cc(20)]
'http://localhost:9999/packages/sky/framework/net/fetch.dart': malformed
type: line 32 pos 21: type 'UrlRequest' is not loaded
  var request = new UrlRequest()

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1148963007
2015-06-03 16:56:23 +02:00
Collin Jackson
f396442e0a Implement a simple image cache for Sky in Dart. This doesn't yet do any eviction from the cache.
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1165753004
2015-06-02 10:44:48 -07:00
John McCutchan
b017dfd995 Rationalize Dart mojo and sky package structure.
NOTE: This CL appears far larger than it actually is for two reasons:

1) Many files were moved around to use the Dart package directory structure.
2) Many .dart files had to have import paths updated.

- Organize mojo/public/dart so that it uses standard Dart package layout
- Organize mojo/dart/apptest so that it uses a standard Dart package layout
- Organize sky/sdk so that it uses a standard Dart package layout
- Create a mojo/testing package (used by unittests)
- Introduce the 'dart_pkg' gn rule which populates gen/Config/dart-pkg
- All internally vended Dart packages must have a corresponding dart_pkg rule
- It is now possible to use dependency_overrides: in pubspec.yaml to mix internal and external package dependencies (enables analyzer, editor, webstorm usage for internal developers).
- Package root for dart content handler ends with "packages/"
- Imports of mojo package uris no longer need the "public/dart"
- mojo/public/tools/dart_package.py is a clone of mojo/public/tools/gn/zip.py
- Sky tests no longer run 'deploy_sdk' script.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1132063007
2015-05-18 14:41:39 -07:00