Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / remoting / host / native_messaging / native_messaging_writer.h
blob41f60bfb4df2d134acee8aa626e03cedf740b705
1 // Copyright 2013 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.
5 #ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_
6 #define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_
8 #include "base/files/file.h"
10 namespace base {
11 class Value;
12 } // namespace base
14 namespace remoting {
16 // This class is used for sending messages to the Native Messaging client
17 // webapp.
18 class NativeMessagingWriter {
19 public:
20 explicit NativeMessagingWriter(base::File file);
21 ~NativeMessagingWriter();
23 // Sends a message to the Native Messaging client, returning true if
24 // successful.
25 bool WriteMessage(const base::Value& message);
27 private:
28 base::File write_stream_;
29 bool fail_;
31 DISALLOW_COPY_AND_ASSIGN(NativeMessagingWriter);
34 } // namespace remoting
36 #endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_