Commit 1a949bb9 authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

WebPrivatePtr: avoid creating temporary Persistent<> on assignment.

For RefCountedGarbageCollected objects wrapped in a WebPrivatePtr, the
PtrStorageImpl::assign(PassRefPtr<T>) overload potentially created a
Persistent on assigning its underlying raw pointer, even if a RawPtr<>
was passed along (due to the implicit RawPtr<T> conversion that
PassRefPtr<T> provides.)

This assign() overload serves no real purpose with Oilpan enabled;
provide a more appropriate RawPtr<T> version there.

R=haraken@chromium.org,tkent@chromium.org
BUG=357163

Review URL: https://codereview.chromium.org/313173009

git-svn-id: svn://svn.chromium.org/blink/trunk@175558 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bb286a99
...@@ -132,7 +132,7 @@ private: ...@@ -132,7 +132,7 @@ private:
template<typename T> template<typename T>
class PtrStorageImpl<T, RefCountedGarbageCollectedLifetime> : public PtrStorageImpl<T, GarbageCollectedLifetime> { class PtrStorageImpl<T, RefCountedGarbageCollectedLifetime> : public PtrStorageImpl<T, GarbageCollectedLifetime> {
public: public:
void assign(const PassRefPtr<T>& val) { PtrStorageImpl<T, GarbageCollectedLifetime>::assign(val.get()); } void assign(const PassRefPtrWillBeRawPtr<T>& val) { PtrStorageImpl<T, GarbageCollectedLifetime>::assign(val.get()); }
void assign(const PtrStorageImpl& other) { PtrStorageImpl<T, GarbageCollectedLifetime>::assign(other.get()); } void assign(const PtrStorageImpl& other) { PtrStorageImpl<T, GarbageCollectedLifetime>::assign(other.get()); }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment