diff options
author | Leon Clarke <leonclarke@google.com> | 2010-06-03 14:33:32 +0100 |
---|---|---|
committer | Leon Clarke <leonclarke@google.com> | 2010-06-08 12:24:51 +0100 |
commit | 5af96e2c7b73ebc627c6894727826a7576d31758 (patch) | |
tree | f9d5e6f6175ccd7e3d14de9b290f08937a0d17ba /JavaScriptCore/wtf/OwnArrayPtr.h | |
parent | 8cc4fcf4f6adcbc0e0aebfc24fbad9a4cddf2cfb (diff) | |
download | external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.zip external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.tar.gz external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.tar.bz2 |
Merge webkit.org at r60469 : Initial merge by git.
Change-Id: I66a0047aa2af802f66bb0c7f2a8b02247a596234
Diffstat (limited to 'JavaScriptCore/wtf/OwnArrayPtr.h')
-rw-r--r-- | JavaScriptCore/wtf/OwnArrayPtr.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/JavaScriptCore/wtf/OwnArrayPtr.h b/JavaScriptCore/wtf/OwnArrayPtr.h index 61375c7..b06e640 100644 --- a/JavaScriptCore/wtf/OwnArrayPtr.h +++ b/JavaScriptCore/wtf/OwnArrayPtr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Apple Computer, Inc. + * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -35,7 +35,14 @@ namespace WTF { T* get() const { return m_ptr; } T* release() { T* ptr = m_ptr; m_ptr = 0; return ptr; } - void set(T* ptr) { ASSERT(m_ptr != ptr); safeDelete(); m_ptr = ptr; } + // FIXME: This should be renamed to adopt. + void set(T* ptr) + { + ASSERT(!ptr || m_ptr != ptr); + safeDelete(); + m_ptr = ptr; + } + void clear() { safeDelete(); m_ptr = 0; } T& operator*() const { ASSERT(m_ptr); return *m_ptr; } |