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

Unified Diff: base/win/scoped_handle.h

Issue 71013004: Base: Remove Receive() from ScopedHandle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix delegate_execute for google_chrome_build Created 7 years, 1 month 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 | « base/process/launch_win.cc ('k') | base/win/scoped_handle_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/scoped_handle.h
diff --git a/base/win/scoped_handle.h b/base/win/scoped_handle.h
index d3f5c22facd64296b0a7cba6af6e2fce62bbbac8..0d038e010bdef853adc397441f55f6197d996107 100644
--- a/base/win/scoped_handle.h
+++ b/base/win/scoped_handle.h
@@ -39,22 +39,6 @@ class GenericScopedHandle {
public:
typedef typename Traits::Handle Handle;
- // Helper object to contain the effect of Receive() to the function that needs
- // a pointer, and allow proper tracking of the handle.
- class Receiver {
- public:
- explicit Receiver(GenericScopedHandle* owner)
- : handle_(Traits::NullHandle()),
- owner_(owner) {}
- ~Receiver() { owner_->Set(handle_); }
-
- operator Handle*() { return &handle_; }
-
- private:
- Handle handle_;
- GenericScopedHandle* owner_;
- };
-
GenericScopedHandle() : handle_(Traits::NullHandle()) {}
explicit GenericScopedHandle(Handle handle) : handle_(Traits::NullHandle()) {
@@ -102,16 +86,6 @@ class GenericScopedHandle {
return handle_;
}
- // This method is intended to be used with functions that require a pointer to
- // a destination handle, like so:
- // void CreateRequiredHandle(Handle* out_handle);
- // ScopedHandle a;
- // CreateRequiredHandle(a.Receive());
- Receiver Receive() {
- DCHECK(!Traits::IsHandleValid(handle_)) << "Handle must be NULL";
- return Receiver(this);
- }
-
// Transfers ownership away from this object.
Handle Take() {
Handle temp = handle_;
« no previous file with comments | « base/process/launch_win.cc ('k') | base/win/scoped_handle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698