58 Commits

Author SHA1 Message Date
Mitch Rudominer
8c084e1db9 Replaces |shell_handle| with |application_request| as the name of the parameter to MojoMain().
BUG=468496
R=viettrungluu@chromium.org, viettrungluu

Review URL: https://codereview.chromium.org/1058163002
2015-04-03 08:22:46 -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
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
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
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
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
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
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
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
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
Adam Barth
381a6d49e3 Add pprof support to skydb
After this CL, we're able to capture pprof profiles, but we're not quite able
to symbolize them properly.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/854833004
2015-01-15 16:34:16 -08:00
Adam Barth
48af5b3c8f Make tracing work on Android
Previously, the trace coordinator would try to write a trace to the file
system, but it is awkward to write to the file system on Android. Instead, we
now stream the trace data to a data pipe. The Sky debugger consumes that data
pipe and sends it to the host via the command HTTP server.

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

Review URL: https://codereview.chromium.org/853943005
2015-01-15 16:32:16 -08:00
Hans Muller
cf522e3ed8 Mojo JS Bindings: add show_image example
Add a simple example based on the window and view managers.

The skydb app can now handle apps that want to embed another view.

Corrected a problem in unique module name generation. An otherwise unique module name could be shadowed by a parameter name (service_provider in ViewManagerService Embed). Appended a "$" suffix to module names to avoid the collision.

BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/845103004
2015-01-12 16:35:35 -08:00
Eric Seidel
7647360840 Fix skydb to work for android
I changed skydb start to take a build directory
and read the configuration out of gn args instead
of --release, --debug, etc.  This should be more
flexable and handle all the crazy asan cases
mopy/config.py tries to.  Once we merge sky/tools
into mojo/tools we should make mopy/config use this
method too.

This follows similar patterns to what
mojo/tools/android_mojo_shell.py does, but doesn't
use as much of the (old) android_commands and forwarder
logic.  We could even remove all of that
build/android/pylib code by calling the (new)
adb reverse instead of using Forwarder (in a later patch).

This still only supports a single skydb running
at once, but it should be trivial to move the
skydb.pids file into the build directory or to have
it support more than one instance.  The big question
there is what the command-line usage should look like
when supporting more than one running instance.  See
the mojo-dev thread on the subject.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/816693006
2015-01-12 11:16:20 -08:00
Eric Seidel
a48f3d3893 Rewrite how skydb starts prompt.cc
This makes skydb pass a command_port to prompt.cc
as a commandline argument.  I removed passing of the
url and instead pass the url via a separate /load command.

This has the nice side effect of guarenteeing that
the sky instance is up and ready to respond to commands
when skydb exits.  It also prepares us for running
more than one copy of prompt.cc as jamesr requested
for both Release and Debug or for on both your android
device as well as your local machine.

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

Review URL: https://codereview.chromium.org/841113003
2015-01-08 15:50:09 -08:00
Eric Seidel
7eb8dccbb8 Exit with less stacktrace dump if we can't bind to the port
R=jamesr@chromium.org
BUG=

Review URL: https://codereview.chromium.org/843843003
2015-01-08 14:02:36 -08:00
Adam Barth
64a7d49358 Implement <sky-input>
This CL contains a basic input element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/831353003
2015-01-08 13:22:00 -08:00
Eric Seidel
ec71469470 Make skydb just a ctl-style helper (e.g. apachectl)
This makes it much easier to work with a device where we
don't expect a persistent commandline session.  Prompt no longer
actually makes a prompt but rather just runs an http server.

This is just a v1 patch.  It doesn't work with android yet
and it isn't smart enough to allow you to run more than one
copy of prompt.cc at the same time (since you can't control
the port it listens on).  If you have a second copy of
prompt runnning (or anything else bound to port 7777) it will
just crash.

We could make this a lot better, including splitting out the
pid-file tracking for sky_server into sky_server instead of
having skydb manage it.

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

