162 Commits

Author SHA1 Message Date
Adam Barth
cc12331d63 Update references to Mojo core and bindings
Build fix after recent Dart bindings refactoring.  Now that these libraries are
not included in the snapshot, we need to load them from the mojo package.

R=zra@google.com
TBR=zra@chromium.org

Review URL: https://codereview.chromium.org/1029683002
2015-03-23 13:22:38 -07:00
Eric Seidel
d83ebf6913 Unbreak the deploy_sdk for --dev-environment
sdk_additions was already created above and thus
can't be linked here, must be copied.

TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1026933002
2015-03-20 15:20:57 -07:00
Eric Seidel
ad94044ec8 Copy all of dart_sky.dart's supporting files into package:sky
Also bumped package:sky's version in prep for publishing.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1024243002
2015-03-20 14:46:58 -07:00
Eric Seidel
a92a67ae42 Make the Sky pub package include our APK and teach sky_tool to install it
I'm not sure this is the final long-term solution, but works for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1022193002
2015-03-20 14:35:14 -07:00
Adam Barth
6d1228a2f3 Enable tracing in SkyShell
This CL teaches shelldb how to trace SkyShell.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1027903002
2015-03-20 14:16:43 -07:00
Eric Seidel
fe416b295a Fix deploy_sdk.py to error out if files are missing
I also now deploy sky/bin/sky as sky/lib/sky_tool since
pub run doesn't really work very well yet.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1026863002
2015-03-20 11:21:47 -07:00
Benjamin Lerman
f64fc80e81 Fix races when the same bits are downloaded from 2 URLs.
Until now, we were saving downloaded file to the temporary directory
with a name being the hash of the file content. It means there is a race
when the same content is downloaded from 2 different URLs.

To fix this, we now create an intermediary directory that is the hash of
the URL.

Also, because this is only needed for debugging with gdb, and this is
inefficient in term of both CPU and storage (we do not know when to
delete the temporary directory), we control this with a command line
flag.

R=ncbray@chromium.org, eseidel@chromium.org
BUG=https://github.com/domokit/mojo/issues/61

Review URL: https://codereview.chromium.org/1011333003
2015-03-20 12:51:00 +01:00
Eric Seidel
03407ba35e Remove custom elements examples, they are no longer maintained
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1022613002
2015-03-18 13:38:17 -07:00
Eric Seidel
d5c07f8564 Update deploy and deploy_sdk for the new package: world.
Before this change Sky would hit 404s when trying to
load examples from domokit.github.io.

I also added a separate sky_home and updated the default
url to point to sky_home instead of home.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1016143002
2015-03-18 13:00:46 -07:00
Eric Seidel
d7aa3064ea Make mojo and sky dart packages deployable
The packages produced from this CL were deployed
as v0.0.1:
https://pub.dartlang.org/packages/sky
https://pub.dartlang.org/packages/mojo

There is still no tool included with the sky
package due to pub's inability to run anything
other than Dart:
https://code.google.com/p/dart/issues/detail?id=22877

I'm likely just going to write a dart version
of my "sky" script. :(

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

Review URL: https://codereview.chromium.org/1015833002
2015-03-17 11:09:33 -07:00
Dave Moore
819963d274 Make http_server part of the published services.
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/1012773008
2015-03-16 17:09:11 -07:00
Adam Barth
d761ebde59 Update shelldb to work with new sky_sdk
We need to teach shelldb to deploy the Sky SDK and run SkyServer with the right
package root.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1007393002
2015-03-16 09:15:18 -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
Zachary Anderson
3cc4de9295 Dart: Rename mojo:X -> dart:mojo.X
This is to better support integration with Dart SDK tools.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/998933005
2015-03-11 16:22:21 -07:00
Eric Seidel
a5ab3630e9 Remove the last bits of the Sky Inspector
Unclear what if any of this we will want in the Dart world.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/993203002
2015-03-11 10:13:25 -07:00
Dave Moore
a5904449e2 Update from https://crrev.com/319330
- New chromium clang rules require explicit external destructors so
  system/lib added for MessagePipe, DataPipe and SharedBuffer
- New chromium clang rules require override and no virtual in
  declarations, so many files updated.
- cc_strip_video patch updated.

BUG=
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/988693005
2015-03-10 15:23:04 -07:00
Eric Seidel
ebc0dd2c09 Re-enable dart:sky in shelldb analyze.
It show 600+ "native" warnings, but those can be ignored
for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/981103002
2015-03-05 16:22:50 -08:00
Eric Seidel
e3a8059796 Fix all dartanalyzer errors in dart:sky except the Native ones.
I also fixed all warnings. :)

