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

Side by Side Diff: mojo/services/surfaces/surfaces_service_impl.h

Issue 718623004: Use Binding<Interface> in surfaces and gles2 code (Closed) Base URL: git@github.com:domokit/mojo.git@connector
Patch Set: use InterfaceRequest<> instead of InterfaceRequest<>* Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SERVICES_SURFACES_SURFACES_SERVICE_IMPL_H_ 5 #ifndef MOJO_SERVICES_SURFACES_SURFACES_SERVICE_IMPL_H_
6 #define MOJO_SERVICES_SURFACES_SURFACES_SERVICE_IMPL_H_ 6 #define MOJO_SERVICES_SURFACES_SURFACES_SERVICE_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "mojo/public/cpp/bindings/strong_binding.h"
9 #include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h" 10 #include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h"
10 #include "mojo/services/surfaces/surfaces_impl.h" 11 #include "mojo/services/surfaces/surfaces_impl.h"
11 12
12 namespace cc { 13 namespace cc {
13 class SurfaceManager; 14 class SurfaceManager;
14 } 15 }
15 16
16 namespace mojo { 17 namespace mojo {
17 18
18 class SurfacesServiceImpl : public InterfaceImpl<SurfacesService> { 19 class SurfacesServiceImpl : public SurfacesService {
19 public: 20 public:
20 // The instances pointed to by |manager|, |next_id_namespace| and |client| are 21 // The instances pointed to by |manager|, |next_id_namespace| and |client| are
21 // owned by the caller and must outlive the SurfacesServiceImpl instance. 22 // owned by the caller and must outlive the SurfacesServiceImpl instance.
22 SurfacesServiceImpl(cc::SurfaceManager* manager, 23 SurfacesServiceImpl(cc::SurfaceManager* manager,
23 uint32_t* next_id_namespace, 24 uint32_t* next_id_namespace,
24 SurfacesImpl::Client* client); 25 SurfacesImpl::Client* client,
26 InterfaceRequest<SurfacesService> request);
27
25 ~SurfacesServiceImpl() override; 28 ~SurfacesServiceImpl() override;
26 29
27 // InterfaceImpl<SurfacesService> implementation. 30 // SurfacesService implementation.
28 void CreateSurfaceConnection( 31 void CreateSurfaceConnection(
29 const mojo::Callback<void(mojo::SurfacePtr, uint32_t)>& callback) 32 const mojo::Callback<void(mojo::SurfacePtr, uint32_t)>& callback)
30 override; 33 override;
31 34
32 private: 35 private:
33 cc::SurfaceManager* manager_; 36 cc::SurfaceManager* manager_;
34 uint32_t* next_id_namespace_; 37 uint32_t* next_id_namespace_;
35 SurfacesImpl::Client* client_; 38 SurfacesImpl::Client* client_;
39 StrongBinding<SurfacesService> binding_;
36 40
37 DISALLOW_COPY_AND_ASSIGN(SurfacesServiceImpl); 41 DISALLOW_COPY_AND_ASSIGN(SurfacesServiceImpl);
38 }; 42 };
39 43
40 } // namespace mojo 44 } // namespace mojo
41 45
42 #endif // MOJO_SERVICES_SURFACES_SURFACES_SERVICE_IMPL_H_ 46 #endif // MOJO_SERVICES_SURFACES_SURFACES_SERVICE_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/services/surfaces/surfaces_service_application.cc ('k') | mojo/services/surfaces/surfaces_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698