0
Commit Graph

119 Commits

Author SHA1 Message Date
ben
8366b12610 Change signature of OnConnect:
- pass remote identity & interface registry instead of dual purpose Connection object
- Connection is now only returned via Connect() & has no AddInterface() methods.
- updates all Service impls & ConnectionFilter.

R=rockot@chromium.org

BUG=
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2215133002
Cr-Commit-Position: refs/heads/master@{#410543}
2016-08-09 02:39:51 +00:00
ben
97a8ae930e Make Tracing Service not use outgoing InterfaceProvider, update conventions
R=rockot@chromium.org,tsepez@chromium.org

Review-Url: https://codereview.chromium.org/2208783002
Cr-Commit-Position: refs/heads/master@{#409660}
2016-08-03 23:29:41 +00:00
ben
438daa52db MojoMain() -> ServiceMain()
R=rockot@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2192263002
Cr-Commit-Position: refs/heads/master@{#408778}
2016-07-29 22:03:59 +00:00
ben
c580dfb4e8 Make Service own ServiceContext.
. Remove connector & id parameters from OnStart
. Update all the callsites.

R=rockot@chromium.org,tsepez@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2179023004
Cr-Commit-Position: refs/heads/master@{#407992}
2016-07-27 00:45:34 +00:00
ben
0b326f1b91 Remove shell::Connection* parameter to InterfaceFactory<T>::Create()
Replace with shell::Identity, since that's all anyone used.

R=rockot@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2182643003
Cr-Commit-Position: refs/heads/master@{#407854}
2016-07-26 18:15:22 +00:00
brettw
59a0584f60 Convert some component source sets to static library
This is hoping to achieve better build performance.

BUG=627637

Review-Url: https://codereview.chromium.org/2161363005
Cr-Commit-Position: refs/heads/master@{#406975}
2016-07-21 22:47:57 +00:00
ben
41cae6c40b Rename mojo_application GN templates thusly:
mojo_native_application -> service_package
mojo_application_manifest -> service_manifest
.mojo extension -> .library

Review-Url: https://codereview.chromium.org/2164503006
Cr-Commit-Position: refs/heads/master@{#406777}
2016-07-21 06:09:53 +00:00
ben
e7af97e9c3 shell::ApplicationRunner -> shell::ServiceRunner
TBR=rockot@chromium.org
BUG=none

Review-Url: https://codereview.chromium.org/2156203003
Cr-Commit-Position: refs/heads/master@{#406381}
2016-07-19 21:25:11 +00:00
yzshen
4e4d53c691 Mojo C++ bindings: make the generator use STL/WTF string/vector/map by default.
This CL flips the default value of use_new_wrapper_types from "false" to "true".

BUG=624136
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/2156303003
Cr-Commit-Position: refs/heads/master@{#406224}
2016-07-19 06:58:03 +00:00
leon.han
83055f715f Eliminate usage of InterfacePtr::WaitForIncomingResponse.
This CL removes InterfacePtr::WaitForIncomingResponse definition
and replaces usage of them with either [Sync] call or
a nested MessageLoop waiting asynchronously.

BUG=622438

Review-Url: https://codereview.chromium.org/2096293002
Cr-Commit-Position: refs/heads/master@{#404579}
2016-07-10 05:33:11 +00:00
ben
988bf0aaca ShellTest -> ServiceTest
TBR=rockot@chromium.org

Review-Url: https://codereview.chromium.org/2123363002
Cr-Commit-Position: refs/heads/master@{#404094}
2016-07-07 06:57:42 +00:00
ben
e1bbc00124 ShellClient -> Service
TBR=rockot@chromium.org,tsepez@chromium.org
http://crbug.com/625840

Review-Url: https://codereview.chromium.org/2118083002
Cr-Commit-Position: refs/heads/master@{#403786}
2016-07-05 16:06:06 +00:00
dcheng
e07de81b11 Add PRESUBMIT rule to make sure IPC changes are security reviewed.
The PRESUBMIT rule makes sure that files involving IPC are covered
by the appropriate per-file rules. See https://goo.gl/NRiIPv for
other alternatives that were considered (e.g. why not recursive
per-file rules?).

BUG=611905
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/2070483002
Cr-Commit-Position: refs/heads/master@{#400748}
2016-06-20 19:29:03 +00:00
rockot
a21316a36e Deletes mojo::Callback
Removes all references to mojo::Callback and mojo::Closure,
replacing them with base::Callback or base::Closure, or
where applicable a mojom-generated callback alias.

The vast majority of the changes here are name changes only,
as mojo::Callback is already an alias for base::Callback.
Hence the TBRs.

Also removes mojo/public/cpp/bindings/callback.h

BUG=620840
TBR=ben@chromium.org for chrome, content, misc
TBR=lhchavez@chromium.org for components/arc
TBR=xhwang@chromium.org for media
TBR=haraken@chromium.org for third_party/WebKit

Committed: https://crrev.com/3524eb5ef75b90527195d82f8b9cf3bd2cdf04ef
Review-Url: https://codereview.chromium.org/2080513002
Cr-Original-Commit-Position: refs/heads/master@{#400616}
Cr-Commit-Position: refs/heads/master@{#400620}
2016-06-19 17:10:27 +00:00
yutak
f66fe7e469 Revert of Deletes mojo::Callback (patchset id:20001 of https://codereview.chromium.org/2080513002/ )
Reason for revert:
Caused compile errors.
https://build.chromium.org/p/chromium.perf/builders/Android%20Builder/builds/91059

Sounds like this raced with the following change:
61fdb768d7

Original issue's description:
> Deletes mojo::Callback
>
> Removes all references to mojo::Callback and mojo::Closure,
> replacing them with base::Callback or base::Closure, or
> where applicable a mojom-generated callback alias.
>
> The vast majority of the changes here are name changes only,
> as mojo::Callback is already an alias for base::Callback.
> Hence the TBRs.
>
> Also removes mojo/public/cpp/bindings/callback.h
>
> BUG=620840
> TBR=ben@chromium.org for chrome, content, misc
> TBR=lhchavez@chromium.org for components/arc
> TBR=xhwang@chromium.org for media
> TBR=haraken@chromium.org for third_party/WebKit
>
> Committed: https://crrev.com/3524eb5ef75b90527195d82f8b9cf3bd2cdf04ef
> Cr-Commit-Position: refs/heads/master@{#400616}

TBR=rockot@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=620840

Review-Url: https://codereview.chromium.org/2080083002
Cr-Commit-Position: refs/heads/master@{#400617}
2016-06-19 09:26:22 +00:00
rockot
3524eb5ef7 Deletes mojo::Callback
Removes all references to mojo::Callback and mojo::Closure,
replacing them with base::Callback or base::Closure, or
where applicable a mojom-generated callback alias.

The vast majority of the changes here are name changes only,
as mojo::Callback is already an alias for base::Callback.
Hence the TBRs.

Also removes mojo/public/cpp/bindings/callback.h

BUG=620840
TBR=ben@chromium.org for chrome, content, misc
TBR=lhchavez@chromium.org for components/arc
TBR=xhwang@chromium.org for media
TBR=haraken@chromium.org for third_party/WebKit

Review-Url: https://codereview.chromium.org/2080513002
Cr-Commit-Position: refs/heads/master@{#400616}
2016-06-19 09:12:44 +00:00
rockot
c383dde801 mojo::Callback -> base::Callback
Replaces mojo::Callback with base::Callback.

This means updating several callback sites for the
following reasons:

- The mojo::Callback<T>::Runnable interface no longer exists
- C++11 lambas may no longer be bound implicitly
- Repsonse callback signatures must now match the generated
  signature exactly (i.e. no implicit conversion from
  const mojo::String& or const std::string& to a by-value
  mojo::String)
- Null mojo::Callbacks could be Run without crashing; this
  is no longer true.
- It's base::Callback::Reset instead of mojo::Callback::reset

mojo::Callback and mojo::Closure are left in place as aliases
for base::Callback and base::Closure until all references can
be updated.

BUG=620840
TBR=ben@chromium.org for general/toplevel
TBR=xhwang@chromium.org for media related changes

Review-Url: https://codereview.chromium.org/2062333002
Cr-Commit-Position: refs/heads/master@{#400598}
2016-06-18 20:18:13 +00:00
ben
ba768a8531 Remove a bunch of stuff in //mojo
R=rockot@chromium.org
http://crbug.com/608017

Review-Url: https://codereview.chromium.org/2008383002
Cr-Commit-Position: refs/heads/master@{#396079}
2016-05-26 01:26:51 +00:00
rockot
7afa85d212 Remove //mojo/platform_handle
The library is obviated by the new public C API for
platform handles. See
https://codereview.chromium.org/1995753002.

This CL removes all remaining references to the
now-empty build targets and wipes out the directory.

BUG=None
TBR=ben@chromium.org

Review-Url: https://codereview.chromium.org/2001403002
Cr-Commit-Position: refs/heads/master@{#395530}
2016-05-24 04:57:49 +00:00
rockot
28a287e885 [mojo-edk] Expose portable API for platform handle wrapping
Introduces a public C API allowing embedders and apps to exchange
Mojo handles for generic platform handles or platform shared
memory handles.

BUG=
R=amistry@chromium.org
TBR=ben@chromium.org

Review-Url: https://codereview.chromium.org/1995753002
Cr-Commit-Position: refs/heads/master@{#395521}
2016-05-24 02:53:24 +00:00
dcheng
89cbc40989 Add missing security OWNERS for mojoms in //components and //services.
BUG=611905

Review-Url: https://codereview.chromium.org/1981523003
Cr-Commit-Position: refs/heads/master@{#393844}
2016-05-16 16:42:18 +00:00
eugenebut
9b143c65c2 Extracted shell_interfaces and shell_public into a separate gyp file.
This change breaks components/filesystem/filesystem.gyp ->
services/shell/shell.gyp -> components/filesystem/filesystem.gyp
circular dependency which has been introduced here:
https://codereview.chromium.org/1942473002/diff/320001/services/shell/shell.gyp

and breaks runhooks on iOS as follows:
https://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/2023/steps/gclient%20runhooks%20%28with%20patch%29/logs/stdio

BUG=610554

Review-Url: https://codereview.chromium.org/1966563002
Cr-Commit-Position: refs/heads/master@{#393196}
2016-05-12 06:27:37 +00:00
leon.han
997448573a Add mojom module suffix in .mojom files for components/filesystem.
'module filesystem;' --> 'module filesystem.mojom;'
This way generated bindings will consistently live in a mojom
sub-namespace and avoid collision with non-mojom types.

This CL is for these .mojom files:
components/filesystem/public/interfaces/*.mojom

TBR=jochen, sky
BUG=588964

Review-Url: https://codereview.chromium.org/1962503002
Cr-Commit-Position: refs/heads/master@{#392538}
2016-05-10 03:49:26 +00:00
ben
9fe679e773 Now Catalog exposes the package resource directory to the calling application.
TODO: maybe it should expose the package directory?

R=sky@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/1942473002
Cr-Commit-Position: refs/heads/master@{#391714}
2016-05-05 00:29:31 +00:00
erg
a95c3cd937 mojo: Fix leveldb unittests by making fs::Directories cloneable.
This adds a Clone() method to mojo filesystem Directory objects, along
with making it safe to clone Directory objects that represent temporary
directories so that the temporary directory sticks around as long as
there's a single open File or Directory referencing it.

Using this, we can fix the last flaky LevelDBServiceTest that needed to
access the filesystem.

BUG=602820

Review-Url: https://codereview.chromium.org/1935863002
Cr-Commit-Position: refs/heads/master@{#391040}
2016-05-02 20:15:07 +00:00
erg
4652931e18 Enable swarming on filesystem_service_unittests.
BUG=606012

Review-Url: https://codereview.chromium.org/1914043002
Cr-Commit-Position: refs/heads/master@{#390212}
2016-04-27 22:17:55 +00:00
ben
44e1d5dc7a Eliminate support for V0 manifests, migrate all to V1.
. Also removes a bunch of [D]CHECKs from manifest parsing. Error reporting isn't perfect yet (file names aren't reported)... but this'll do for now. A future incarnation might replace the LOGs with an error recorder passed into Deserialize() from the caller, which can then LOG the result with context about what was being deserialized.

R=rockot@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/1916183004
Cr-Commit-Position: refs/heads/master@{#390114}
2016-04-27 17:25:54 +00:00
dcheng
84c358e7a3 Convert //components/[f-n]* from scoped_ptr to std::unique_ptr
BUG=554298
R=danakj@chromium.org
TBR=jochen@chromium.org,thestig@chromium.org

Review URL: https://codereview.chromium.org/1918083002

Cr-Commit-Position: refs/heads/master@{#389715}
2016-04-26 07:08:45 +00:00
rockot
b00e6460e7 Move shell service to toplevel shell namespace
Also scoped_ptr -> unique_ptr in //services/shell
since this has to touch all that code anyway.

BUG=None
R=ben@chromium.org
TBR=tsepez@chromium.org for mojom (renaming some things)
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review URL: https://codereview.chromium.org/1882423004

Cr-Commit-Position: refs/heads/master@{#387208}
2016-04-14 02:25:08 +00:00
ben
7095d1a47f Move //mojo/services tracing & catalog to //services.
TBR=jam@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1878893002

Cr-Commit-Position: refs/heads/master@{#386921}
2016-04-13 06:16:23 +00:00
ben
f709a309fc Move mojo\shell to services\shell
TBR=jam@chromium.org,tsepez@chromium.org
NOTRY=true
BUG=
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review URL: https://codereview.chromium.org/1877753003

Cr-Commit-Position: refs/heads/master@{#386836}
2016-04-12 22:39:47 +00:00
erg
b3d5935f0e mojo leveldb: Remove the created file thread.
This runs what was a background thread for file operations on the same
thread as the mojo application, which is the db thread in chrome, and
the main thread when run as an app.

BUG=585587

Review URL: https://codereview.chromium.org/1839823002

Cr-Commit-Position: refs/heads/master@{#383799}
2016-03-29 20:11:56 +00:00
sky
340545a9d2 Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used
This was originally at https://codereview.chromium.org/1814223002/ , but Ben is out and
I need this for tests, so I'm taking over.

BUG=none
TEST=covered by tests
TBR=ben@chromium.org
R=ben@chromium.org

Committed: https://crrev.com/a50f9840749052fbdec087a304548217cc6fd00b
Cr-Commit-Position: refs/heads/master@{#382389}

Review URL: https://codereview.chromium.org/1819063002

Cr-Commit-Position: refs/heads/master@{#382688}
2016-03-22 21:45:57 +00:00
esprehn
0ebf9a924d Revert of Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used (patchset id:20001 of https://codereview.chromium.org/1819063002/ )
Reason for revert:
Looks like to made the mojo_apptests go red. I think this is also making MUS tests fail?

https://build.chromium.org/p/chromium.linux/builders/Linux%20Tests/builds/39128

Original issue's description:
> Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used
>
> This was originally at https://codereview.chromium.org/1814223002/ , but Ben is out and
> I need this for tests, so I'm taking over.
>
> BUG=none
> TEST=covered by tests
> TBR=ben@chromium.org
> R=ben@chromium.org
>
> Committed: https://crrev.com/a50f9840749052fbdec087a304548217cc6fd00b
> Cr-Commit-Position: refs/heads/master@{#382389}

TBR=ben@chromium.org,sky@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=none

Review URL: https://codereview.chromium.org/1821913002

Cr-Commit-Position: refs/heads/master@{#382460}
2016-03-22 00:43:15 +00:00
sky
a50f984074 Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used
This was originally at https://codereview.chromium.org/1814223002/ , but Ben is out and
I need this for tests, so I'm taking over.

BUG=none
TEST=covered by tests
TBR=ben@chromium.org
R=ben@chromium.org

Review URL: https://codereview.chromium.org/1819063002

Cr-Commit-Position: refs/heads/master@{#382389}
2016-03-21 21:14:00 +00:00
erg
c112794307 mojo leveldb: Get profile and leveldb connected to DOMStorageContext.
Building on the last patch which built mojo:profile and built one
for each BrowserContext, we move the LevelDBService in the profile
application to a dedicated leveldb thread to avoid deadlocks.
(Since applications all run on one thread by default, leveldb would
deadlock while waiting for profile to return data.)

This patch connects to the correct applications in
DOMStorageContextWrapper and then vends a LevelDBService instance to
each LevelDBWrapperImpl, for future use.

BUG=586194
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review URL: https://codereview.chromium.org/1737933002

Cr-Commit-Position: refs/heads/master@{#382343}
2016-03-21 18:56:32 +00:00
erg
716b6174db Convert filesystem_apptests to shelltests.
BUG=594730

Review URL: https://codereview.chromium.org/1814983002

Cr-Commit-Position: refs/heads/master@{#382021}
2016-03-18 18:31:56 +00:00
rockot
d5669c5cce Change primordial pipes to ShellClient
Changes shell client startup pipes to be ShellClient instead
of ShellClientFactory. This simplifies a lot of startup code.

Due to this change, apps must now take responsibility for
shutting themselves down when they feel it's appropriate. For
now, all relevant apps are force-exited to mimic the old
behavior.

Once apptests are deleted, we should expose a clean quit
closure to apps so they have something to run when they want
to quit. Hard-exiting the process is definitely not the right
thing to do.

BUG=

Review URL: https://codereview.chromium.org/1801963002

Cr-Commit-Position: refs/heads/master@{#381114}
2016-03-14 23:40:38 +00:00
msw
b9e2c6eaab Remove stale mentions of mandoline.
BUG=NONE

Review URL: https://codereview.chromium.org/1751713002

Cr-Commit-Position: refs/heads/master@{#381096}
2016-03-14 22:38:10 +00:00
sky
e5b6ffe409 Moves mojo_application_manifest to data_deps
Otherwise they aren't picked up as runtime dependencies and isolates
won't work.

BUG=none
TEST=none
R=ben@chromium.org

Review URL: https://codereview.chromium.org/1783533003

Cr-Commit-Position: refs/heads/master@{#380347}
2016-03-10 05:46:40 +00:00
Yuzhu Shen
c24416c14f Remove Mojo bindings environment.
BUG=585942
R=ben@chromium.org

Review URL: https://codereview.chromium.org/1765243002 .

Cr-Commit-Position: refs/heads/master@{#379839}
2016-03-08 16:25:53 +00:00
ben
9a8e15f6e8 Add a instance groups to Connect(), and introduce an Identity struct.
BUG=
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review URL: https://codereview.chromium.org/1769163002

Cr-Commit-Position: refs/heads/master@{#379757}
2016-03-08 05:19:18 +00:00
ben
cccfe2ac0e Change userid from a uint32_t to a string guid
TBR=sky@chromium.org

BUG=

patch from issue 1760963003 at patchset 20001 (http://crrev.com/1760963003#ps20001)
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review URL: https://codereview.chromium.org/1770533002

Cr-Commit-Position: refs/heads/master@{#379476}
2016-03-05 16:55:47 +00:00
ben
c6eb8ad715 Change Mojo URLs to structured names.
type:path

Remove GURLs from all over the place. This eliminates the need to register Mojo and Exe schemes.

BUG=
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review URL: https://codereview.chromium.org/1743473002

Cr-Commit-Position: refs/heads/master@{#378130}
2016-02-27 08:54:21 +00:00
ben
e4a2bc4fb1 Replace with mojo::Connector (already exists) now that Shell is gone.
Requires:
- Move AppRefCount to a different class, MessageLoopRef, which is optionally used by applications that wish to quit the current message loop started by application runner when the ref drops to zero.
- Changing the signature of Initialize() to take a Connector. This is what most of the change in this CL is.

BUG=

Review URL: https://codereview.chromium.org/1725353003

Cr-Commit-Position: refs/heads/master@{#377841}
2016-02-26 07:31:39 +00:00
ben
a16b491f24 Add a user id parameter to connections.
This is simply a uint32 that identifies the user running a particular instance. Note that the shell cares nothing about higher level semantic meaning/mapping of this identifier. That's for a user service to perform.

An application that connects to another specifies the user id they wish the target to be run as. This can either be a specific user, the root user, or "inherit" which means either their own identity or root, whichever is available in that order.

The application manager resolves "inherit" to the source identity or the root identity, and initializes & completes the connection.

When a target application is initialized, the shell tells it (via Initialize()) the identity it is run as.

When a target application receives an inbound connection, the shell tells it (via AcceptConnection) the identity of the caller. This allows a service run as root to service connections from other users, and create facades scoped to that user.

Long term, only specific applications will be able to pass anything other than "inherit" as the user id. (e.g. the login app and the profile creator app). This isn't done in this CL.

I need to add some tests for this, along with the rest of the shell stuff. TBD.

R=sky@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review URL: https://codereview.chromium.org/1719193003

Cr-Commit-Position: refs/heads/master@{#377239}
2016-02-24 07:51:20 +00:00
erg
7e3aa65e32 mojo filesystem: Further clean ups.
- Cleans up pieces that I partially, but didn't fully delete in the last
  patch.
- Changes the FileSystem interface so that there isn't a free form string
  in in.
- Separates out the current mandoline directory choosing code into the app
  impl instead of the service impl. This should let us make a chrome version
  in a future patch.

BUG=585587

Review URL: https://codereview.chromium.org/1718123004

Cr-Commit-Position: refs/heads/master@{#377058}
2016-02-23 19:44:34 +00:00
erg
cf4ed86e0b mojo leveldb: Address some comments that came after it was put in the CQ.
BUG=585587,587185

Review URL: https://codereview.chromium.org/1724493003

Cr-Commit-Position: refs/heads/master@{#377046}
2016-02-23 19:26:01 +00:00
ben
7569dae285 This enforces the capability filter specified in an application manifest.
Note that this is mostly set to permissive right now because the capability filters as currently specified are a PITA to use. I'm going to be working with some of the security folk to devise a way to simplify this.

Review URL: https://codereview.chromium.org/1716793003

Cr-Commit-Position: refs/heads/master@{#376940}
2016-02-23 07:30:04 +00:00
erg
2853a31774 mojo: Get mojo:leveldb and mojo:filesystem compiled into content.
BUG=585587

Review URL: https://codereview.chromium.org/1708253004

Cr-Commit-Position: refs/heads/master@{#376779}
2016-02-22 19:59:51 +00:00