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

Unified Diff: third_party/WebKit/Source/wtf/OwnPtr.h

Issue 2012203002: Rename OwnPtr::clear() to reset(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for landing. Created 4 years, 7 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 | « third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/OwnPtr.h
diff --git a/third_party/WebKit/Source/wtf/OwnPtr.h b/third_party/WebKit/Source/wtf/OwnPtr.h
index a5b81b22b98f7cf3599e319ce734b9f185bca2d9..6725c0726871ca862426d7d8c557f5021f35db47 100644
--- a/third_party/WebKit/Source/wtf/OwnPtr.h
+++ b/third_party/WebKit/Source/wtf/OwnPtr.h
@@ -59,10 +59,7 @@ public:
PtrType get() const { return m_ptr; }
- // Note: clear() will soon get renamed to reset() as a part of OwnPtr -> std::unique_ptr transition.
- // For now, both are allowed to facilitate the rename process. See also: http://crbug.com/611661
- void clear();
- void reset() { clear(); }
+ void reset();
PtrType leakPtr() WARN_UNUSED_RETURN;
@@ -74,7 +71,7 @@ public:
bool operator!() const { return !m_ptr; }
explicit operator bool() const { return m_ptr; }
- OwnPtr& operator=(std::nullptr_t) { clear(); return *this; }
+ OwnPtr& operator=(std::nullptr_t) { reset(); return *this; }
OwnPtr(OwnPtr&&);
template <typename U, typename = typename std::enable_if<std::is_convertible<U*, T*>::value>::type> OwnPtr(OwnPtr<U>&&);
@@ -106,7 +103,7 @@ private:
PtrType m_ptr;
};
-template <typename T> inline void OwnPtr<T>::clear()
+template <typename T> inline void OwnPtr<T>::reset()
{
PtrType ptr = m_ptr;
m_ptr = nullptr;
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698