diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 02:00:56 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 02:00:56 +0000 |
commit | a5da6d613f41ecf35c027e8744dd6d3a41e4010c (patch) | |
tree | dad6a3e159fcc21df62180f481a0024db97d5b0d /base/ref_counted.h | |
parent | e23ed5427d0892d07480781f45b4367adebc0c00 (diff) | |
download | chromium_src-a5da6d613f41ecf35c027e8744dd6d3a41e4010c.zip chromium_src-a5da6d613f41ecf35c027e8744dd6d3a41e4010c.tar.gz chromium_src-a5da6d613f41ecf35c027e8744dd6d3a41e4010c.tar.bz2 |
Cross-process Message Port implementation.
I'm sending this first, then I'll add support to workers in another changelist to avoid making this change larger.
TEST=running message port related layout tests in ui_tests
Review URL: http://codereview.chromium.org/159372
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22356 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/ref_counted.h')
-rw-r--r-- | base/ref_counted.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/base/ref_counted.h b/base/ref_counted.h index 013bd66..79f9f55 100644 --- a/base/ref_counted.h +++ b/base/ref_counted.h @@ -200,6 +200,17 @@ class scoped_refptr { operator T*() const { return ptr_; } T* operator->() const { return ptr_; } + // Release a pointer. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + T* release() { + T* retVal = ptr_; + ptr_ = NULL; + return retVal; + } + scoped_refptr<T>& operator=(T* p) { // AddRef first so that self assignment should work if (p) |