This is the only error remaining:
[error] Native functions can only be declared in the SDK and code
that is loaded through native extensions

My understanding is that we need to do something similar to:
https://codereview.chromium.org/950063002/
in order to work around the 'native' issue.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/981733009
2015-03-05 13:36:48 -08:00
Eric Seidel
e7335d39f4 Add a new analyze command to shelldb to run the dart analyzer
This just makes it easier to run with the correct flags.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/982093003
2015-03-05 11:28:57 -08:00
Eric Seidel
2959de0e37 Make shelldb not crash.
I clearly hadn't actually tested it.  Sorry.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/955263004
2015-03-03 12:49:56 -08:00
Eric Seidel
9e08140a15 Add super-primitive shelldb
This is basically skydb v2, except only for android.

I revisited some of the architecture decisions I made
in writing skydb.  I also separated skyserver.py from
dependency on skypy/paths.py since it wasn't really adding
any value.

We could make this way fancier, but this should at least
make working with SkyDemo.apk easier for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/960233007
2015-03-03 10:55:22 -08:00
Przemyslaw Pietrzkiewicz
57515cb468 Serve skydb on localhost instead of 0.0.0.0.
This patch makes skydb http server available only for local connections.

BUG=460908
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/945663003
2015-02-24 18:10:15 +01:00
Przemyslaw Pietrzkiewicz
693418e3eb http_server: accept full NetAddress in CreateHttpServer.
This patch allows to specify a full NetAddress on which the server is to
be set up.

This is needed to decide between running the server on externally
visible address (like http_handler would like) and localhost (like skydb
would like).

No change in behavior of existing clients in the Mojo repo should occur.
A follow-up patch will switch some of the clients from 0.0.0.0 to
localhost.

BUG=460908
R=qsr@chromium.org

Review URL: https://codereview.chromium.org/953513002
2015-02-24 17:33:42 +01:00
Colin Blundell
c8e5e208b7 Add ApplicationDelegate::Quit()
This CL adds ApplicationDelegate::Quit(), which ApplicationImpl calls
before shutting down the main run loop. In this function, an
ApplicationDelegate should shut down anything that relies on the main
run loop being active.

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

Review URL: https://codereview.chromium.org/947253003
2015-02-24 14:06:47 +01:00
Adam Barth
1b28eec0e1 Add a script to download material design assets from gs
We're going to use these assets to make pretty demos of Sky but not every
developer needs them in their working copy.

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

Review URL: https://codereview.chromium.org/951063006
2015-02-23 17:25:43 -08:00
Ojan Vafai
58bfcf3a8f Delete a bunch of dead python code.
Just deleted the obvious bits and verified that
test_sky, skydb and pretty-diff still work.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/946753002
2015-02-20 21:09:15 -08:00
Ojan Vafai
43b83b1c9a Add a dedicated pretty-diff command.
This will let us delete webkit-patch and a bunch of
python code and it will save me some annoyance at
needing to type "webkit-patch pretty-diff" all
the time.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/944193003
2015-02-20 21:01:04 -08:00
Ojan Vafai
2cf6dc759d Make webkit-patch pretty-diff do the right thing for upstream branchs.
If your current branch has an upstream branch, then diff to that
branch. That way you get the same diff that git cl upload gives
instead of the diff to origin/master.

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/948663002
2015-02-20 20:28:12 -08:00
James Robinson
174ea9f08e Remove last uses of InterfaceImpl<> in Sky C++ code
This switches to using StrongBinding<>s in sky's ContentHandlerImpl
and TestHarnessImpl implementations.

