Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Issue 1053883002: Make embedder.serviceRegistry return a ServiceRegistry instead of ServiceRegistryProxy. (Closed)

Created:
5 years, 8 months ago by tonyg
Modified:
5 years, 8 months ago
Reviewers:
eseidel
CC:
abarth-chromium, mojo-reviews_chromium.org, ojan, qsr+mojo_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Make embedder.serviceRegistry return a ServiceRegistry instead of ServiceRegistryProxy. The proxy has methods like close() that I think we're not intending to expose to the caller. The ServiceRegistry is just the interface itself. This also avoids users of the API from having to add a .ptr to their usages of the registry. BUG= R=eseidel@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/60f07c5317dda07603a876bc7f0165b7152bbcbb

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M sky/framework/embedder.dart View 2 chunks +3 lines, -3 lines 2 comments Download

Messages

Total messages: 11 (1 generated)
tonyg
afaict, (via build, test and grep) nothing in the mojo repo calls this. My main ...
5 years, 8 months ago (2015-04-01 22:42:23 UTC) #2
eseidel
https://codereview.chromium.org/1053883002/diff/1/sky/framework/embedder.dart File sky/framework/embedder.dart (left): https://codereview.chromium.org/1053883002/diff/1/sky/framework/embedder.dart#oldcode17 sky/framework/embedder.dart:17: ServiceRegistry _serviceRegistry; On 2015/04/01 at 22:42:23, tonyg wrote: > ...
5 years, 8 months ago (2015-04-01 22:43:24 UTC) #3
tonyg
On 2015/04/01 22:43:24, eseidel wrote: > https://codereview.chromium.org/1053883002/diff/1/sky/framework/embedder.dart > File sky/framework/embedder.dart (left): > > https://codereview.chromium.org/1053883002/diff/1/sky/framework/embedder.dart#oldcode17 > ...
5 years, 8 months ago (2015-04-01 22:45:26 UTC) #4
eseidel
https://codereview.chromium.org/1047363002
5 years, 8 months ago (2015-04-01 22:48:38 UTC) #5
tonyg
On 2015/04/01 22:48:38, eseidel wrote: > https://codereview.chromium.org/1047363002 Ah, gotcha. I see that wasn't landed yet. ...
5 years, 8 months ago (2015-04-01 22:57:44 UTC) #6
eseidel
This code seems otherwise unused. I'm not the original author, but the original author is ...
5 years, 8 months ago (2015-04-01 23:27:15 UTC) #7
tonyg
Committed patchset #1 (id:1) manually as 60f07c5317dda07603a876bc7f0165b7152bbcbb (presubmit successful).
5 years, 8 months ago (2015-04-01 23:33:19 UTC) #8
hansmuller1
On 2015/04/01 23:33:19, tonyg wrote: > Committed patchset #1 (id:1) manually as > 60f07c5317dda07603a876bc7f0165b7152bbcbb (presubmit ...
5 years, 8 months ago (2015-04-02 14:19:47 UTC) #9
tonyg
On 2015/04/02 14:19:47, hansmuller1 wrote: > On 2015/04/01 23:33:19, tonyg wrote: > > Committed patchset ...
5 years, 8 months ago (2015-04-02 14:49:45 UTC) #10
hansmuller1
5 years, 8 months ago (2015-04-02 15:03:55 UTC) #11
Message was sent while issue was closed.
On 2015/04/02 14:49:45, tonyg wrote:
> On 2015/04/02 14:19:47, hansmuller1 wrote:
> > On 2015/04/01 23:33:19, tonyg wrote:
> > > Committed patchset #1 (id:1) manually as
> > > 60f07c5317dda07603a876bc7f0165b7152bbcbb (presubmit successful).
> > 
> > I would have preferred that you hadn't made this change; I'd prefer not to
> have
> > APIs that return foo.ptr.
> 
> You have your head around the API a lot better than I so I'm happy to revert
if
> you prefer. But I would like to understand the reasoning for not having APIs
> that return a proxy's ptr.
> 
> In that mega-patch where we had all those clean-shutdown issues, Jim and I
> talked a lot about passing around proxies in our code and came to the
conclusion
> that if you pass the full proxy, it either means the caller must take some
> responsibility over its lifetime (like needing to call close()) or more
> practically speaking it leaves it ambiguous to the caller whether they're
> supposed to. However, to make it clear that the caller is not responsible for
> the lifetime because the vending class controls it, an api can pass only the
> pointer. This makes it obvious that the caller caller isn't responsible for
> closing because it doesn't have access to the lifetime related methods.
> Thoughts?

I'd prefer that the type of Proxy references be FooProxy and Stub references
be  FooStub. That's a rather important distinction; not worth losing for
the convenience of leaving out ".ptr" when referring to a proxy method.

I agree that, by default, the lifetime of Mojo resources be
the responsibility of the code that created them, not whomever
uses them last. I think that the problem we have with managing lifetimes
is not errant closing of shared resources, it's never closing them.


> 
> > I'd had a different pending change -
https://codereview.chromium.org/10473630
> 
> So this patch fixed that type bug in the same way (because I just happened to
> notice it), but it was orthogonal to the API change intended in my patch.

Powered by Google App Engine
This is Rietveld 408576698