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

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

Issue 2867693003: Changed PassRefPtr templated copy constructor to move constructor. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 template <typename T> 67 template <typename T>
68 class PassRefPtr { 68 class PassRefPtr {
69 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 69 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
70 70
71 public: 71 public:
72 PassRefPtr() : ptr_(nullptr) {} 72 PassRefPtr() : ptr_(nullptr) {}
73 PassRefPtr(std::nullptr_t) : ptr_(nullptr) {} 73 PassRefPtr(std::nullptr_t) : ptr_(nullptr) {}
74 PassRefPtr(T* ptr) : ptr_(ptr) { RefIfNotNull(ptr); } 74 PassRefPtr(T* ptr) : ptr_(ptr) { RefIfNotNull(ptr); }
75 PassRefPtr(PassRefPtr&& o) : ptr_(o.LeakRef()) {} 75 PassRefPtr(PassRefPtr&& o) : ptr_(o.LeakRef()) {}
76 template <typename U> 76 template <typename U>
77 PassRefPtr(const PassRefPtr<U>& o, EnsurePtrConvertibleArgDecl(U, T)) 77 PassRefPtr(PassRefPtr<U>&& o, EnsurePtrConvertibleArgDecl(U, T))
78 : ptr_(o.LeakRef()) {} 78 : ptr_(o.LeakRef()) {}
79 79
80 ALWAYS_INLINE ~PassRefPtr() { DerefIfNotNull(ptr_); } 80 ALWAYS_INLINE ~PassRefPtr() { DerefIfNotNull(ptr_); }
81 81
82 template <typename U> 82 template <typename U>
83 PassRefPtr(const RefPtr<U>&, EnsurePtrConvertibleArgDecl(U, T)); 83 PassRefPtr(const RefPtr<U>&, EnsurePtrConvertibleArgDecl(U, T));
84 template <typename U> 84 template <typename U>
85 PassRefPtr(RefPtr<U>&&, EnsurePtrConvertibleArgDecl(U, T)); 85 PassRefPtr(RefPtr<U>&&, EnsurePtrConvertibleArgDecl(U, T));
86 86
87 T* Get() const { return ptr_; } 87 T* Get() const { return ptr_; }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 inline T* GetPtr(const PassRefPtr<T>& p) { 215 inline T* GetPtr(const PassRefPtr<T>& p) {
216 return p.Get(); 216 return p.Get();
217 } 217 }
218 218
219 } // namespace WTF 219 } // namespace WTF
220 220
221 using WTF::PassRefPtr; 221 using WTF::PassRefPtr;
222 using WTF::AdoptRef; 222 using WTF::AdoptRef;
223 223
224 #endif // WTF_PassRefPtr_h 224 #endif // WTF_PassRefPtr_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMTypedArray.h ('k') | third_party/WebKit/Source/web/tests/MHTMLTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698