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

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

Issue 2103823002: Disallow raw pointers in CrossThreadCopier/threadSafeBind() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug fix. Created 4 years, 5 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/platform/CrossThreadCopier.cpp ('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 Apple Inc. All rights reser ved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reser ved.
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 PassRefPtr& operator=(const PassRefPtr&) 93 PassRefPtr& operator=(const PassRefPtr&)
94 { 94 {
95 static_assert(!sizeof(T*), "PassRefPtr should never be assigned to"); 95 static_assert(!sizeof(T*), "PassRefPtr should never be assigned to");
96 return *this; 96 return *this;
97 } 97 }
98 98
99 mutable T* m_ptr; 99 mutable T* m_ptr;
100 }; 100 };
101 101
102 template <typename T> 102 template <typename T>
103 PassRefPtr<T> wrapPassRefPtr(T* ptr)
104 {
105 return PassRefPtr<T>(ptr);
106 }
107
108 template <typename T>
103 template <typename U> inline PassRefPtr<T>::PassRefPtr(const RefPtr<U>& o, Ensur ePtrConvertibleArgDefn(U, T)) 109 template <typename U> inline PassRefPtr<T>::PassRefPtr(const RefPtr<U>& o, Ensur ePtrConvertibleArgDefn(U, T))
104 : m_ptr(o.get()) 110 : m_ptr(o.get())
105 { 111 {
106 T* ptr = m_ptr; 112 T* ptr = m_ptr;
107 refIfNotNull(ptr); 113 refIfNotNull(ptr);
108 } 114 }
109 115
110 template <typename T> 116 template <typename T>
111 template <typename U> inline PassRefPtr<T>::PassRefPtr(RefPtr<U>&& o, EnsurePtrC onvertibleArgDefn(U, T)) 117 template <typename U> inline PassRefPtr<T>::PassRefPtr(RefPtr<U>&& o, EnsurePtrC onvertibleArgDefn(U, T))
112 : m_ptr(o.release().leakRef()) 118 : m_ptr(o.release().leakRef())
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return p.get(); 212 return p.get();
207 } 213 }
208 214
209 } // namespace WTF 215 } // namespace WTF
210 216
211 using WTF::PassRefPtr; 217 using WTF::PassRefPtr;
212 using WTF::adoptRef; 218 using WTF::adoptRef;
213 using WTF::static_pointer_cast; 219 using WTF::static_pointer_cast;
214 220
215 #endif // WTF_PassRefPtr_h 221 #endif // WTF_PassRefPtr_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/CrossThreadCopier.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698