Review URL: https://codereview.chromium.org/840973002
2015-01-08 13:01:15 -08:00
Eric Seidel
3751008386 Make Sky not crash when run in MojoShell.apk
We'll fix both of these issues, but these hacks
unblock more important functionality fixes to
Sky run on Android.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/826063003
2015-01-06 17:38:34 -08:00
Scott Violet
bafedfb8f6 Moves Create() off of View and onto ViewManager
This makes more sense given the ViewManager is used to create the
view.

R=ben@chromium.org

Review URL: https://codereview.chromium.org/818583002
2014-12-19 07:45:16 -08:00
Scott Violet
17d7739f7c Nukes ViewManager arg from ViewManagerDelegate::OnEmbed
It can be obtained from the supplied view, so no reason to include in
the arguments.

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

Review URL: https://codereview.chromium.org/815003002
2014-12-18 14:35:42 -08:00
Colin Blundell
b5be4a0945 Restructure public side of navigation service.
This CL goes from this:
  //mojo/services/public/interfaces/navigation

to this:
  //mojo/services/navigation/public/interfaces

This CL also makes the Mojo-side changes necessary to roll this change into
Chromium.

TBR=beng

Review URL: https://codereview.chromium.org/796783002
2014-12-11 08:49:15 +01:00
Colin Blundell
ac99b9896f Restructure public side of input_events service.
This CL goes from this:
  //mojo/services/public/interfaces/input_events

to this:
  //mojo/services/input_events/public/interfaces

This CL also makes the Mojo-side changes necessary to roll this change into
Chromium.

TBR=beng

Review URL: https://codereview.chromium.org/788353002
2014-12-10 22:50:57 +01:00
Colin Blundell
3dc76a69df Restructure public side of view_manager service.
This CL goes from this:
//mojo/services/public/cpp/view_manager
//mojo/services/public/interfaces/view_manager

to this:
//mojo/services/view_manager/public/cpp
//mojo/services/view_manager/public/interfaces

This CL also makes the Mojo-side changes required to roll this change into
Chromium (for both view_manager and window_manager, which was converted in an
earlier CL but for which these updates were not made):
- Updates rev_sdk.py to pull over the new directory
- Updates //mojo/services/public/mojo_services_public.gyp

TBR=beng

Review URL: https://codereview.chromium.org/790623003
2014-12-10 14:16:27 +01:00
James Robinson
29235bd8a2 Put code in //services/window_manager in namespace window_manager
R=sky@chromium.org

Review URL: https://codereview.chromium.org/788453002
2014-12-08 12:08:55 -08:00
James Robinson
f6527512b0 Simplify the thunk targets since we don't support apps as components
Since we don't support using the component build to produce mojo apps,
we can simplify the build targets in a few ways:

*) every mojo_native_application must depend on the c system thunks,
so just make that part of the template instead of requiring the dep
*) there's no such thing as depending on gles2 headers from a component,
so delete the forwarding group.

Most targets that want to use the gles2 headers in a mojo context
want to depend on an implementation through the thunks, so
//mojo/public/c/gles2 does just that. A smaller number of targets (such
as the implementation of the thunks) want to just depend on the headers
but not an impl, so they can depend on //mojo/public/c/gles2:headers.
The //mojo/public/gles target isn't that useful since the only thing we
expose is a set of C entry points.

We can probably also simplify the c system targets, but that's trickier
due to more extensive use from the chromium side.

BUG=438701
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/780733002
2014-12-03 16:25:09 -08:00
James Robinson
685a549229 Move window_manager service implementation to //services
R=erg@chromium.org

Review URL: https://codereview.chromium.org/765753003
2014-12-02 10:52:00 -08:00
James Robinson
84690ebeab Add tracing service and make the shell+sky_viewer+services talk to it
This adds a tracing service that can aggregate tracing data from
multiple sources and write a json file out to disk that trace-viewer can
understand. This also teaches the shell, sky_viewer, and various other
services how to register themselves with the tracing service and provide
tracing data on demand. Finally, this teaches the skydb prompt to tell
the tracing service to start/stop tracing when the 'trace' command is
issued.

