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
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
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
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
--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
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
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
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
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
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
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
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
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
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
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
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
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
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
[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
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
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
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
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
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
I accidentally broke border parsing when
removing CSS color keyword hacks.
While debugging this I also ran into a
race condition in the debugger, which
is fixed here.
Add --gdb argument to skydb
Makes it trivial to drop into gdb having launched
mojo_shell/sky with the right arguments.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/673073002
I had to also register for the text/plain mime-type
which turned out to be harder than expected.
Mostly due to my confusion with mojo_shell
using last-argument-wins argument parsing.
R=ianh@google.com
Review URL: https://codereview.chromium.org/672363002