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

Unified Diff: services/fake_surfaces/fake_surfaces_service_application.cc

Issue 882083003: Remove mojo.SurfacesService interface in favor of mojo.Surface directly (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months 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/fake_surfaces/fake_surfaces_service_application.cc
diff --git a/services/fake_surfaces/fake_surfaces_service_application.cc b/services/fake_surfaces/fake_surfaces_service_application.cc
index 6ee37def56956e88b45c644bb639a4f40ad88f07..56508f6dcbf4c8120e51996165ff20961bf6179e 100644
--- a/services/fake_surfaces/fake_surfaces_service_application.cc
+++ b/services/fake_surfaces/fake_surfaces_service_application.cc
@@ -60,30 +60,6 @@ class FakeSurfaceImpl : public mojo::Surface {
DISALLOW_COPY_AND_ASSIGN(FakeSurfaceImpl);
};
-class FakeSurfacesServiceImpl : public mojo::SurfacesService {
- public:
- FakeSurfacesServiceImpl(uint32_t* id_namespace,
- InterfaceRequest<mojo::SurfacesService> request)
- : binding_(this, request.Pass()), next_id_namespace_(id_namespace) {}
- ~FakeSurfacesServiceImpl() override {}
-
- // mojo::SurfacesService implementation.
- void CreateSurfaceConnection(
- const mojo::Callback<void(mojo::SurfacePtr, uint32_t)>& callback)
- override {
- mojo::SurfacePtr surface;
- uint32_t id_namespace = (*next_id_namespace_)++;
- new FakeSurfaceImpl(id_namespace, GetProxy(&surface));
- callback.Run(surface.Pass(), id_namespace);
- }
-
- private:
- mojo::StrongBinding<mojo::SurfacesService> binding_;
- uint32_t* next_id_namespace_;
-
- DISALLOW_COPY_AND_ASSIGN(FakeSurfacesServiceImpl);
-};
-
FakeSurfacesServiceApplication::FakeSurfacesServiceApplication()
: next_id_namespace_(1u) {
}
@@ -97,19 +73,12 @@ void FakeSurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) {
bool FakeSurfacesServiceApplication::ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) {
- connection->AddService<mojo::SurfacesService>(this);
- connection->AddService<mojo::Surface>(this);
+ connection->AddService(this);
return true;
}
void FakeSurfacesServiceApplication::Create(
mojo::ApplicationConnection* connection,
- InterfaceRequest<mojo::SurfacesService> request) {
- new FakeSurfacesServiceImpl(&next_id_namespace_, request.Pass());
-}
-
-void FakeSurfacesServiceApplication::Create(
- mojo::ApplicationConnection* connection,
InterfaceRequest<mojo::Surface> request) {
new FakeSurfaceImpl(next_id_namespace_++, request.Pass());
}
« no previous file with comments | « services/fake_surfaces/fake_surfaces_service_application.h ('k') | services/native_viewport/viewport_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698