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

Side by Side Diff: remoting/base/dispatch_win.h.pump

Issue 413763003: clang/win: Fix most -Wwriteable-strings warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months 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
OLDNEW
1 $$ This is a pump file for generating file templates. Pump is a python 1 $$ This is a pump file for generating file templates. Pump is a python
2 $$ script that is part of the Google Test suite of utilities. Description 2 $$ script that is part of the Google Test suite of utilities. Description
3 $$ can be found here: 3 $$ can be found here:
4 $$ 4 $$
5 $$ http://code.google.com/p/googletest/wiki/PumpManual 5 $$ http://code.google.com/p/googletest/wiki/PumpManual
6 6
7 $$ MAX_ARITY controls the number of arguments that dispatch::Invoke() supports. 7 $$ MAX_ARITY controls the number of arguments that dispatch::Invoke() supports.
8 $$ It is choosen to match the number of arguments base::Bind() supports. 8 $$ It is choosen to match the number of arguments base::Bind() supports.
9 $var MAX_ARITY = 7 9 $var MAX_ARITY = 7
10 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 10 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // - the method ID cannot be cached and reused. 121 // - the method ID cannot be cached and reused.
122 // - VARIANT is the only supported parameter type at the moment. 122 // - VARIANT is the only supported parameter type at the moment.
123 $range ARITY 0..MAX_ARITY 123 $range ARITY 0..MAX_ARITY
124 $for ARITY [[ 124 $for ARITY [[
125 $range ARG 1..ARITY 125 $range ARG 1..ARITY
126 126
127 127
128 $if ARITY > 0 [[template <$for ARG , [[typename P$(ARG)]]>]] 128 $if ARITY > 0 [[template <$for ARG , [[typename P$(ARG)]]>]]
129 129
130 HRESULT Invoke(IDispatch* object, 130 HRESULT Invoke(IDispatch* object,
131 LPOLESTR name, 131 LPCOLESTR const_name,
132 WORD flags, 132 WORD flags,
133 $for ARG [[ 133 $for ARG [[
134 134
135 const P$(ARG)& p$(ARG), 135 const P$(ARG)& p$(ARG),
136 ]] 136 ]]
137 137
138 VARIANT* const & result_out) { 138 VARIANT* const & result_out) {
139 // Retrieve the ID of the method to be called. 139 // Retrieve the ID of the method to be called.
140 DISPID disp_id; 140 DISPID disp_id;
141 HRESULT hr = object->GetIDsOfNames(IID_NULL, &name, 1, LOCALE_USER_DEFAULT, 141 LPOLESTR name = const_cast<LPOLESTR>(const_name);
142 &disp_id); 142 HRESULT hr = object->GetIDsOfNames(
143 IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &disp_id);
143 if (FAILED(hr)) 144 if (FAILED(hr))
144 return hr; 145 return hr;
145 146
146 // Request the return value if asked by the caller. 147 // Request the return value if asked by the caller.
147 internal::ScopedVariantArg result; 148 internal::ScopedVariantArg result;
148 VARIANT* disp_result = NULL; 149 VARIANT* disp_result = NULL;
149 if (result_out != NULL) 150 if (result_out != NULL)
150 disp_result = &result; 151 disp_result = &result;
151 152
152 $if ARITY > 0 [[ 153 $if ARITY > 0 [[
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 return S_OK; 203 return S_OK;
203 } 204 }
204 205
205 ]] 206 ]]
206 207
207 } // namespace dispatch 208 } // namespace dispatch
208 209
209 } // namespace remoting 210 } // namespace remoting
210 211
211 #endif // REMOTING_BASE_IDISPATCH_DRIVER_WIN_H_ 212 #endif // REMOTING_BASE_IDISPATCH_DRIVER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698