<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [Curl] WebSocket platform part is not implemented."
href="https://bugs.webkit.org/show_bug.cgi?id=144628#c16">Comment # 16</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [Curl] WebSocket platform part is not implemented."
href="https://bugs.webkit.org/show_bug.cgi?id=144628">bug 144628</a>
from <span class="vcard"><a class="email" href="mailto:peavo@outlook.com" title="peavo@outlook.com">peavo@outlook.com</a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=144628#c14">comment #14</a>)
<span class="quote">> Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=252878&action=diff" name="attach_252878" title="Patch">attachment 252878</a> <a href="attachment.cgi?id=252878&action=edit" title="Patch">[details]</a></span>
> Patch</span >
>
Thanks again :)
<span class="quote">>
> > 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.
> </span >
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:
<a href="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">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</a>
<a href="http://stackoverflow.com/questions/10133591/using-smart-pointers-in-a-struct-or-class">http://stackoverflow.com/questions/10133591/using-smart-pointers-in-a-struct-or-class</a>
Is this a MSVC problem? I assume gcc doesn't have these problems.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>