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

Side by Side Diff: third_party/WebKit/Source/wtf/RefPtr.h

Issue 2254073002: Remove WTF::static_pointer_cast functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/PassRefPtr.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 template <typename T> inline bool operator!=(const RefPtr<T>& a, std::nullptr_t) 159 template <typename T> inline bool operator!=(const RefPtr<T>& a, std::nullptr_t)
160 { 160 {
161 return a.get(); 161 return a.get();
162 } 162 }
163 163
164 template <typename T> inline bool operator!=(std::nullptr_t, const RefPtr<T>& b) 164 template <typename T> inline bool operator!=(std::nullptr_t, const RefPtr<T>& b)
165 { 165 {
166 return b.get(); 166 return b.get();
167 } 167 }
168 168
169 template <typename T, typename U> inline RefPtr<T> static_pointer_cast(const Ref Ptr<U>& p)
170 {
171 return RefPtr<T>(static_cast<T*>(p.get()));
172 }
173
174 template <typename T> inline T* getPtr(const RefPtr<T>& p) 169 template <typename T> inline T* getPtr(const RefPtr<T>& p)
175 { 170 {
176 return p.get(); 171 return p.get();
177 } 172 }
178 173
179 template <typename T> class RefPtrValuePeeker { 174 template <typename T> class RefPtrValuePeeker {
180 DISALLOW_NEW(); 175 DISALLOW_NEW();
181 public: 176 public:
182 ALWAYS_INLINE RefPtrValuePeeker(T* p): m_ptr(p) {} 177 ALWAYS_INLINE RefPtrValuePeeker(T* p): m_ptr(p) {}
183 ALWAYS_INLINE RefPtrValuePeeker(std::nullptr_t): m_ptr(nullptr) {} 178 ALWAYS_INLINE RefPtrValuePeeker(std::nullptr_t): m_ptr(nullptr) {}
184 template <typename U> RefPtrValuePeeker(const RefPtr<U>& p): m_ptr(p.get()) {} 179 template <typename U> RefPtrValuePeeker(const RefPtr<U>& p): m_ptr(p.get()) {}
185 template <typename U> RefPtrValuePeeker(const PassRefPtr<U>& p): m_ptr(p.get ()) {} 180 template <typename U> RefPtrValuePeeker(const PassRefPtr<U>& p): m_ptr(p.get ()) {}
186 181
187 ALWAYS_INLINE operator T*() const { return m_ptr; } 182 ALWAYS_INLINE operator T*() const { return m_ptr; }
188 private: 183 private:
189 T* m_ptr; 184 T* m_ptr;
190 }; 185 };
191 186
192 } // namespace WTF 187 } // namespace WTF
193 188
194 using WTF::RefPtr; 189 using WTF::RefPtr;
195 using WTF::static_pointer_cast;
196 190
197 #endif // WTF_RefPtr_h 191 #endif // WTF_RefPtr_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/PassRefPtr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698