OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Broker RPC Client. | 5 // Broker RPC Client. |
6 | 6 |
7 #ifndef CEEE_IE_BROKER_BROKER_RPC_CLIENT_H_ | 7 #ifndef CEEE_IE_BROKER_BROKER_RPC_CLIENT_H_ |
8 #define CEEE_IE_BROKER_BROKER_RPC_CLIENT_H_ | 8 #define CEEE_IE_BROKER_BROKER_RPC_CLIENT_H_ |
9 | 9 |
10 #include <wtypes.h> | 10 #include <wtypes.h> |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 | 12 |
13 struct IUnknown; | 13 struct ICeeeBrokerRegistrar; |
| 14 |
14 // Interface for sending events. | 15 // Interface for sending events. |
15 class IEventSender { | 16 class IEventSender { |
16 public: | 17 public: |
17 virtual ~IEventSender() {} | 18 virtual ~IEventSender() {} |
18 virtual HRESULT FireEvent(const char* event_name, | 19 virtual HRESULT FireEvent(const char* event_name, |
19 const char* event_args) = 0; | 20 const char* event_args) = 0; |
20 }; | 21 }; |
21 | 22 |
22 // Class provides communication with BrokerRpcServer. | 23 // Class provides communication with BrokerRpcServer. |
23 class BrokerRpcClient : public IEventSender { | 24 class BrokerRpcClient : public IEventSender { |
(...skipping 26 matching lines...) Expand all Loading... |
50 virtual HRESULT SendUmaHistogramTimes(const char* name, int sample); | 51 virtual HRESULT SendUmaHistogramTimes(const char* name, int sample); |
51 virtual HRESULT SendUmaHistogramData(const char* name, | 52 virtual HRESULT SendUmaHistogramData(const char* name, |
52 int sample, | 53 int sample, |
53 int min, | 54 int min, |
54 int max, | 55 int max, |
55 int bucket_count); | 56 int bucket_count); |
56 // @} | 57 // @} |
57 | 58 |
58 protected: | 59 protected: |
59 // Starts ceee broker process. This is unittest seam. | 60 // Starts ceee broker process. This is unittest seam. |
60 virtual HRESULT StartServer(IUnknown** server); | 61 virtual HRESULT StartServer(ICeeeBrokerRegistrar** server); |
61 | 62 |
62 private: | 63 private: |
63 void LockContext(); | 64 void LockContext(); |
64 void ReleaseContext(); | 65 void ReleaseContext(); |
65 | 66 |
66 template<class Function, class Params> | 67 template<class Function, class Params> |
67 HRESULT RunRpc(bool allow_restart, | 68 HRESULT RunRpc(bool allow_restart, |
68 Function rpc_function, | 69 Function rpc_function, |
69 const Params& params); | 70 const Params& params); |
70 | 71 |
71 RPC_BINDING_HANDLE binding_handle_; | 72 RPC_BINDING_HANDLE binding_handle_; |
72 // Context handle. It is required to make RPC server know number of active | 73 // Context handle. It is required to make RPC server know number of active |
73 // clients. | 74 // clients. |
74 void* context_; | 75 void* context_; |
75 bool allow_restarts_; | 76 bool allow_restarts_; |
76 DISALLOW_COPY_AND_ASSIGN(BrokerRpcClient); | 77 DISALLOW_COPY_AND_ASSIGN(BrokerRpcClient); |
77 }; | 78 }; |
78 | 79 |
| 80 HRESULT StartCeeeBroker(ICeeeBrokerRegistrar** broker); |
| 81 |
79 #endif // CEEE_IE_BROKER_BROKER_RPC_CLIENT_H_ | 82 #endif // CEEE_IE_BROKER_BROKER_RPC_CLIENT_H_ |
OLD | NEW |