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

Unified Diff: mojo/examples/surfaces_app/child_impl.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader Created 6 years, 5 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
« no previous file with comments | « mojo/examples/surfaces_app/child_impl.h ('k') | mojo/examples/window_manager/window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/surfaces_app/child_impl.cc
diff --git a/mojo/examples/surfaces_app/child_impl.cc b/mojo/examples/surfaces_app/child_impl.cc
index 2d5140a7248d7581e2d41cdbeb8750ffceb72d97..e84e933f67b03f55bd95e4acee0c86f2d1c25829 100644
--- a/mojo/examples/surfaces_app/child_impl.cc
+++ b/mojo/examples/surfaces_app/child_impl.cc
@@ -27,30 +27,9 @@ using cc::SolidColorDrawQuad;
using cc::DelegatedFrameData;
using cc::CompositorFrame;
-class SurfaceClientImpl : public surfaces::SurfaceClient {
- public:
- explicit SurfaceClientImpl(ChildImpl* impl) : impl_(impl) {}
- virtual ~SurfaceClientImpl() {}
-
- // surfaces::SurfaceClient implementation
- virtual void SetIdNamespace(uint32_t id_namespace) OVERRIDE {
- impl_->SetIdNamespace(id_namespace);
- }
-
- virtual void ReturnResources(
- Array<surfaces::ReturnedResourcePtr> resources) OVERRIDE {
- DCHECK(!resources.size());
- }
-
- private:
- ChildImpl* impl_;
-};
-
-ChildImpl::ChildImpl(ApplicationConnection* connection, Context* context)
- : surface_client_(new SurfaceClientImpl(this)) {
- context->ShellConnection("mojo:mojo_surfaces_service")
- ->ConnectToService(&surface_);
- surface_.set_client(surface_client_.get());
+ChildImpl::ChildImpl(ApplicationConnection* surfaces_service_connection) {
+ surfaces_service_connection->ConnectToService(&surface_);
+ surface_.set_client(this);
}
ChildImpl::~ChildImpl() {
@@ -74,6 +53,11 @@ void ChildImpl::SetIdNamespace(uint32_t id_namespace) {
Draw();
}
+void ChildImpl::ReturnResources(
+ Array<surfaces::ReturnedResourcePtr> resources) {
+ DCHECK(!resources.size());
+}
+
void ChildImpl::Draw() {
id_ = allocator_->GenerateId();
surface_->CreateSurface(mojo::surfaces::SurfaceId::From(id_),
« no previous file with comments | « mojo/examples/surfaces_app/child_impl.h ('k') | mojo/examples/window_manager/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698