Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: ceee/ie/broker/broker_rpc_client.cc

Issue 5609005: Revert 68291 - DCHECK to detect invalid BrokerRpcClient usage.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 implementation. 5 // Broker RPC Client implementation.
6 6
7 #include "ceee/ie/broker/broker_rpc_client.h" 7 #include "ceee/ie/broker/broker_rpc_client.h"
8 8
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include "base/lock.h" 10 #include "base/lock.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 } 160 }
161 161
162 template<class Function, class Params> 162 template<class Function, class Params>
163 HRESULT BrokerRpcClient::RunRpc(bool allow_restart, 163 HRESULT BrokerRpcClient::RunRpc(bool allow_restart,
164 Function rpc_function, 164 Function rpc_function,
165 const Params& params) { 165 const Params& params) {
166 if (!rpc_function) { 166 if (!rpc_function) {
167 RpcDcheck("rpc_function is NULL"); 167 RpcDcheck("rpc_function is NULL");
168 } 168 }
169 if (!is_connected()) { 169 if (!is_connected())
170 RpcDcheck("BrokerRpcClient is not connected");
171 return RPC_E_FAULT; 170 return RPC_E_FAULT;
172 }
173 RpcTryExcept { 171 RpcTryExcept {
174 DispatchToFunction(rpc_function, params); 172 DispatchToFunction(rpc_function, params);
175 return S_OK; 173 return S_OK;
176 } RpcExcept(HandleRpcException(RpcExceptionCode())) { 174 } RpcExcept(HandleRpcException(RpcExceptionCode())) {
177 LogRpcException("RPC error in RunRpc", RpcExceptionCode()); 175 LogRpcException("RPC error in RunRpc", RpcExceptionCode());
178 176
179 if (allow_restart && 177 if (allow_restart &&
180 RPC_S_OK != ::RpcMgmtIsServerListening(binding_handle_)) { 178 RPC_S_OK != ::RpcMgmtIsServerListening(binding_handle_)) {
181 Disconnect(); 179 Disconnect();
182 if (SUCCEEDED(Connect(true))) { 180 if (SUCCEEDED(Connect(true))) {
(...skipping 21 matching lines...) Expand all
204 HRESULT BrokerRpcClient::SendUmaHistogramData(const char* name, 202 HRESULT BrokerRpcClient::SendUmaHistogramData(const char* name,
205 int sample, 203 int sample,
206 int min, 204 int min,
207 int max, 205 int max,
208 int bucket_count) { 206 int bucket_count) {
209 return RunRpc(allow_restarts_, 207 return RunRpc(allow_restarts_,
210 &BrokerRpcClient_SendUmaHistogramData, 208 &BrokerRpcClient_SendUmaHistogramData,
211 MakeRefTuple(binding_handle_, name, sample, min, max, 209 MakeRefTuple(binding_handle_, name, sample, min, max,
212 bucket_count)); 210 bucket_count));
213 } 211 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698