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

Side by Side Diff: mojo/services/surfaces/surfaces_service_application.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, 4 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 unified diff | Download patch | Annotate | Revision Log
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 #include "mojo/services/surfaces/surfaces_service_application.h" 5 #include "mojo/services/surfaces/surfaces_service_application.h"
6 6
7 #include "cc/surfaces/display.h" 7 #include "cc/surfaces/display.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace surfaces { 10 namespace surfaces {
11 11
12 SurfacesServiceApplication::SurfacesServiceApplication() 12 SurfacesServiceApplication::SurfacesServiceApplication()
13 : next_id_namespace_(1u), display_(NULL) { 13 : next_id_namespace_(1u), display_(NULL) {
14 } 14 }
15 15
16 SurfacesServiceApplication::~SurfacesServiceApplication() { 16 SurfacesServiceApplication::~SurfacesServiceApplication() {
17 } 17 }
18 18
19 bool SurfacesServiceApplication::ConfigureIncomingConnection( 19 bool SurfacesServiceApplication::ConfigureIncomingConnection(
20 ApplicationConnection* connection) { 20 ApplicationConnection* connection) {
21 connection->AddService<SurfacesImpl, SurfacesImpl::Context>(this); 21 connection->AddService(this);
22 return true; 22 return true;
23 } 23 }
24 24
25 cc::SurfaceManager* SurfacesServiceApplication::Manager() { 25 void SurfacesServiceApplication::Create(ApplicationConnection* connection,
26 return &manager_; 26 InterfaceRequest<Surface> request) {
27 } 27 BindToRequest(new SurfacesImpl(&manager_, next_id_namespace_++, this),
28 28 &request);
29 uint32_t SurfacesServiceApplication::IdNamespace() {
30 return next_id_namespace_++;
31 } 29 }
32 30
33 void SurfacesServiceApplication::FrameSubmitted() { 31 void SurfacesServiceApplication::FrameSubmitted() {
34 if (display_) 32 if (display_)
35 display_->Draw(); 33 display_->Draw();
36 } 34 }
37 35
38 void SurfacesServiceApplication::SetDisplay(cc::Display* display) { 36 void SurfacesServiceApplication::SetDisplay(cc::Display* display) {
39 display_ = display; 37 display_ = display;
40 } 38 }
41 39
42 } // namespace surfaces 40 } // namespace surfaces
43 41
44 // static 42 // static
45 ApplicationDelegate* ApplicationDelegate::Create() { 43 ApplicationDelegate* ApplicationDelegate::Create() {
46 return new surfaces::SurfacesServiceApplication; 44 return new surfaces::SurfacesServiceApplication;
47 } 45 }
48 46
49 } // namespace mojo 47 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/surfaces/surfaces_service_application.h ('k') | mojo/services/test_service/test_request_tracker_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698