[Webkit-unassigned] [Bug 204338] [WinCairo] Refine initialization and error handling in RemoteInspectorSocket

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 6 02:35:35 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=204338

--- Comment #3 from Yousuke Kimoto <Yousuke.Kimoto at sony.com> ---
(In reply to Fujii Hironori from comment #2)
> > Source/JavaScriptCore/inspector/remote/socket/win/RemoteInspectorSocketWin.cpp:221
> > +        LOG_ERROR("createPair() error at getting server port (errno = %d)", WSAGetLastError());
> 
> You don't need to include the function name "createPair()" in LOG_ERROR
> message because it contains.
I understand, and delete the redundant error message.

> #define LOG_ERROR(...) WTFReportError(__FILE__, __LINE__,
> WTF_PRETTY_FUNCTION, __VA_ARGS__)
> 
> I think this LOG_ERROR is unnecessary because getPort prints log if it'd
> fail.
Actually getPort() in RemoteInspectorSocketWin.cpp doesn't print an error message though (getPort() in RemoteInspectorSocketPOSIX.cpp has it), it is a good style that the function prints the message.

> > Source/JavaScriptCore/inspector/remote/socket/win/RemoteInspectorSocketWin.cpp:224
> > +    address.sin_port = htons((u_short)*serverPort);
> 
> Why did you add this cast (u_short)? I think it's unnecessary. And, WebKit
> is merely using C style cast. Use static_cast<u_short>() if needed.
Right, it's unnecessary. (I saw a cast warning at the line, but it seemed I was confused.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191206/b9c0a7cb/attachment.htm>


More information about the webkit-unassigned mailing list