These are the last uses of the deprecated InterfaceImpl<> helper in
the mojo repo (more uses exist in other repos).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/934403002
2015-02-18 18:17:50 -08:00
Przemyslaw Pietrzkiewicz
979663ebc5 Switch skydb to services/http_server.
This patch makes the skydb debugger use the Mojo http_server app instead
of the /net http_server.

BUG=456128
R=eseidel@chromium.org, qsr@chromium.org

Review URL: https://codereview.chromium.org/930903002
2015-02-17 17:10:24 +01:00
Przemyslaw Pietrzkiewicz
7de4ec3b25 Drop weak_ptr_factory in SkyDebugger.
It seems not to be used for anything.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/921633006
2015-02-13 18:24:15 +01:00
Adam Barth
f2d2e80e59 Merge the Sky Engine changes from the SkyDart branch
This CL flips the switch to make Sky use Dart.

TBR=eseidel@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/922893002
2015-02-12 15:06:03 -08:00
Adam Barth
f22842f3bc skydb shouldn't use origin on Linux
Unfortunately, using --origin on Linux is slow and too painful to use at the
moment. We should work on fixing that, but currently many of us have this in
our local working copy anyway.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/922823002
2015-02-12 13:37:50 -08:00
James Robinson
5e5c074826 De-client tracing.TraceController interface
The tracing service logically provides one service, TraceCoordinator, which can
start and stop tracing sessions. It also can connect to any number of
TraceControllers each of which can supply tracing information on demand.

Whenever an app connects to the tracing service, the tracing service attempts to
connect to that app's TraceController interface. If the app provides this
interface then tracing data will be requested whenever tracing starts. If the
app doesn't, then the pipe just closes. Thus apps that want to be traced can do
so by creating however many connections to the tracing service they want and
registering a TraceController implementation on each outgoing connection.

The shell connects in a similar fashion by connecting to the tracing service and
providing a TraceController implementation. The code looks a bit different since
the shell is special.

BUG=451319
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/791493006
2015-02-02 16:56:34 -08:00
Eric Seidel
be00ee1268 Replace usage of md5 with sha256 for generation of mojo app ids.
Before we start adding more uses of mojo app ids we should use
to a non-broken hash function. :)

What was holding me back before was I wasn't aware of us having an
incremental hash api other than base/md5.h (others in base only operate
on the full input data), however it turns out that the crypto/ library
has one in crypto/secure_hash.h.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/868253006
2015-01-29 12:59:48 -08:00
Eric Seidel
30798815f5 Rename SkyDebugger to KioskWM and move to /services
Already other applications use sky's simple window
manager (mojo:sky_debugger) as a full-screen window
manager.  This moves this to /services and removes
all sky references from it.

As a part of this I've removed inspector support
from skydb.  It was already broken and will need
to be re-thought to not involve calls into
this new window manager.

I'm also flipping the relationship between prompt.cc
and debugger.cc for skydb.  Skydb will tell mojo_shell
to start sky_debugger_prompt instead of sky_debugger.

