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

Unified Diff: services/surfaces/surfaces_impl.cc

Issue 807733002: Split surface id and simplify connecting to surfaces service (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/surfaces/surfaces_impl.cc
diff --git a/services/surfaces/surfaces_impl.cc b/services/surfaces/surfaces_impl.cc
index df91bf8ddb353804fd448250ae796e8d1f045aef..114875a571e7acd981e6d6167a0a0c92530fc9cb 100644
--- a/services/surfaces/surfaces_impl.cc
+++ b/services/surfaces/surfaces_impl.cc
@@ -26,13 +26,30 @@ void CallCallback(const mojo::Closure& callback) {
SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager,
sky 2014/12/16 03:34:04 nit: move to match position in header.
uint32_t id_namespace,
- Client* client,
- mojo::SurfacePtr* surface)
+ Client* client)
: manager_(manager),
factory_(manager, this),
id_namespace_(id_namespace),
client_(client),
- binding_(this, surface) {
+ binding_(this) {
+}
+
+SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager,
+ uint32_t id_namespace,
+ Client* client,
+ mojo::InterfaceRequest<mojo::Surface> request)
+ : SurfacesImpl(manager, id_namespace, client) {
+ binding_.Bind(request.Pass());
+ binding_.client()->SetIdNamespace(id_namespace);
+}
+
+SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager,
+ uint32_t id_namespace,
+ Client* client,
+ mojo::SurfacePtr* surface)
+ : SurfacesImpl(manager, id_namespace, client) {
+ binding_.Bind(surface);
+ binding_.client()->SetIdNamespace(id_namespace);
}
SurfacesImpl::~SurfacesImpl() {
@@ -40,7 +57,7 @@ SurfacesImpl::~SurfacesImpl() {
factory_.DestroyAll();
}
-void SurfacesImpl::CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) {
+void SurfacesImpl::CreateSurface(SurfaceIdPtr id) {
cc::SurfaceId cc_id = id.To<cc::SurfaceId>();
if (cc::SurfaceIdAllocator::NamespaceForId(cc_id) != id_namespace_) {
// Bad message, do something bad to the caller?

Powered by Google App Engine
This is Rietveld 408576698