35 Commits

Author SHA1 Message Date
Chinmay Garde
e027c6b874 Update Dart dependency and patch dart_controller to account for
non-backwards compatible API update

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1183253002.
2015-06-15 15:11:31 -07:00
Eric Seidel
c1cad6ccda Don't crash when main.dart is a 404.
Ideally we would show a failwhale or some such, but
I don't know how we would bundle that file with our
APK yet.

Fixes https://github.com/domokit/mojo/issues/228

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182633002.
2015-06-11 14:07:49 -07:00
Chinmay Garde
ac4f0bebc5 sky/engine updates for iOS targets
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1163323003.
2015-06-10 16:17:56 -07:00
Adam Barth
c17d58ab28 Fix shutdown crash in Sky
Previously, we would try to close some Dart persistent handles after destroying
the isolate. Now we revoke the weak pointers these handles are using to refer
to the isolate before trying to tear them down.

Fixes https://github.com/domokit/mojo/issues/233

R=chinmaygarde@google.com, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1175053002.
2015-06-10 12:59:07 -07:00
Matt Perry
d745bd3d47 Sky: Add a DartConverterEnum and use that for all our enum needs.
R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1170963003.
2015-06-09 15:58:54 -04:00
Adam Barth
1e9184d282 Make Uri.base work in SkyView
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1153673005
2015-06-03 17:00:44 -07:00
Matt Perry
3aa1e23d7d Sky: Convert TransferMode to an enum.
It looked and smelled like an enum, so lets just make it one. This also gives us a nice toString() method.

R=abarth@chromium.org, eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1144233004
2015-06-03 16:19:14 -04:00
John McCutchan
87fd276d3d Enable Dart's checked mode in the Sky controller by default for debug builds
This matches the behaviour of the Mojo Dart controller and was requested by tonyg@

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1152873006
2015-06-03 09:33:17 -07:00
Matt Perry
4f2d78a5bb Re-land "Add a Color class to dart:sky."
The previous patch broke the sky tests. I have updated the framework to use the new Color class.

R=jackson@google.com

Review URL: https://codereview.chromium.org/1159663003
2015-06-02 14:09:42 -04:00
Matt Perry
ffed692545 Revert "Add a Color class to dart:sky."
This reverts commit a413c8319fe9a46dc131f6efe275d014c9cb7eb9.

Reason: seems to have broken Sky tests:
Regressions: Unexpected crashes (2)
  raw/render_box.dart [ Crash ]
  raw/render_flex.dart [ Crash ]

TBR=jackson@google.com

Review URL: https://codereview.chromium.org/1143133007
2015-06-01 18:13:35 -04:00
Matt Perry
326e2324c9 Add a Color class to dart:sky.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1161273004
2015-06-01 16:48:48 -04:00
Matt Perry
eaba0b981f Add DartHandleCache and use it to cache strings used when converting Rect and
Point classes.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1145103005
2015-05-28 13:39:33 -04:00
Collin Jackson
1408fcff9a Don't start the Observatory when testing Sky viewer 2015-05-21 21:03:34 -07:00
Collin Jackson
4c6f6cd8a8 Hard code the port to 8181 2015-05-21 21:03:33 -07:00
Eric Seidel
827e621238 Teach sky_viewer about the new main.dart hotness
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1147413003
2015-05-21 12:46:36 -07:00
Adam Barth
9f8b9bb96d Teach SkyView path to draw a circle
This CL adds a global view object that can receive a Picture and be signaled to
draw. When using SkyView, this Picture shows up on screen.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1134913003
2015-05-19 14:20:04 -07:00
Adam Barth
1b45682ba9 Teach SkyView code path to print hello, world
This CL makes the SkyView codepath smart enough to print "hello, world" to the
console. The code path is off by default but can be enabled by changing one
line of code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1131673011
2015-05-19 13:51:12 -07:00
Adam Barth
9a4feca976 Teach SkyView how to load the main script
This CL implements SkyView::Load to start executing Sky content directly from
Dart's main(). This code isn't currently wired up to anything, so it's not yet
tested.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1130353009
2015-05-19 10:55:07 -07:00
John McCutchan
76da439f44 Add Observatory to sky dart_controller
- Bump Dart and Observatory DEPS to 45576 and 45565 respectively.
- Include 'dart:io' in snapshot
- Add 'dart:io' native bindings to sky bindings.
- Initialize 'dart:io' in sky dart_controller.
- Include Observatory and service isolate resources in build.
- Bring up service isolate.
- Start handle watcher isolate from service isolate (hides handle watcher isolate from debugger and Observatory).
- Hook up debugger.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1107803002
2015-05-06 15:36:12 -07:00
Ryan Macnak
a6ffc52bea Ensure isolates have a root library so createMirrorSystem() and spawnUri() are happy.
https://github.com/domokit/mojo/issues/98

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1088263004
2015-04-16 15:49:11 -07:00
Siva Annamalai
9f0601b18e gen_snapshot now generates two snapshot buffers, one for the vm isolate
and another for a regular isolate. These changes account for that change
in the mojo and sky snapshot generation scripts and the controller files.