I'm also renaming sky_debugger_prompt to be
sky_debugger.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/883983004
2015-01-29 11:25:58 -08:00
Adam Barth
8e8036ab84 Make skydb --gdb work a bit better on Android
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/878163005
2015-01-28 15:30:31 -08:00
Tony Gentilcore
6682573cb4 Set execute permissions on sky_server after download.
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/886543004
2015-01-28 10:26:06 -08:00
Adam Barth
63b6ffb281 Normalize import paths for Sky modules
This CL simplifies the sky_server to only map the build directory into /gen,
which will make the deploy script simpler. This CL updates all the imports to
use the /gen prefix when referring to generated files.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/881093003
2015-01-27 17:04:40 -08:00
Eric Seidel
bf64f39c29 Remove skydb dependency on build/android/pylib
I also fixed skydb to use --args-for sky_debugger to
automatically issue the load from 'start' even when
the --gdb option is present.

I tried to invoke gdb_attach directly from within start_command
but that seemed to cause some strangeness with my zsh shell
where it would automatically suspend gdb.  So I'll revisit
that change in the next patch.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/880143002
2015-01-27 15:56:23 -08:00
Adam Barth
d5e67f963c Split skydb trace into start_tracing and stop_tracing
Now stop_tracing writes the response to a file instead of spamming the trace data to stdout.

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

Review URL: https://codereview.chromium.org/878283002
2015-01-27 13:58:29 -08:00
Eric Seidel
9f0f8f500c Make it possible to pass a default url to sky_debugger
sky_debugger will load the default url in every view that it's
asked to embed.  Think of the default_url as being like the
home-page in a conventional browser.

I also fixed prompt.cc to not terminate the entire mojo
environment when it can't start itself, but rather just
quit its own application.

With this patch I'm able to hack up mojo_shell to be able
to have a sensible default behavior when clicked from
the Android homescreen, but I'll land those hacks in a
separate change.

TBR=abarth@chromium.org
BUG=451620

Review URL: https://codereview.chromium.org/875183002
2015-01-26 13:19:06 -08:00
Eric Seidel
e3d08b1dab Teach mojo_cache_linker how to use a cache
Many of the .so files in out/Debug are hundreds
of megabytes in size.  md5sum can take seconds
to churn through them all, so I've added
a small caching layer which makes this script
take no time in the common case.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/865463004
2015-01-23 16:42:18 -08:00
Hixie
4c02ecd331 Fix help text in skydb
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/871083002
2015-01-23 16:25:30 -08:00
Eric Seidel
ea8c3f0212 Fix skydb --gdb to always have symbols
This replaces my previous --gdb work:
https://codereview.chromium.org/848013004/

And obsoletes my build-id based attempt:
https://codereview.chromium.org/788903011

Context:
mojo_shell downloads arbitrary binaries from
urls copying them to temp files before calling
dlopen.  Because the names it used were random
this broke gdb, pprof, etc. tools which wanted
to make address -> symbol translations based
on the library load path.

The major thing this change does is move away
from the previous method of watching the logs
of mojo_shell for 'Caching %url as %file...'
messages or the /tmp/mojo_shell.%pid.map
file to having mojo_shell use a priori knowable
names for all of its library loads.  Thus
we can similarly build a directory of correctly
named symboled binaries corresponding to the
expected load names of libraries.

This change does this in 3 pieces:

1.  Introduces the concept of 'app ids' (which
are currently just the md5 of the distributed app
binary) and teaches dynamic_application_loader to
rename all apps to APP_ID.mojo before loading them.
This has the nice side-effect of always loading
an app with a dlopen/library name which is both
unique to the application as well as predictable.

2.  Re-writes the mojo_cache_linker script to
no longer watch stdin/adb logcat for 'caching...'
messages and instead build a links directory
based on pre-determined app_ids (md5s) linking
back to the symboled binaries.

3.  Remove a bunch of the former mojo_cache_linker
calling code which is no longer needed now that
the library_names of loaded application .so's are
predictable before launching mojo_shell

I'm happy to make app_ids fancier, originally I
was going to use ELF's build-id's directly:
https://codereview.chromium.org/788903011
but unfortunately gdbserver does not know
how to do a build-id lookup on the serverside:
https://groups.google.com/a/google.com/forum/#!topic/gdb-discuss/Fd0R-gFaqXk

