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

Unified Diff: services/files/main.cc

Issue 875643004: Prototype of Files service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: already ignored EINTR Created 5 years, 10 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 | « services/files/futimens_android.cc ('k') | services/files/types.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/files/main.cc
diff --git a/services/files/main.cc b/services/files/main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9e457c057a86539c8196105f3450a16cadc1a111
--- /dev/null
+++ b/services/files/main.cc
@@ -0,0 +1,44 @@
+// Copyright 2015 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 "base/macros.h"
+#include "mojo/application/application_runner_chromium.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/public/cpp/application/application_connection.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/interface_factory.h"
+#include "services/files/files.mojom.h"
+#include "services/files/files_impl.h"
+
+namespace mojo {
+namespace files {
+
+class FilesApp : public ApplicationDelegate, public InterfaceFactory<Files> {
+ public:
+ FilesApp() {}
+ ~FilesApp() override {}
+
+ private:
+ // |ApplicationDelegate| override:
+ bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
+ connection->AddService<Files>(this);
+ return true;
+ }
+
+ // |InterfaceFactory<Files>| implementation:
+ void Create(ApplicationConnection* connection,
+ InterfaceRequest<Files> request) override {
+ new FilesImpl(connection, request.Pass());
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(FilesApp);
+};
+
+} // namespace files
+} // namespace mojo
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+ mojo::ApplicationRunnerChromium runner(new mojo::files::FilesApp());
+ return runner.Run(shell_handle);
+}
« no previous file with comments | « services/files/futimens_android.cc ('k') | services/files/types.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698