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 Server implementation. | 5 // Broker RPC Server implementation. |
6 | 6 |
7 #include "ceee/ie/broker/broker_rpc_server.h" | 7 #include "ceee/ie/broker/broker_rpc_server.h" |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 RPC_STATUS status = ::RpcMgmtStopServerListening(NULL); | 99 RPC_STATUS status = ::RpcMgmtStopServerListening(NULL); |
100 LOG_IF(WARNING, RPC_S_OK != status && RPC_S_NOT_LISTENING != status) << | 100 LOG_IF(WARNING, RPC_S_OK != status && RPC_S_NOT_LISTENING != status) << |
101 "Failed to stop listening. RPC_STATUS=0x" << com::LogWe(status); | 101 "Failed to stop listening. RPC_STATUS=0x" << com::LogWe(status); |
102 // Wait while server stops listening threads. | 102 // Wait while server stops listening threads. |
103 status = ::RpcMgmtWaitServerListen(); | 103 status = ::RpcMgmtWaitServerListen(); |
104 LOG_IF(WARNING, RPC_S_OK != status && RPC_S_NOT_LISTENING != status) << | 104 LOG_IF(WARNING, RPC_S_OK != status && RPC_S_NOT_LISTENING != status) << |
105 "Failed to wait server listen. RPC_STATUS=0x" << com::LogWe(status); | 105 "Failed to wait server listen. RPC_STATUS=0x" << com::LogWe(status); |
106 // Unregister RPC interface. | 106 // Unregister RPC interface. |
107 status = ::RpcServerUnregisterIf( | 107 status = ::RpcServerUnregisterIf( |
108 BrokerRpcServer_CeeeBroker_v1_1_s_ifspec, NULL, FALSE); | 108 BrokerRpcServer_CeeeBroker_v1_1_s_ifspec, NULL, FALSE); |
109 LOG_IF(WARNING, RPC_S_OK != status || RPC_S_UNKNOWN_MGR_TYPE != status || | 109 LOG_IF(WARNING, RPC_S_OK != status && RPC_S_UNKNOWN_MGR_TYPE != status && |
110 RPC_S_UNKNOWN_IF != status) << | 110 RPC_S_UNKNOWN_IF != status) << |
111 "Failed to unregister interface. RPC_STATUS=0x" << com::LogWe(status); | 111 "Failed to unregister interface. RPC_STATUS=0x" << com::LogWe(status); |
112 | 112 |
113 return RPC_S_OK == status; | 113 return RPC_S_OK == status; |
114 } | 114 } |
115 | 115 |
116 bool BrokerRpcServer::is_started() const { | 116 bool BrokerRpcServer::is_started() const { |
117 DCHECK(current_thread_ == ::GetCurrentThreadId()); | 117 DCHECK(current_thread_ == ::GetCurrentThreadId()); |
118 return is_started_; | 118 return is_started_; |
119 } | 119 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // We can't unfortunately use the HISTOGRAM_*_COUNT here because they use | 176 // We can't unfortunately use the HISTOGRAM_*_COUNT here because they use |
177 // static variables to save time. | 177 // static variables to save time. |
178 AutoLock lock(g_metrics_lock); | 178 AutoLock lock(g_metrics_lock); |
179 scoped_refptr<base::Histogram> counter = | 179 scoped_refptr<base::Histogram> counter = |
180 base::Histogram::FactoryGet(name, min, max, bucket_count, | 180 base::Histogram::FactoryGet(name, min, max, bucket_count, |
181 base::Histogram::kUmaTargetedHistogramFlag); | 181 base::Histogram::kUmaTargetedHistogramFlag); |
182 DCHECK_EQ(name, counter->histogram_name()); | 182 DCHECK_EQ(name, counter->histogram_name()); |
183 if (counter.get()) | 183 if (counter.get()) |
184 counter->AddTime(base::TimeDelta::FromMilliseconds(sample)); | 184 counter->AddTime(base::TimeDelta::FromMilliseconds(sample)); |
185 } | 185 } |
OLD | NEW |