R=zra@google.com

Review URL: https://codereview.chromium.org/1047883002
2015-04-02 11:31:29 -07:00
Adam Barth
f3df64fa3d Let Dart code running in Sky add events to the trace timeline
This will let us form a wholistic picture of work done in the framework and in
the engine.

R=ojan@chromium.org, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1028243003
2015-03-23 14:48:06 -07:00
Zachary Anderson
d83427c165 Dart: Removes all but native calls and the handle watcher from the snapshot.
The bindings, core, and application libraries are now referred to as, e.g.:

package:mojo/public/dart/core.dart

Since the handle watcher remains in the snapshot, it no
longer refers to types defined in core.dart. References to types defined
in core.dart are also removed from mojo_natives.cc.

In Dart packaged apps, the SDK is zipped up under mojo/public/dart.

For embedder tests, the SDK is copied into the generated source output directory.

A base_dir parameter is added to the 'dart_package' and 'mojom' GN macros so that
consumers of the Mojo SDK can all import using the same URIs regardless of where
the SDK lives in their source trees.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/1027603002
2015-03-23 11:04:03 -07:00
Adam Barth
e26810b1de Add more tracing to Sky
This CL adds trace events:

1) Between requesting a frame and begin frame.
2) In the DartLoader see network latency.
3) While executing |main| and |_init|.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1025073003
2015-03-20 16:11:39 -07:00
Eric Seidel
8ad5f14611 Currently we use package: to mean "/gen", which is not at all how
Dart actually expects package: to work.  This CL makes package:foo
map to /packages/foo, similar to how Dartium or bin/dart would expect.

This also means overlaying the /gen directory over the actual package
outputs (as consumers of an SDK would expect) as well as adding
an additional /lib indirection for the actual package source as
the Dart pub tool will expect.

This is far from perfect, but it unlocks us actually producing a
sky SDK.

I expect there may be some fallout from this change as I'm sure I
missed some package: uses.  We also don't have a general solution
for all /foo/bar/baz includes which randomly included parts
of mojo's source directory.  Those will need to be updated to use
a package: and deploy_sdk.py taught how to build a package for them.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/990493002
2015-03-13 16:58:53 -07:00
Adam Barth
e8b988e226 Expose Android sensors to via Mojo services
This CL adds a sensor_service to sky/services and wires it into SkyShell
The plan is to eventually use this data to implement shake-to-refresh.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962043002
2015-02-27 14:37:50 -08:00
Eric Seidel
3d09314b22 Make WebView::close not crash and start to fix navigation in SkyShell
However WebView::close() no longer crashes.  close() is never called
in MojoShell since mojo can't shutdown yet.

I tried closing the existing WebView and replacing it
but somehow that caused it to only draw red.  After a while
of looking at this with abarth we decided to just load into
the same WebView for now.

