<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>61115</bug_id>
          
          <creation_ts>2011-05-19 01:19:24 -0700</creation_ts>
          <short_desc>WebSocket: Refactor WebSocket error reports</short_desc>
          <delta_ts>2011-06-02 01:23:34 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>61277</dependson>
    
    <dependson>61353</dependson>
    
    <dependson>61841</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yuta Kitamura">yutak</reporter>
          <assigned_to name="Yuta Kitamura">yutak</assigned_to>
          <cc>ap</cc>
    
    <cc>tkent</cc>
    
    <cc>ukai</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>406286</commentid>
    <comment_count>0</comment_count>
    <who name="Yuta Kitamura">yutak</who>
    <bug_when>2011-05-19 01:19:24 -0700</bug_when>
    <thetext>Currently, the codes that report WebSocket errors to JavaScript console are scaterred among various places in WebCore. This sounds ad-hoc, and could be improved.

We could add a function to WebSocketChannel (and ThreadableWebSocketChannel, WorkerThreadableWebSocketChannel) that corresponds to &quot;fail the WebSocket connection&quot; algorithm in the WebSocket protocol specification (*1), like:

    class WebSocketChannel
    {
        ...
        void fail(const String&amp; errorMessage); // Log the error to JavaScript console, and do close().
        ...
    };

... and use it in places where we need to &quot;fail the WebSocket connection&quot;. I think this change will make the code more readable and easier to track.

(*1) In the WebSocket protocol specification, an algorithm called &quot;fail the WebSocket connection&quot; is defined:

http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00#section-6.1
   Certain algorithms require the user agent to *fail the WebSocket
   connection*.  To do so, the user agent must close the WebSocket
   connection, and may report the problem to the user (which would be
   especially useful for developers).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>413985</commentid>
    <comment_count>1</comment_count>
    <who name="Yuta Kitamura">yutak</who>
    <bug_when>2011-06-02 01:23:34 -0700</bug_when>
    <thetext>This is done!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>