RESOLVED FIXED 177817
Allow assigning WeakPtr<Derived> to WeakPtr<Base>
https://bugs.webkit.org/show_bug.cgi?id=177817
Summary Allow assigning WeakPtr<Derived> to WeakPtr<Base>
Antti Koivisto
Reported 2017-10-03 08:14:12 PDT
More templates!
Attachments
patch (5.87 KB, patch)
2017-10-03 08:19 PDT, Antti Koivisto
no flags
patch (6.23 KB, patch)
2017-10-03 08:23 PDT, Antti Koivisto
no flags
patch (6.23 KB, patch)
2017-10-03 08:25 PDT, Antti Koivisto
no flags
patch (6.28 KB, patch)
2017-10-03 08:33 PDT, Antti Koivisto
ggaren: review+
patch (6.82 KB, patch)
2017-10-03 09:41 PDT, Antti Koivisto
no flags
patch (6.81 KB, patch)
2017-10-03 10:13 PDT, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2017-10-03 08:19:51 PDT
Antti Koivisto
Comment 2 2017-10-03 08:23:41 PDT
Antti Koivisto
Comment 3 2017-10-03 08:25:56 PDT
Antti Koivisto
Comment 4 2017-10-03 08:33:39 PDT
Geoffrey Garen
Comment 5 2017-10-03 08:38:20 PDT
Comment on attachment 322525 [details] patch r=me Now that it's in five places, I think it's time to make a helper function that does the static_assert and reinterpret_cast on WeakReference<T>. Maybe call it static_weak_pointer_cast.
Antti Koivisto
Comment 6 2017-10-03 09:41:29 PDT
Antti Koivisto
Comment 7 2017-10-03 09:42:29 PDT
I added two helpers called weak_reference_downcast and weak_reference_upcast (the static_assert is the other way round).
Antti Koivisto
Comment 8 2017-10-03 10:13:25 PDT
Antti Koivisto
Comment 9 2017-10-03 11:49:35 PDT
Radar WebKit Bug Importer
Comment 10 2017-10-03 11:50:33 PDT
Geoffrey Garen
Comment 11 2017-10-03 11:58:25 PDT
Nice!
Note You need to log in before you can comment on or make changes to this bug.