| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 const std::string& source_extension_id, | 79 const std::string& source_extension_id, |
| 80 const std::string& native_host_name, | 80 const std::string& native_host_name, |
| 81 int destination_port, | 81 int destination_port, |
| 82 scoped_ptr<NativeProcessLauncher> launcher); | 82 scoped_ptr<NativeProcessLauncher> launcher); |
| 83 | 83 |
| 84 // Send a message with the specified payload. | 84 // Send a message with the specified payload. |
| 85 void Send(const std::string& json); | 85 void Send(const std::string& json); |
| 86 | 86 |
| 87 #if defined(OS_POSIX) | 87 #if defined(OS_POSIX) |
| 88 // MessageLoopForIO::Watcher interface | 88 // MessageLoopForIO::Watcher interface |
| 89 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 89 virtual void OnFileCanReadWithoutBlocking(int fd) override; |
| 90 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 90 virtual void OnFileCanWriteWithoutBlocking(int fd) override; |
| 91 #endif // !defined(OS_POSIX) | 91 #endif // !defined(OS_POSIX) |
| 92 | 92 |
| 93 // Try and read a single message from |read_file_|. This should only be called | 93 // Try and read a single message from |read_file_|. This should only be called |
| 94 // in unittests when you know there is data in the file. | 94 // in unittests when you know there is data in the file. |
| 95 void ReadNowForTesting(); | 95 void ReadNowForTesting(); |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 NativeMessageProcessHost(base::WeakPtr<Client> weak_client_ui, | 98 NativeMessageProcessHost(base::WeakPtr<Client> weak_client_ui, |
| 99 const std::string& source_extension_id, | 99 const std::string& source_extension_id, |
| 100 const std::string& native_host_name, | 100 const std::string& native_host_name, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 // Set to true when a write is pending. | 177 // Set to true when a write is pending. |
| 178 bool write_pending_; | 178 bool write_pending_; |
| 179 | 179 |
| 180 DISALLOW_COPY_AND_ASSIGN(NativeMessageProcessHost); | 180 DISALLOW_COPY_AND_ASSIGN(NativeMessageProcessHost); |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 } // namespace extensions | 183 } // namespace extensions |
| 184 | 184 |
| 185 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H
_ | 185 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H
_ |
| OLD | NEW |