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

Side by Side Diff: services/flog/flog_service_impl.h

Issue 2046703002: Add 'flog' service implementation. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 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
(Empty)
1 // Copyright 2016 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 MOJO_SERVICES_FLOG_FLOG_SERVICE_IMPL_H_
6 #define MOJO_SERVICES_FLOG_FLOG_SERVICE_IMPL_H_
7
8 #include <map>
9 #include <memory>
10
11 #include "mojo/common/binding_set.h"
12 #include "mojo/services/flog/interfaces/flog.mojom.h"
13 #include "services/flog/flog_directory.h"
14 #include "services/util/cpp/factory_service_base.h"
15 #include "services/util/cpp/incident.h"
16
17 namespace mojo {
18 namespace flog {
19
20 // FlogService implementation.
21 class FlogServiceImpl : public util::FactoryServiceBase, public FlogService {
22 public:
23 FlogServiceImpl();
24
25 ~FlogServiceImpl() override;
26
27 // ApplicationImplBase overrides.
28 void OnInitialize() override;
29
30 bool OnAcceptConnection(ServiceProviderImpl* service_provider_impl) override;
31
32 // FlogService implementation.
33 void CreateLogger(InterfaceRequest<FlogLogger> logger,
34 const String& label) override;
35
36 void GetLogDescriptions(const GetLogDescriptionsCallback& callback) override;
37
38 void CreateReader(InterfaceRequest<FlogReader> reader,
39 uint32_t log_id) override;
40
41 private:
42 Incident ready_;
43 BindingSet<FlogService> bindings_;
44 uint32_t last_allocated_log_id_ = 0;
45 std::map<uint32_t, std::string> log_labels_by_id_;
46 std::shared_ptr<FlogDirectory> directory_;
47 };
48
49 } // namespace flog
50 } // namespace mojo
51
52 #endif // MOJO_SERVICES_FLOG_FLOG_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698