| 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_SERVICE_SERVICE_IPC_SERVER_H_ | 5 #ifndef CHROME_SERVICE_SERVICE_IPC_SERVER_H_ |
| 6 #define CHROME_SERVICE_SERVICE_IPC_SERVER_H_ | 6 #define CHROME_SERVICE_SERVICE_IPC_SERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 bool Init(); | 30 bool Init(); |
| 31 | 31 |
| 32 // IPC::Sender implementation. | 32 // IPC::Sender implementation. |
| 33 virtual bool Send(IPC::Message* msg) OVERRIDE; | 33 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 34 | 34 |
| 35 IPC::SyncChannel* channel() { return channel_.get(); } | 35 IPC::SyncChannel* channel() { return channel_.get(); } |
| 36 | 36 |
| 37 // Safe to call on any thread, as long as it's guaranteed that the thread's | 37 // Safe to call on any thread, as long as it's guaranteed that the thread's |
| 38 // lifetime is less than the main thread. | 38 // lifetime is less than the main thread. |
| 39 IPC::SyncMessageFilter* sync_message_filter() { return sync_message_filter_; } | 39 IPC::SyncMessageFilter* sync_message_filter() { |
| 40 return sync_message_filter_.get(); |
| 41 } |
| 40 | 42 |
| 41 bool is_client_connected() const { return client_connected_; } | 43 bool is_client_connected() const { return client_connected_; } |
| 42 | 44 |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 friend class MockServiceIPCServer; | 47 friend class MockServiceIPCServer; |
| 46 | 48 |
| 47 // IPC::Listener implementation. | 49 // IPC::Listener implementation. |
| 48 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 50 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 49 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 51 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 71 bool client_connected_; | 73 bool client_connected_; |
| 72 | 74 |
| 73 // Allows threads other than the main thread to send sync messages. | 75 // Allows threads other than the main thread to send sync messages. |
| 74 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 76 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
| 75 | 77 |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(ServiceIPCServer); | 79 DISALLOW_COPY_AND_ASSIGN(ServiceIPCServer); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 #endif // CHROME_SERVICE_SERVICE_IPC_SERVER_H_ | 82 #endif // CHROME_SERVICE_SERVICE_IPC_SERVER_H_ |
| OLD | NEW |