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

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

Issue 2145643002: Purge UnspecifiedBoolType from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2010 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 template <typename U> RetainPtr(const RetainPtr<U>&); 100 template <typename U> RetainPtr(const RetainPtr<U>&);
101 101
102 void clear(); 102 void clear();
103 PtrType leakRef() WARN_UNUSED_RETURN; 103 PtrType leakRef() WARN_UNUSED_RETURN;
104 104
105 PtrType get() const { return m_ptr; } 105 PtrType get() const { return m_ptr; }
106 PtrType operator->() const { return m_ptr; } 106 PtrType operator->() const { return m_ptr; }
107 107
108 bool operator!() const { return !m_ptr; } 108 bool operator!() const { return !m_ptr; }
109 109 explicit operator bool() const { return m_ptr; }
110 // This conversion operator allows implicit conversion to bool but not to
111 // other integer types.
112 typedef PtrType RetainPtr::*UnspecifiedBoolType;
113 operator UnspecifiedBoolType() const { return m_ptr ? &RetainPtr::m_ptr : 0; }
114 110
115 RetainPtr& operator=(const RetainPtr&); 111 RetainPtr& operator=(const RetainPtr&);
116 template <typename U> RetainPtr& operator=(const RetainPtr<U>&); 112 template <typename U> RetainPtr& operator=(const RetainPtr<U>&);
117 RetainPtr& operator=(PtrType); 113 RetainPtr& operator=(PtrType);
118 template <typename U> RetainPtr& operator=(U*); 114 template <typename U> RetainPtr& operator=(U*);
119 115
120 RetainPtr& operator=(RetainPtr&&); 116 RetainPtr& operator=(RetainPtr&&);
121 template <typename U> RetainPtr& operator=(RetainPtr<U>&&); 117 template <typename U> RetainPtr& operator=(RetainPtr<U>&&);
122 118
123 RetainPtr& operator=(std::nullptr_t) 119 RetainPtr& operator=(std::nullptr_t)
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } // namespace WTF 316 } // namespace WTF
321 317
322 using WTF::AdoptCF; 318 using WTF::AdoptCF;
323 using WTF::AdoptNS; 319 using WTF::AdoptNS;
324 using WTF::adoptCF; 320 using WTF::adoptCF;
325 using WTF::adoptNS; 321 using WTF::adoptNS;
326 using WTF::RetainPtr; 322 using WTF::RetainPtr;
327 using WTF::retainPtr; 323 using WTF::retainPtr;
328 324
329 #endif // WTF_RetainPtr_h 325 #endif // WTF_RetainPtr_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/api/LineLayoutItem.h ('k') | third_party/WebKit/Source/wtf/WeakPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698