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

Unified Diff: services/flog/flog_logger_impl.h

Issue 2046703002: Add 'flog' service implementation. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixes per feedback. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/flog/flog_directory.cc ('k') | services/flog/flog_logger_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/flog/flog_logger_impl.h
diff --git a/services/flog/flog_logger_impl.h b/services/flog/flog_logger_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..d0a17636008e818dd9fd3d09df5a4f880b04f907
--- /dev/null
+++ b/services/flog/flog_logger_impl.h
@@ -0,0 +1,53 @@
+// Copyright 2016 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.
+
+#ifndef MOJO_SERVICES_FLOG_FLOG_LOGGER_IMPL_H_
+#define MOJO_SERVICES_FLOG_FLOG_LOGGER_IMPL_H_
+
+#include <memory>
+#include <vector>
+
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/flog/flog_directory.h"
+#include "services/flog/flog_service_impl.h"
+
+namespace mojo {
+namespace flog {
+
+// FlogLogger implementation.
+class FlogLoggerImpl : public FlogServiceImpl::ProductBase,
+ MessageReceiverWithResponderStatus {
+ public:
+ static std::shared_ptr<FlogLoggerImpl> Create(
+ InterfaceRequest<FlogLogger> request,
+ uint32_t log_id,
+ const std::string& label,
+ std::shared_ptr<FlogDirectory> directory,
+ FlogServiceImpl* owner);
+
+ ~FlogLoggerImpl() override;
+
+ // MessageReceiverWithResponderStatus implementation.
+ bool Accept(Message* message) override;
+
+ bool AcceptWithResponder(Message* message,
+ MessageReceiverWithStatus* responder) override;
+
+ private:
+ FlogLoggerImpl(InterfaceRequest<FlogLogger> request,
+ uint32_t log_id,
+ const std::string& label,
+ std::shared_ptr<FlogDirectory> directory,
+ FlogServiceImpl* owner);
+
+ void WriteData(uint32_t data_size, const void* data);
+
+ std::unique_ptr<mojo::internal::Router> router_;
+ files::FilePtr file_;
+};
+
+} // namespace flog
+} // namespace mojo
+
+#endif // MOJO_SERVICES_FLOG_FLOG_LOGGER_IMPL_H_
« no previous file with comments | « services/flog/flog_directory.cc ('k') | services/flog/flog_logger_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698