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

Unified Diff: base/win/scoped_comptr.h

Issue 2792383003: Rename ScopedComPtr::Release() to ScopedComPtr::Reset() (Closed)
Patch Set: Fix New Callers Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/win/scoped_comptr_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/scoped_comptr.h
diff --git a/base/win/scoped_comptr.h b/base/win/scoped_comptr.h
index 3d05a3b7d2e2e5d98fdef066fa1e721b8ed34157..ac704e095347e688fb4d55fc5390955001d84fe0 100644
--- a/base/win/scoped_comptr.h
+++ b/base/win/scoped_comptr.h
@@ -46,7 +46,7 @@ class ScopedComPtr {
static_assert(
sizeof(ScopedComPtr<Interface, interface_id>) == sizeof(Interface*),
"ScopedComPtrSize");
- Release();
+ Reset();
}
Interface* get() const { return ptr_; }
@@ -57,12 +57,14 @@ class ScopedComPtr {
// ScopedComPtr instance.
// Note that this function equates to IUnknown::Release and should not
// be confused with e.g. unique_ptr::release().
- void Release() {
+ unsigned long Reset() {
+ unsigned long ref = 0;
Interface* temp = ptr_;
if (temp) {
ptr_ = nullptr;
- temp->Release();
+ ref = temp->Release();
}
+ return ref;
}
// Sets the internal pointer to NULL and returns the held object without
« no previous file with comments | « no previous file | base/win/scoped_comptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698