OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 public: | 41 public: |
42 virtual ~NativeMessageProcessHost(); | 42 virtual ~NativeMessageProcessHost(); |
43 | 43 |
44 // Create using specified |launcher|. Used in tests. | 44 // Create using specified |launcher|. Used in tests. |
45 static scoped_ptr<NativeMessageHost> CreateWithLauncher( | 45 static scoped_ptr<NativeMessageHost> CreateWithLauncher( |
46 const std::string& source_extension_id, | 46 const std::string& source_extension_id, |
47 const std::string& native_host_name, | 47 const std::string& native_host_name, |
48 scoped_ptr<NativeProcessLauncher> launcher); | 48 scoped_ptr<NativeProcessLauncher> launcher); |
49 | 49 |
50 // extensions::NativeMessageHost implementation. | 50 // extensions::NativeMessageHost implementation. |
51 virtual void OnMessage(const std::string& message) OVERRIDE; | 51 virtual void OnMessage(const std::string& message) override; |
52 virtual void Start(Client* client) OVERRIDE; | 52 virtual void Start(Client* client) override; |
53 virtual scoped_refptr<base::SingleThreadTaskRunner> task_runner() | 53 virtual scoped_refptr<base::SingleThreadTaskRunner> task_runner() |
54 const OVERRIDE; | 54 const override; |
55 | 55 |
56 #if defined(OS_POSIX) | 56 #if defined(OS_POSIX) |
57 // MessageLoopForIO::Watcher interface | 57 // MessageLoopForIO::Watcher interface |
58 virtual void OnFileCanReadWithoutBlocking(int fd) override; | 58 virtual void OnFileCanReadWithoutBlocking(int fd) override; |
59 virtual void OnFileCanWriteWithoutBlocking(int fd) override; | 59 virtual void OnFileCanWriteWithoutBlocking(int fd) override; |
60 #endif // !defined(OS_POSIX) | 60 #endif // !defined(OS_POSIX) |
61 | 61 |
62 // Try and read a single message from |read_file_|. This should only be called | 62 // Try and read a single message from |read_file_|. This should only be called |
63 // in unittests when you know there is data in the file. | 63 // in unittests when you know there is data in the file. |
64 void ReadNowForTesting(); | 64 void ReadNowForTesting(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 bool write_pending_; | 141 bool write_pending_; |
142 | 142 |
143 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 143 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(NativeMessageProcessHost); | 145 DISALLOW_COPY_AND_ASSIGN(NativeMessageProcessHost); |
146 }; | 146 }; |
147 | 147 |
148 } // namespace extensions | 148 } // namespace extensions |
149 | 149 |
150 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H
_ | 150 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H
_ |
OLD | NEW |