| 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Called when client process terminated without releasing context handle. | 122 // Called when client process terminated without releasing context handle. |
| 123 void __RPC_USER BrokerContextHandle_rundown(BrokerContextHandle context) { | 123 void __RPC_USER BrokerContextHandle_rundown(BrokerContextHandle context) { |
| 124 DCHECK(context != NULL); | 124 DCHECK(context != NULL); |
| 125 ceee_module_util::UnlockModule(); | 125 ceee_module_util::UnlockModule(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void BrokerRpcServer_FireEvent( | 128 void BrokerRpcServer_FireEvent( |
| 129 handle_t binding_handle, | 129 handle_t binding_handle, |
| 130 BrokerContextHandle context, |
| 130 const char* event_name, | 131 const char* event_name, |
| 131 const char* event_args) { | 132 const char* event_args) { |
| 132 DCHECK(ChromePostman::GetInstance()); | 133 DCHECK(ChromePostman::GetInstance()); |
| 133 if (ChromePostman::GetInstance()) | 134 if (ChromePostman::GetInstance()) |
| 134 ChromePostman::GetInstance()->FireEvent(event_name, event_args); | 135 ChromePostman::GetInstance()->FireEvent(event_name, event_args); |
| 135 } | 136 } |
| 136 | 137 |
| 137 void BrokerRpcServer_SendUmaHistogramTimes(handle_t binding_handle, | 138 void BrokerRpcServer_SendUmaHistogramTimes(handle_t binding_handle, |
| 138 const char* name, | 139 const char* name, |
| 139 int sample) { | 140 int sample) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 158 // We can't unfortunately use the HISTOGRAM_*_COUNT here because they use | 159 // We can't unfortunately use the HISTOGRAM_*_COUNT here because they use |
| 159 // static variables to save time. | 160 // static variables to save time. |
| 160 AutoLock lock(g_metrics_lock); | 161 AutoLock lock(g_metrics_lock); |
| 161 scoped_refptr<base::Histogram> counter = | 162 scoped_refptr<base::Histogram> counter = |
| 162 base::Histogram::FactoryGet(name, min, max, bucket_count, | 163 base::Histogram::FactoryGet(name, min, max, bucket_count, |
| 163 base::Histogram::kUmaTargetedHistogramFlag); | 164 base::Histogram::kUmaTargetedHistogramFlag); |
| 164 DCHECK_EQ(name, counter->histogram_name()); | 165 DCHECK_EQ(name, counter->histogram_name()); |
| 165 if (counter.get()) | 166 if (counter.get()) |
| 166 counter->AddTime(base::TimeDelta::FromMilliseconds(sample)); | 167 counter->AddTime(base::TimeDelta::FromMilliseconds(sample)); |
| 167 } | 168 } |
| OLD | NEW |