[Webkit-unassigned] [Bug 144628] [Curl] WebSocket platform part is not implemented.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed May 13 04:01:34 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=144628
--- Comment #16 from peavo at outlook.com ---
(In reply to comment #14)
> Comment on attachment 252878 [details]
> Patch
>
Thanks again :)
>
> > Source/WebCore/platform/network/curl/SocketStreamHandle.h:99
> > + SocketData(std::unique_ptr<const char[]>&& source, int length)
> > + {
> > + data = WTF::move(source);
> > + size = length;
> > + }
> > +
> > + SocketData(SocketData&& other)
> > + {
> > + data = WTF::move(other.data);
> > + size = other.size;
> > + other.size = 0;
> > + }
>
> I donât understand why you had to define these.
>
> > Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp:71
> > + m_sendData.append(SocketData(WTF::move(copy), length));
>
> Should just be SocketData { WTF::move(copy), length } and then it should
> work without a constructor.
>
I'm sorry, but I don't seem to be able to get rid of these constructors.
When I remove them, I get the following error:
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0(611): error C2280: 'std::unique_ptr<char [],std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function
1> with
1> [
1> _Ty=char []
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1618) : see declaration of 'std::unique_ptr<char [],std::default_delete<_Ty>>::unique_ptr'
1> with
1> [
1> _Ty=char []
1> ]
1> This diagnostic occurred in the compiler generated function 'WebCore::SocketStreamHandle::SocketData::SocketData(const WebCore::SocketStreamHandle::SocketData &)'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I believe this happens because Deque::append and Deque::prepend makes MSVC generate a SocketData copy constructor, which is not possible since the copy constructor in unique_ptr is deleted.
There seems to be reports of similar problems:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/ace575e6-3969-4672-9db1-85c9d6588e4a/cant-put-class-with-uniqueptr-member-in-stl-container?forum=vclanguage
http://stackoverflow.com/questions/10133591/using-smart-pointers-in-a-struct-or-class
Is this a MSVC problem? I assume gcc doesn't have these problems.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150513/ab5202cf/attachment.html>
More information about the webkit-unassigned
mailing list