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

Unified Diff: third_party/WebKit/public/platform/WebPrivatePtr.h

Issue 2879133002: Made conversions from PassRefPtr to WebPrivatePtr move only. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebUserGestureToken.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/public/platform/WebPrivatePtr.h
diff --git a/third_party/WebKit/public/platform/WebPrivatePtr.h b/third_party/WebKit/public/platform/WebPrivatePtr.h
index 1349d00c82d7d4890d4d3a0a6c859a35c6a22598..62399d759bb1d80b47e4666610be1eca63edfed8 100644
--- a/third_party/WebKit/public/platform/WebPrivatePtr.h
+++ b/third_party/WebKit/public/platform/WebPrivatePtr.h
@@ -97,7 +97,7 @@ class PtrStorageImpl<T,
public:
typedef PassRefPtr<T> BlinkPtrType;
- void Assign(const BlinkPtrType& val) {
+ void Assign(BlinkPtrType&& val) {
static_assert(
crossThreadDestruction == kWebPrivatePtrDestructionSameThread ||
WTF::IsSubclassOfTemplate<T, WTF::ThreadSafeRefCounted>::value,
@@ -285,8 +285,8 @@ class WebPrivatePtr {
#if INSIDE_BLINK
template <typename U>
- WebPrivatePtr(const U& ptr) : storage_(0) {
- Storage().Assign(ptr);
+ WebPrivatePtr(U&& ptr) : storage_(0) {
+ Storage().Assign(std::forward<U>(ptr));
}
void Reset() { Storage().Release(); }
@@ -297,8 +297,8 @@ class WebPrivatePtr {
}
template <typename U>
- WebPrivatePtr& operator=(const U& ptr) {
- Storage().Assign(ptr);
+ WebPrivatePtr& operator=(U&& ptr) {
+ Storage().Assign(std::forward<U>(ptr));
return *this;
}
« no previous file with comments | « third_party/WebKit/Source/web/WebUserGestureToken.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698