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

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

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
« no previous file with comments | « mojo/services/surfaces/surfaces_impl.cc ('k') | mojo/services/surfaces/surfaces_service_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "mojo/application/application_runner_chromium.h" 9 #include "mojo/application/application_runner_chromium.h"
10 #include "mojo/public/c/system/main.h" 10 #include "mojo/public/c/system/main.h"
(...skipping 10 matching lines...) Expand all
21 21
22 bool SurfacesServiceApplication::ConfigureIncomingConnection( 22 bool SurfacesServiceApplication::ConfigureIncomingConnection(
23 ApplicationConnection* connection) { 23 ApplicationConnection* connection) {
24 connection->AddService(this); 24 connection->AddService(this);
25 return true; 25 return true;
26 } 26 }
27 27
28 void SurfacesServiceApplication::Create( 28 void SurfacesServiceApplication::Create(
29 ApplicationConnection* connection, 29 ApplicationConnection* connection,
30 InterfaceRequest<SurfacesService> request) { 30 InterfaceRequest<SurfacesService> request) {
31 BindToRequest(new SurfacesServiceImpl(&manager_, &next_id_namespace_, this), 31 new SurfacesServiceImpl(&manager_, &next_id_namespace_, this, request.Pass());
32 &request);
33 } 32 }
34 33
35 void SurfacesServiceApplication::FrameSubmitted() { 34 void SurfacesServiceApplication::FrameSubmitted() {
36 if (!draw_timer_.IsRunning() && display_) { 35 if (!draw_timer_.IsRunning() && display_) {
37 draw_timer_.Start(FROM_HERE, 36 draw_timer_.Start(FROM_HERE,
38 base::TimeDelta::FromMilliseconds(17), 37 base::TimeDelta::FromMilliseconds(17),
39 base::Bind(base::IgnoreResult(&cc::Display::Draw), 38 base::Bind(base::IgnoreResult(&cc::Display::Draw),
40 base::Unretained(display_))); 39 base::Unretained(display_)));
41 } 40 }
42 } 41 }
43 42
44 void SurfacesServiceApplication::SetDisplay(cc::Display* display) { 43 void SurfacesServiceApplication::SetDisplay(cc::Display* display) {
45 draw_timer_.Stop(); 44 draw_timer_.Stop();
46 display_ = display; 45 display_ = display;
47 } 46 }
48 47
49 void SurfacesServiceApplication::OnDisplayBeingDestroyed(cc::Display* display) { 48 void SurfacesServiceApplication::OnDisplayBeingDestroyed(cc::Display* display) {
50 if (display_ == display) 49 if (display_ == display)
51 SetDisplay(nullptr); 50 SetDisplay(nullptr);
52 } 51 }
53 52
54 } // namespace mojo 53 } // namespace mojo
55 54
56 MojoResult MojoMain(MojoHandle shell_handle) { 55 MojoResult MojoMain(MojoHandle shell_handle) {
57 mojo::ApplicationRunnerChromium runner(new mojo::SurfacesServiceApplication); 56 mojo::ApplicationRunnerChromium runner(new mojo::SurfacesServiceApplication);
58 return runner.Run(shell_handle); 57 return runner.Run(shell_handle);
59 } 58 }
OLDNEW
« no previous file with comments | « mojo/services/surfaces/surfaces_impl.cc ('k') | mojo/services/surfaces/surfaces_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698