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 ICeeeBrokerRegistrar; |
| 14 |
13 // Interface for sending events. | 15 // Interface for sending events. |
14 class IEventSender { | 16 class IEventSender { |
15 public: | 17 public: |
16 virtual ~IEventSender() {} | 18 virtual ~IEventSender() {} |
17 virtual HRESULT FireEvent(const char* event_name, | 19 virtual HRESULT FireEvent(const char* event_name, |
18 const char* event_args) = 0; | 20 const char* event_args) = 0; |
19 }; | 21 }; |
20 | 22 |
21 | 23 |
22 // Class provides communication with BrokerRpcServer. | 24 // Class provides communication with BrokerRpcServer. |
(...skipping 22 matching lines...) Expand all Loading... |
45 // Adds UMA to histograms on the server side. Either performance timings or | 47 // Adds UMA to histograms on the server side. Either performance timings or |
46 // generic histogram. | 48 // generic histogram. |
47 virtual HRESULT SendUmaHistogramTimes(const char* name, int sample); | 49 virtual HRESULT SendUmaHistogramTimes(const char* name, int sample); |
48 virtual HRESULT SendUmaHistogramData(const char* name, | 50 virtual HRESULT SendUmaHistogramData(const char* name, |
49 int sample, | 51 int sample, |
50 int min, | 52 int min, |
51 int max, | 53 int max, |
52 int bucket_count); | 54 int bucket_count); |
53 // @} | 55 // @} |
54 | 56 |
| 57 protected: |
| 58 // Starts ceee broker process. This is unittest seam. |
| 59 virtual HRESULT StartServer(ICeeeBrokerRegistrar** server); |
| 60 |
55 private: | 61 private: |
56 void LockContext(); | 62 void LockContext(); |
57 void ReleaseContext(); | 63 void ReleaseContext(); |
58 | 64 |
59 RPC_BINDING_HANDLE binding_handle_; | 65 RPC_BINDING_HANDLE binding_handle_; |
60 // Context handle. It is required to make RPC server know number of active | 66 // Context handle. It is required to make RPC server know number of active |
61 // clients. | 67 // clients. |
62 void* context_; | 68 void* context_; |
63 DISALLOW_COPY_AND_ASSIGN(BrokerRpcClient); | 69 DISALLOW_COPY_AND_ASSIGN(BrokerRpcClient); |
64 }; | 70 }; |
65 | 71 |
| 72 HRESULT StartCeeeBroker(ICeeeBrokerRegistrar** broker); |
| 73 |
66 #endif // CEEE_IE_BROKER_BROKER_RPC_CLIENT_H_ | 74 #endif // CEEE_IE_BROKER_BROKER_RPC_CLIENT_H_ |
OLD | NEW |