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

Side by Side Diff: mojo/services/surfaces/surfaces_service_application.cc

Issue 687433002: Remove mojo/shell and (most) service implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove mojo/gles2, disable mojo apps in component build 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/services/surfaces/surfaces_service_application.h"
6
7 #include "cc/surfaces/display.h"
8
9 #include "mojo/application/application_runner_chromium.h"
10 #include "mojo/public/c/system/main.h"
11 #include "mojo/services/surfaces/surfaces_service_impl.h"
12
13 namespace mojo {
14
15 SurfacesServiceApplication::SurfacesServiceApplication()
16 : next_id_namespace_(1u), display_(NULL), draw_timer_(false, false) {
17 }
18
19 SurfacesServiceApplication::~SurfacesServiceApplication() {
20 }
21
22 bool SurfacesServiceApplication::ConfigureIncomingConnection(
23 ApplicationConnection* connection) {
24 connection->AddService(this);
25 return true;
26 }
27
28 void SurfacesServiceApplication::Create(
29 ApplicationConnection* connection,
30 InterfaceRequest<SurfacesService> request) {
31 BindToRequest(new SurfacesServiceImpl(&manager_, &next_id_namespace_, this),
32 &request);
33 }
34
35 void SurfacesServiceApplication::FrameSubmitted() {
36 if (!draw_timer_.IsRunning() && display_) {
37 draw_timer_.Start(FROM_HERE,
38 base::TimeDelta::FromMilliseconds(17),
39 base::Bind(base::IgnoreResult(&cc::Display::Draw),
40 base::Unretained(display_)));
41 }
42 }
43
44 void SurfacesServiceApplication::SetDisplay(cc::Display* display) {
45 display_ = display;
46 }
47
48 } // namespace mojo
49
50 MojoResult MojoMain(MojoHandle shell_handle) {
51 mojo::ApplicationRunnerChromium runner(new mojo::SurfacesServiceApplication);
52 return runner.Run(shell_handle);
53 }
OLDNEW
« no previous file with comments | « mojo/services/surfaces/surfaces_service_application.h ('k') | mojo/services/surfaces/surfaces_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698