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

Side by Side Diff: base/win/scoped_variant.cc

Issue 6469070: More DCHECK() updates. A mixture of _EQ and _GE. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updating pickle.h order Created 9 years, 9 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
« no previous file with comments | « base/win/scoped_comptr.h ('k') | 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 #include "base/win/scoped_variant.h" 5 #include "base/win/scoped_variant.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 namespace base { 8 namespace base {
9 namespace win { 9 namespace win {
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 if (unk) 204 if (unk)
205 unk->AddRef(); 205 unk->AddRef();
206 } 206 }
207 207
208 void ScopedVariant::Set(SAFEARRAY* array) { 208 void ScopedVariant::Set(SAFEARRAY* array) {
209 DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt; 209 DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
210 if (SUCCEEDED(::SafeArrayGetVartype(array, &var_.vt))) { 210 if (SUCCEEDED(::SafeArrayGetVartype(array, &var_.vt))) {
211 var_.vt |= VT_ARRAY; 211 var_.vt |= VT_ARRAY;
212 var_.parray = array; 212 var_.parray = array;
213 } else { 213 } else {
214 DCHECK(array == NULL) << "Unable to determine safearray vartype"; 214 DCHECK(!array) << "Unable to determine safearray vartype";
215 var_.vt = VT_EMPTY; 215 var_.vt = VT_EMPTY;
216 } 216 }
217 } 217 }
218 218
219 void ScopedVariant::Set(const VARIANT& var) { 219 void ScopedVariant::Set(const VARIANT& var) {
220 DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt; 220 DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
221 if (FAILED(::VariantCopy(&var_, &var))) { 221 if (FAILED(::VariantCopy(&var_, &var))) {
222 DLOG(ERROR) << "VariantCopy failed"; 222 DLOG(ERROR) << "VariantCopy failed";
223 var_.vt = VT_EMPTY; 223 var_.vt = VT_EMPTY;
224 } 224 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 if (!leakable && (vt & VT_ARRAY) != 0) { 268 if (!leakable && (vt & VT_ARRAY) != 0) {
269 leakable = true; 269 leakable = true;
270 } 270 }
271 271
272 return leakable; 272 return leakable;
273 } 273 }
274 274
275 } // namespace win 275 } // namespace win
276 } // namespace base 276 } // namespace base
OLDNEW
« no previous file with comments | « base/win/scoped_comptr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698