| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_FRAME_SYNC_MSG_REPLY_DISPATCHER_H_ | 5 #ifndef CHROME_FRAME_SYNC_MSG_REPLY_DISPATCHER_H_ |
| 6 #define CHROME_FRAME_SYNC_MSG_REPLY_DISPATCHER_H_ | 6 #define CHROME_FRAME_SYNC_MSG_REPLY_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/callback.h" | |
| 11 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| 12 #include "ipc/ipc_channel_proxy.h" | 11 #include "ipc/ipc_channel_proxy.h" |
| 13 | 12 |
| 14 // Base class used to allow synchronous IPC messages to be sent and | 13 // Base class used to allow synchronous IPC messages to be sent and |
| 15 // received in an asynchronous manner. To use this class add it as a filter to | 14 // received in an asynchronous manner. To use this class add it as a filter to |
| 16 // your IPC channel using ChannelProxy::AddFilter(). From then on, before | 15 // your IPC channel using ChannelProxy::AddFilter(). From then on, before |
| 17 // sending a synchronous message, call SyncMessageReplyDispatcher::Push() with | 16 // sending a synchronous message, call SyncMessageReplyDispatcher::Push() with |
| 18 // a callback and a key. This class will then handle the message response and | 17 // a callback and a key. This class will then handle the message response and |
| 19 // will call the callback when it is received. | 18 // will call the callback when it is received. |
| 20 // | 19 // |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } else { | 109 } else { |
| 111 // TODO(stoyan): How to handle errors? | 110 // TODO(stoyan): How to handle errors? |
| 112 } | 111 } |
| 113 } | 112 } |
| 114 | 113 |
| 115 PendingSyncMessageQueue message_queue_; | 114 PendingSyncMessageQueue message_queue_; |
| 116 base::Lock message_queue_lock_; | 115 base::Lock message_queue_lock_; |
| 117 }; | 116 }; |
| 118 | 117 |
| 119 #endif // CHROME_FRAME_SYNC_MSG_REPLY_DISPATCHER_H_ | 118 #endif // CHROME_FRAME_SYNC_MSG_REPLY_DISPATCHER_H_ |
| OLD | NEW |