R=aa@chromium.org, abarth@chromium.org

Review URL: https://codereview.chromium.org/866383004
2015-01-23 15:18:21 -08:00
James Robinson
c0c8a41eb3 Remove [Client=] annotation from ServiceProvider
This removes the symmetrical nature of ServiceProvider and consistently
passes and uses a ServiceProvider + ServiceProvider& pair in places that
wish to bidirectionally expose services, such as the view manager.

The
view manager library now deals with InterfaceRequest<ServiceProvider>
and ServiceProviderPtr objects (i.e. c++ wrappers for handles) instead
of a concrete implementation of ServiceProvider to make it easier for
callers.

A number of places that were assuming a particular
ServiceProvider would always exist are updated to reflect the nullability
of the parameters in mojom and places that do not wish to ever look up
or provide services now pass nullptr instead of doomed pipe handles.

The JS application startup classes are reworked a bit to accomodate
exposing services on the third ConnectToApplication/AcceptConnection
parameter.

BUG=449432
R=abarth@chromium.org, sky@chromium.org

Review URL: https://codereview.chromium.org/858103002
2015-01-21 18:36:01 -08:00
Eric Seidel
c35f2bdf5d Always use mojo_shell in over-http mode
--origin tells mojo_shell to map all mojo: urls
to to a new base-url instead of the build directory.

This makes skydb's mojo_shell *always* use the network
loading path, which is what Android mojo_shell does
and is more like how mojo_shell will eventually be
used.

I also fixed the disk-space leak in the
dynamic_application_loader's NetworkLoader path
by having it immediately unlink the /tmp copy
of the library after dlopen.

In order to keep pprof working I had to teach the
dynamic_application_loader to write out a map of
/tmp/file -> url mappings so that we can fix
the pprof file afterwords.

This will "break" skydb --gdb on linux in exactly
as much as it is already broken on Android, but
I'm working on a build-id based solution for both
so that gdb knows how to find symbols for
non-existant randomly named /tmp libraries.

R=abarth@chromium.org, viettrungluu@chromium.org
BUG=450696

Review URL: https://codereview.chromium.org/829183005
2015-01-21 15:53:17 -08:00
Eric Seidel
955ede4d3b Fix skydb gdb_attach for non-android configs
I dumped a bunch of android-specific goop into
gdb_attach in my previous commit.  This fixes that.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/859103002
2015-01-20 14:55:37 -08:00
Adam Barth
6ed36e88fe Sky should symbolize pprof traces
In order for pprof to find the symbols in the profile, we need to rename the
binaries from foo.mojo to libfoo_library.so. This CL adds that step to the
stop_profiling command in skydb.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/812573006
2015-01-20 14:27:25 -08:00
Eric Seidel
97ae8b44bd Add very basic support for symboled debugging on android
This only barely works.  We pull down system libraries
once before we attach.  The libraries we pull from
the device do not have debug symbols, but have enough
that we have decent callstacks.  We launch a background
process to repeatedly update a cache directory with
symlinks into our build directory corresponding to the cache
names used on the device, however gdb doesn't watch
the solib-search-path directories to notice the links
as we add them.

Better solutions would be to add support for pulling
down full android symboled system images and using those
instead of pulling libraries off the device as well as
figure out how to get android binaries to support
build-id so that we can present a directory of build-id
associated libraries to gdb on boot and have it to build-id
based lookups of libraries instead of our current broken
watch-logs-and-add-symlinks approach.

If you know what you're doing with this you can actually
make debugging work on the device.  It's not particularly
user friendly yet, but we'll work on it.

I added a build_dir member to skypy.paths.Paths
as a temporary measure before we move off of skypy's
paths and onto mopy's paths.  This helped eliminate
problems with using a relative path in args.build_dir
as is common.

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

Review URL: https://codereview.chromium.org/855663003
2015-01-16 13:39:20 -08:00