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

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

Issue 943053003: Simple multi-url support for mojo apps (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: hate Created 5 years, 9 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
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 "services/surfaces/surfaces_service_application.h" 5 #include "services/surfaces/surfaces_service_application.h"
6 6
7 #include "cc/surfaces/display.h" 7 #include "cc/surfaces/display.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "services/surfaces/surfaces_impl.h" 10 #include "services/surfaces/surfaces_impl.h"
11 11
12 namespace surfaces { 12 namespace surfaces {
13 13
14 SurfacesServiceApplication::SurfacesServiceApplication() 14 SurfacesServiceApplication::SurfacesServiceApplication()
15 : next_id_namespace_(1u), display_(nullptr) { 15 : next_id_namespace_(1u), display_(nullptr) {
16 } 16 }
17 17
18 SurfacesServiceApplication::~SurfacesServiceApplication() { 18 SurfacesServiceApplication::~SurfacesServiceApplication() {
19 } 19 }
20 20
21 void SurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) { 21 void SurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) {
22 tracing_.Initialize(app); 22 tracing_.Initialize(app);
23 scheduler_.reset(new SurfacesScheduler(this)); 23 scheduler_.reset(new SurfacesScheduler(this));
24 } 24 }
25 25
26 bool SurfacesServiceApplication::ConfigureIncomingConnection( 26 bool SurfacesServiceApplication::ConfigureIncomingConnection(
27 mojo::ApplicationConnection* connection) { 27 mojo::ApplicationConnection* connection,
28 const std::string& url) {
28 connection->AddService(this); 29 connection->AddService(this);
29 return true; 30 return true;
30 } 31 }
31 32
32 void SurfacesServiceApplication::Create( 33 void SurfacesServiceApplication::Create(
33 mojo::ApplicationConnection* connection, 34 mojo::ApplicationConnection* connection,
34 mojo::InterfaceRequest<mojo::Surface> request) { 35 mojo::InterfaceRequest<mojo::Surface> request) {
35 new SurfacesImpl(&manager_, next_id_namespace_++, this, request.Pass()); 36 new SurfacesImpl(&manager_, next_id_namespace_++, this, request.Pass());
36 } 37 }
37 38
(...skipping 21 matching lines...) Expand all
59 display_->Draw(); 60 display_->Draw();
60 } 61 }
61 62
62 } // namespace surfaces 63 } // namespace surfaces
63 64
64 MojoResult MojoMain(MojoHandle shell_handle) { 65 MojoResult MojoMain(MojoHandle shell_handle) {
65 mojo::ApplicationRunnerChromium runner( 66 mojo::ApplicationRunnerChromium runner(
66 new surfaces::SurfacesServiceApplication); 67 new surfaces::SurfacesServiceApplication);
67 return runner.Run(shell_handle); 68 return runner.Run(shell_handle);
68 } 69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698