Eventually we should do something smarter where we start the
provisional load and only replace the webview once the new one is
ready, but that's a later CL.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/952273003
2015-02-25 15:25:17 -08:00
Zachary Anderson
b3b197fcf8 Dart: Renames dart:mojo_blah -> mojo:blah
This improves consistency with the convention that the dart: scheme is
only for things from the Dart standard library.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/951783004
2015-02-25 14:29:41 -08:00
Rafael Weinstein
e53bba60a5 Add dart_invoke to tonic for calls into App code.
This patch adds utility functions which provide a single choke point for calling into sky application code. For now this is only serving the purpose of having a common trace event for calls into app code.

R=abarth@chromium.org, abarth
BUG=

Review URL: https://codereview.chromium.org/941153003
2015-02-24 12:11:19 -08:00
Adam Barth
16db84fde1 Add a basic sky-element custom element
After this CL, you can use <sky-element> to describe custom elements. The
current iteration is very basic and is hardcoded to "example", but its a start.

This CL renames the |init| function to |_init| to prevent importers from
calling it directly. Also, we now pass the <script> element to |_init| to give
some context.

R=ojan@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/950493003
2015-02-20 21:45:36 -08:00
Eric Seidel
c78cea7e54 Allow multiple dart <script> tags in .sky files
This does several things:
1.  Teaches sky about asynchronous script execution. Previously once all imports
were loaded and the script text was available, we executed a script and assumed
it completed synchronously.  We left the parser loop to do so, but that was fine
as the next chunk from the background thread would resume the parser.  In this
change scripts now load and execute separately.  The "load" step may trigger
further dart import loads which may cause the execution to happen asynchronously
which required teaching both the DartController and the HTMLScriptRunner to
take callbacks to allow HTMLDocumentParser to know to continue parsing after
the Dart script has resolved its imports and executed.

This required re-working some of how the parser executes scripts and I
re-purposed isWaitingForScripts to include "is the parser blocked" where
as before it was limited only to "does the treebuilder have a script", even
though the imports system may have had pending scripts as well.

I made HTMLScriptRunner live only as long as the script it was executing
since it only contained per-script state at this point.

2.  Fixed an error reporting bug whereby we would not show errors when "init"
failed to execute, only "main".  This required using the dart_mirrors_api.h
which required adding an include path to the core build. :(

3.  Made it possible for a single sky file to contain multiple dart <script>
tags.  Each <script> is a separate library and executes as
soon as </script> is seen.  main or init is called for each.  This required
mangling "urls" for these script blocks since Dart unique's libraries by urls.
Before this change it may have been possible to do <import 'foo.sky'> and then
<script>import 'foo.sky'</script> and have it work!?

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/938623005
2015-02-20 11:08:28 -08:00
Eric Seidel
5e47f9a8f2 Make tests/clipping/canvas-rounded-corners.sky actually run.
Because we dump dart errors to LOG(ERROR) (stderr) instead
of console.log / stdout, tests with dart errors just "pass"
and we don't notice they're not running.

This was the case with canvas-rounded-corners.sky.

I don't think this test actually passes yet, despite it
claiming to, but I at least have made it run and not crash.

Required me commenting out a ton of CanvasRenderingContext2D, but
that's fine, it wasn't actually working and it's better to have
it be compiling valid dart.

R=abarth@chromium.org, ojan@chromium.org
BUG=

Review URL: https://codereview.chromium.org/936563002
2015-02-17 12:25:15 -08:00
Adam Barth
374a768d5b Improve DartLoader error handling.
Before this if a dart import 404s, we crash.
This makes some minor improvements in our logging
for better diagnosis of future errors.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/926753002
2015-02-14 20:18:00 -08:00
Adam Barth
52b56750a1 Rename sky/engine/bindings2 to sky/engine/bindings
There's only one bindings system now.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/915293003
2015-02-12 20:16:17 -08:00
Adam Barth
c6dce9ad07 Add DartController and friends
This CL adds the DartController and associated classes. These classes let you
load and execute dart code.

R=rafaelw@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/921903002
2015-02-12 13:34:45 -08:00