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

Side by Side Diff: services/log/log_impl.h

Issue 1447273002: Mojo Log service and a thread-safe client library. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: removed environment & bindings changes from previous patchset. remove unused mojo::log::EntryMetad… Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_LOG_LOG_IMPL_H_
6 #define SERVICES_LOG_LOG_IMPL_H_
7
8 #include <string>
9
10 #include "mojo/public/cpp/bindings/interface_request.h"
11 #include "mojo/public/cpp/bindings/strong_binding.h"
12 #include "mojo/services/log/interfaces/entry.mojom.h"
13 #include "mojo/services/log/interfaces/log.mojom.h"
14
15 namespace mojo {
16
17 class ApplicationConnection;
18
19 namespace log {
20
21 // This is an implementation of the log service
22 // (see mojo/services/log/interfaces/log.mojom). It only formats incoming
23 // messages and prints them to stderr.
24 //
25 // This service implementation binds a new Log implementation for each incoming
26 // application connection.
27 class LogImpl : public Log {
28 public:
29 static void Create(ApplicationConnection* connection,
30 InterfaceRequest<Log> request);
31
32 // |Log| implementation:
33 void AddEntry(EntryPtr entry) override;
34
35 private:
36 LogImpl(const std::string& remote_url, InterfaceRequest<Log> request);
37 ~LogImpl() override;
38
39 std::string FormatEntry(const EntryPtr& entry);
40
41 const std::string remote_url_;
42 StrongBinding<Log> binding_;
43
44 MOJO_DISALLOW_COPY_AND_ASSIGN(LogImpl);
45 };
46
47 } // namespace log
48 } // namespace mojo
49
50 #endif // SERVICES_LOG_LOG_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698