Chromium Code Reviews| Index: ceee/ie/broker/broker_rpc_client.h |
| =================================================================== |
| --- ceee/ie/broker/broker_rpc_client.h (revision 67655) |
| +++ ceee/ie/broker/broker_rpc_client.h (working copy) |
| @@ -10,6 +10,7 @@ |
| #include <wtypes.h> |
| #include "base/basictypes.h" |
| +struct IUnknown; |
| // Interface for sending events. |
| class IEventSender { |
| public: |
| @@ -18,11 +19,13 @@ |
| const char* event_args) = 0; |
| }; |
| - |
| // Class provides communication with BrokerRpcServer. |
| class BrokerRpcClient : public IEventSender { |
| public: |
| - BrokerRpcClient(); |
| + // @param allow_restarts if true client will restart server if it is somehow |
| + // gone after successful connecting. Client restarts server one time after |
|
Sigurður Ásgeirsson
2010/11/30 13:47:48
nit: indent continuation comment 4 spaces.
Vitaly Buka (NO REVIEWS)
2010/12/01 01:20:12
Done.
|
| + // each successful connecting. |
| + explicit BrokerRpcClient(bool allow_restarts); |
| virtual ~BrokerRpcClient(); |
| // Initialize connection with server. |
| @@ -30,7 +33,7 @@ |
| // not started yet. Usually only tests pass false here. |
| virtual HRESULT Connect(bool start_server); |
| - // Relese connection with server |
| + // Release connection with server |
| virtual void Disconnect(); |
| // Returns true if object ready for remote calls. |
| @@ -52,14 +55,21 @@ |
| int bucket_count); |
| // @} |
| + protected: |
| + virtual HRESULT StartServer(IUnknown** server); |
| + |
| private: |
| void LockContext(); |
| void ReleaseContext(); |
| + template<class Function, class Params> |
| + HRESULT RunRpc(bool allow_restart, Function rpc_function, Params params); |
| + |
| RPC_BINDING_HANDLE binding_handle_; |
| // Context handle. It is required to make RPC server know number of active |
| // clients. |
| void* context_; |
| + bool allow_restarts_; |
| DISALLOW_COPY_AND_ASSIGN(BrokerRpcClient); |
| }; |