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

Unified Diff: services/log/main.cc

Issue 1447273002: Mojo Log service and a thread-safe client library. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: initialize global variables at start of the test Created 5 years 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/log/log_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/log/main.cc
diff --git a/services/files/main.cc b/services/log/main.cc
similarity index 50%
copy from services/files/main.cc
copy to services/log/main.cc
index 56101d9efb5150418bab6d9c5cd277e5056eb854..5805c55b9f94b46d32c20a6e16476a7b173bc4f3 100644
--- a/services/files/main.cc
+++ b/services/log/main.cc
@@ -2,43 +2,48 @@
// 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 <utility>
+
#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 "mojo/services/files/interfaces/files.mojom.h"
-#include "services/files/files_impl.h"
+#include "mojo/public/cpp/system/macros.h"
+#include "mojo/services/log/interfaces/log.mojom.h"
+#include "services/log/log_impl.h"
namespace mojo {
-namespace files {
+namespace log {
-class FilesApp : public ApplicationDelegate, public InterfaceFactory<Files> {
+// Provides the mojo.log.Log service. Binds a new Log implementation for each
+// Log interface request.
+class LogApp : public ApplicationDelegate, public InterfaceFactory<Log> {
public:
- FilesApp() {}
- ~FilesApp() override {}
+ LogApp() {}
+ ~LogApp() override {}
private:
// |ApplicationDelegate| override:
bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
- connection->AddService<Files>(this);
+ connection->AddService<Log>(this);
return true;
}
- // |InterfaceFactory<Files>| implementation:
+ // |InterfaceFactory<Log>| implementation:
+ // We maintain a separate |LogImpl| for each incoming connection.
void Create(ApplicationConnection* connection,
- InterfaceRequest<Files> request) override {
- new FilesImpl(connection, request.Pass());
+ InterfaceRequest<Log> request) override {
+ LogImpl::Create(connection, std::move(request), stderr);
}
- DISALLOW_COPY_AND_ASSIGN(FilesApp);
+ MOJO_DISALLOW_COPY_AND_ASSIGN(LogApp);
};
-} // namespace files
+} // namespace log
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunnerChromium runner(new mojo::files::FilesApp());
+ mojo::ApplicationRunnerChromium runner(new mojo::log::LogApp());
return runner.Run(application_request);
}
« no previous file with comments | « services/log/log_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698