The tracing service exposes two APIs, a collector interface and a
coordinator interface. The collector interface allows different entities
to register themselves as being capable of producing tracing data. The
coordinator interface allows asking the service to collect data from
all registered sources and flushing the collected data to disk.

The service keeps track of all open connections to registered sources
and broadcasts a request for data whenever the coordinator's Start
method is called, then aggregates all data send back into a single
trace file. In this patch, the tracing service simply gives all sources
1 second to return data then flushes to disk. Ideally it would keep
track of how many requests it sent out and give each source a certain
amount of time to respond but this is simple and works for most cases.

The tracing service can talk to any source that is capable of producing
data that the trace-viewer can handle, which is a broad set, but in
practice many programs will want to use //base/debug's tracing to
produce trace data. This adds code at //mojo/common:tracing_impl that
registers a collector hooked up to //base/debug's tracing system. This
can be dropped in to the mojo::ApplicationDelegate::Initialize()
implementation for most services and applications to easily enable
base tracing. Programs that don't use //base, or that want to register
additional data sources that can talk to trace viewer (perhaps providing
data that's more easily available from another thread, say) may want
to create additional connections to the tracing service.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/769963004
2014-12-01 16:31:03 -08:00
Adam Barth
ead67ecbbf Remove event targeting hack
Mojo's event targeting system has evolved to the point were we don't need this
ugly hack anymore.

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

Review URL: https://codereview.chromium.org/762443002
2014-11-26 09:00:04 -08:00
James Robinson
973bb96d11 Move tracing_impl code to mojo/common
This moves the tracing code and mojoms from sky/viewer/services/ to
mojo/common/ in anticipation of refactoring these to be more widely
usable. This doesn't actually change behaviors yet.

BUG=436639
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/751303003
2014-11-25 16:23:42 -08:00
Scott Violet
90f1388f44 Makes views be initially hidden
This better matches what other toolkits do and lets the client
configure the view before we attempt to show something for it.

BUG=434429
TEST=covered by test
R=erg@chromium.org

Review URL: https://codereview.chromium.org/745743002
2014-11-20 13:04:25 -08:00
Elliot Glaysher
13d46ddaca Dispatch key events to the currently focused window.
This fixes the browser demo. You can now enter text into the URL bar.

BUG=431047
R=sky@chromium.org

Review URL: https://codereview.chromium.org/737913002
2014-11-19 10:39:24 -08:00
Eric Seidel
38981ef393 Remove DEPS from sky
Also taught PRESUBMIT.py how to ignore DEPS for sky/
since gn check already covers everything we were using DEPS for.

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

Review URL: https://codereview.chromium.org/737493002
2014-11-17 11:16:44 -08:00
Benjamin Lerman
e1311d656d Change mojo application name to {name}.mojo
Also remove obsolete reference to gyp files.

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

Review URL: https://codereview.chromium.org/713513002
2014-11-14 21:49:31 +01:00
Adam Barth
411a9113b8 Input events are broken in skydb
When we removed Aura from the build, we broke event targeting. This CL hacks
around the issue by blindly forwarding events from the root view to the content
view in skydb. Once we have proper event targeting, we should rip out this code.

R=erg@chromium.org

Review URL: https://codereview.chromium.org/714213003
2014-11-12 10:32:54 -08:00
Elliot Glaysher
23babae2de Reland: Remove aura and make a pure mojo::View version of FocusController.
[Changes: Remove additional deps which Linux/Windows was fine with, but
which broke android because it implied an aura dependency. window_manager
should now be properly deauraed.]

This patch is only half done, however the main driver (removing aura) is
needed by other teams for them to make progress.

Input handling is regressed in this patch; while FocusController is
rebuilt to the point where it should theoretically work, all of the
details about ui::EventTargeter don't work correctly. There is an empty
subclass ViewTargeter which will need to be filled out before

Thankfully, this should only regress people who are using the wm_flow
demo, and this should unblock the android guys who don't have aura
support on their platform.

BUG=431047
TBR=eseidel@chromium.org, sky@chromium.org

Review URL: https://codereview.chromium.org/710203006
2014-11-10 17:06:49 -08:00
Elliot Glaysher
cf51d90a37 Revert "Remove aura and make a pure mojo::View version of the aura::Window FocusController."
This reverts commit bb29e4293b6e60ee721b5be17f9fa9f4989a1981.

This is a speculative revert due to android waterfall bots failing.

BUG=431047
TBR=ojan@chromium.org,sky@chromium.org

Review URL: https://codereview.chromium.org/718573002
2014-11-10 16:28:49 -08:00
Elliot Glaysher
e5278621eb Remove aura and make a pure mojo::View version of the aura::Window FocusController.
This patch is only half done, however the main driver (removing aura) is needed by other teams for them to make progress.

Input handling is regressed in this patch; while FocusController is rebuilt to the point where it should theoretically work, all of the details about ui::EventTargeter don't work correctly. There is an empty subclass ViewTargeter which will need to be filled out before

Thankfully, this should only regress people who are using the wm_flow demo, and this should unblock the android guys who don't have aura support on their platform.

BUG=431047
R=eseidel@chromium.org, sky@chromium.org

Review URL: https://codereview.chromium.org/698543005
2014-11-10 15:42:36 -08:00
Eric Seidel
9eb275c267 Add back exit(0) until crbug.com/430581 can be resolved.
BUG=430581
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/693433005
2014-11-06 12:55:29 -08:00
Eric Seidel
2ee8874f35 Bring skydebugger closer to clean-shutdown
This teaches the SkyDebugger prompt how to tell
the sky debugger (server) to shut down instead of
just calling exit(0).

This also teaches the WindowManagerApp (server) how
to tear down all of its connections itself instead
of depending on the pipes to do so (which would
crash when youd delete the WindowManagerApp as the
pipes could outlive it with WindowManagerImpl objects
containing raw pointers back to the WindowManagerApp).

Shutdown is not yet clean.  It errors out trying to
talk to the X11 server, but it's closer to clean
than it was prior to this change.  I may add back
and exit(0) to side-step shutdown until it can be
made fully clean.

R=jamesr@chromium.org, sky@chromium.org
BUG=430291, 430242

Review URL: https://codereview.chromium.org/695183003
2014-11-05 13:09:08 -08:00
Adam Barth
9a2441ce9e Make clicking links work in SkyDB
Now the SkyDebugger implements NavigatorHost and actually navigates the
mojo::View. This CL pulled a big refactor of sky/tools/debugger to separate out
MojoMain from debugger.cc.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/690363002
2014-10-31 13:17:15 -07:00
Viet-Trung Luu
d707787423 mojom: Remove braces from module statements and make them come first.
So, instead of:

import "bar.mojom";
module foo {
  ...
}

You'll do:

module foo;
import "bar.mojom";
...

(Note that the grammar in the parser doesn't capture the ordering
constraint. It's hard to do so while keeping the grammar LR(1) AFAICT.
So instead we enforce the ordering "manually".)

Also delete mojo/spy/PRESUBMIT.py since it's broken. We'll delete
mojo/spy separately.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/687793004
2014-10-31 12:59:52 -07:00
Eric Seidel
84064defab Make it possible to change the viewport size
This makes it possible to change the viewport size
which mojo is using.  The sky debugger uses this new
API to set the viewport to something closer to mobile
instead of 800x600 ancient desktop size. :)

Still the (800, 600) constant is prevelant throughout
mojo (just search for it) and mojo does not seem to
fully update when the viewport size changes, so we actually
only see 320x600 pixels instead of 320x640 in
sky debugger after this change.

Mostly this change is about validating that this is the
correct way to plumb this information.

R=sky@chromium.org

Review URL: https://codereview.chromium.org/692693002
2014-10-30 14:20:45 -07:00
Eric Seidel
eb58358bab Slight simplification to prompt code
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/678833004
2014-10-29 12:15:34 -07:00