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

Unified Diff: mojo/services/surfaces/surfaces_service_application.cc

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/surfaces/surfaces_service_application.h ('k') | mojo/services/test_service/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/surfaces/surfaces_service_application.cc
diff --git a/mojo/services/surfaces/surfaces_service_application.cc b/mojo/services/surfaces/surfaces_service_application.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7d3e370cc0d320457bb76c8967406f180d288d3f
--- /dev/null
+++ b/mojo/services/surfaces/surfaces_service_application.cc
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/surfaces/surfaces_service_application.h"
+
+#include "mojo/application/application_runner_chromium.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/services/surfaces/display_factory_impl.h"
+#include "mojo/services/surfaces/surfaces_impl.h"
+#include "mojo/services/surfaces/surfaces_scheduler.h"
+
+namespace surfaces {
+
+SurfacesServiceApplication::SurfacesServiceApplication()
+ : next_id_namespace_(1u) {
+}
+
+SurfacesServiceApplication::~SurfacesServiceApplication() {
+}
+
+void SurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) {
+ tracing_.Initialize(app);
+ scheduler_.reset(new SurfacesScheduler);
+}
+
+bool SurfacesServiceApplication::ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) {
+ connection->AddService<mojo::DisplayFactory>(this);
+ connection->AddService<mojo::Surface>(this);
+ return true;
+}
+
+void SurfacesServiceApplication::Create(
+ mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mojo::DisplayFactory> request) {
+ new DisplayFactoryImpl(&manager_, next_id_namespace_++, scheduler_.get(),
+ request.Pass());
+}
+
+void SurfacesServiceApplication::Create(
+ mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mojo::Surface> request) {
+ new SurfacesImpl(&manager_, next_id_namespace_++, scheduler_.get(),
+ request.Pass());
+}
+
+} // namespace surfaces
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+ mojo::ApplicationRunnerChromium runner(
+ new surfaces::SurfacesServiceApplication);
+ return runner.Run(shell_handle);
+}
« no previous file with comments | « mojo/services/surfaces/surfaces_service_application.h ('k') | mojo/services/test_service/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698