Bug 78576

Summary: [WebSocket] WebSocketChannel minor refactoring for code manageability
Product: WebKit Reporter: Takashi Toyoshima <toyoshim>
Component: WebCore Misc.Assignee: Takashi Toyoshima <toyoshim>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bashi, tkent, webkit.review.bot, yutak
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 78459    
Attachments:
Description Flags
Patch
none
Patch none

Description Takashi Toyoshima 2012-02-13 22:41:15 PST
Currently, WebSocketChannel hold ScriptExecutionContext as m_context.
But, in many situation, we assume it must be a inheritance of Document and use static cast.
Actually, it is true for now, but could be dangerous against future code change.
This refactoring make that WebSocketChannel hold it as Document* m_document.
It reduces static cast chances.
Comment 1 Takashi Toyoshima 2012-02-13 22:52:45 PST
Created attachment 126912 [details]
Patch
Comment 2 Takashi Toyoshima 2012-02-13 22:56:00 PST
This is the refactoring Kent-san suggest in review for 78460.
That change itself contains wrong direction, but this refactoring could be independent from that, and looks reasonable.
Comment 3 Early Warning System Bot 2012-02-13 23:29:13 PST
Comment on attachment 126912 [details]
Patch

Attachment 126912 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11518157
Comment 4 Yuta Kitamura 2012-02-13 23:54:21 PST
Comment on attachment 126912 [details]
Patch

Seems fine. [Note: I don't have r+ privilege.]

However, some bots look unhappy with your patch, so please investigate it. I think you just need some more #includes.
Comment 5 Takashi Toyoshima 2012-02-13 23:58:16 PST
Created attachment 126920 [details]
Patch
Comment 6 Takashi Toyoshima 2012-02-14 00:05:34 PST
I hope the second one fix the compilation issue.
I just add #include "Document.h" for static_cast<Document*> in two source files.
Comment 7 Kent Tamura 2012-02-14 15:53:42 PST
Comment on attachment 126920 [details]
Patch

ok
Comment 8 WebKit Review Bot 2012-02-14 22:39:51 PST
Comment on attachment 126920 [details]
Patch

Clearing flags on attachment: 126920

Committed r107780: <http://trac.webkit.org/changeset/107780>
Comment 9 WebKit Review Bot 2012-02-14 22:39:56 PST
All reviewed patches have been landed.  Closing bug.