Changeset 55505 in webkit
- Timestamp:
- Mar 3, 2010 10:10:16 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55504 r55505 1 2010-03-03 Yuta Kitamura <yutak@chromium.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Add a new class that stores information about Web Socket handshake request. 6 7 Instances of this class contain the necessary information to send a Web Socket 8 handshake request. In the future, this class will provide request information 9 to the Web Inspector. 10 11 WebSocketHandshake needs to provide request information 12 https://bugs.webkit.org/show_bug.cgi?id=34784 13 14 No new tests, since the current tests will suffice (LayoutTests/websocket/*). 15 16 * GNUmakefile.am: 17 * WebCore.gypi: 18 * WebCore.pro: 19 * WebCore.vcproj/WebCore.vcproj: 20 * WebCore.xcodeproj/project.pbxproj: 21 * websockets/WebSocketChannel.cpp: 22 * websockets/WebSocketHandshake.cpp: 23 (WebCore::WebSocketHandshake::clientHandshakeMessage): 24 (WebCore::WebSocketHandshake::clientHandshakeRequest): 25 * websockets/WebSocketHandshake.h: 26 * websockets/WebSocketHandshakeRequest.cpp: Added. 27 (WebCore::WebSocketHandshakeRequest::WebSocketHandshakeRequest): 28 (WebCore::WebSocketHandshakeRequest::~WebSocketHandshakeRequest): 29 (WebCore::WebSocketHandshakeRequest::addExtraHeaderField): 30 (WebCore::WebSocketHandshakeRequest::headerFields): 31 (WebCore::WebSocketHandshakeRequest::host): 32 * websockets/WebSocketHandshakeRequest.h: Added. 33 1 34 2010-03-03 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2 35 -
trunk/WebCore/GNUmakefile.am
r55485 r55505 3473 3473 WebCore/websockets/WebSocketChannelClient.h \ 3474 3474 WebCore/websockets/WebSocketHandshake.cpp \ 3475 WebCore/websockets/WebSocketHandshake.h 3475 WebCore/websockets/WebSocketHandshake.h \ 3476 WebCore/websockets/WebSocketHandshakeRequest.cpp \ 3477 WebCore/websockets/WebSocketHandshakeRequest.h 3476 3478 3477 3479 if ENABLE_WORKERS -
trunk/WebCore/WebCore.gypi
r55486 r55505 3625 3625 'websockets/WebSocketHandshake.cpp', 3626 3626 'websockets/WebSocketHandshake.h', 3627 'websockets/WebSocketHandshakeRequest.cpp', 3628 'websockets/WebSocketHandshakeRequest.h', 3627 3629 'websockets/WorkerThreadableWebSocketChannel.cpp', 3628 3630 'websockets/WorkerThreadableWebSocketChannel.h', -
trunk/WebCore/WebCore.pro
r55485 r55505 2674 2674 2675 2675 contains(DEFINES, ENABLE_WEB_SOCKETS=1) { 2676 HEADERS += \ 2677 platform/network/qt/SocketStreamHandlePrivate.h \ 2678 2679 SOURCES += \ 2680 websockets/WebSocket.cpp \ 2681 websockets/WebSocketChannel.cpp \ 2682 websockets/WebSocketHandshake.cpp \ 2683 websockets/ThreadableWebSocketChannel.cpp \ 2684 platform/network/SocketStreamErrorBase.cpp \ 2685 platform/network/SocketStreamHandleBase.cpp \ 2686 platform/network/qt/SocketStreamHandleQt.cpp \ 2687 bindings/js/JSWebSocketCustom.cpp \ 2688 bindings/js/JSWebSocketConstructor.cpp 2689 2690 contains(DEFINES, ENABLE_WORKERS=1) { 2691 SOURCES += \ 2692 websockets/WorkerThreadableWebSocketChannel.cpp 2693 } 2676 HEADERS += \ 2677 websockets/ThreadableWebSocketChannel.h \ 2678 websockets/ThreadableWebSocketChannelClientWrapper.h \ 2679 websockets/WebSocket.h \ 2680 websockets/WebSocketChannel.h \ 2681 websockets/WebSocketChannelClient.h \ 2682 websockets/WebSocketHandshake.h \ 2683 websockets/WebSocketHandshakeRequest.h \ 2684 platform/network/qt/SocketStreamHandlePrivate.h 2685 2686 SOURCES += \ 2687 websockets/WebSocket.cpp \ 2688 websockets/WebSocketChannel.cpp \ 2689 websockets/WebSocketHandshake.cpp \ 2690 websockets/WebSocketHandshakeRequest.cpp \ 2691 websockets/ThreadableWebSocketChannel.cpp \ 2692 platform/network/SocketStreamErrorBase.cpp \ 2693 platform/network/SocketStreamHandleBase.cpp \ 2694 platform/network/qt/SocketStreamHandleQt.cpp \ 2695 bindings/js/JSWebSocketCustom.cpp \ 2696 bindings/js/JSWebSocketConstructor.cpp 2697 2698 contains(DEFINES, ENABLE_WORKERS=1) { 2699 HEADERS += \ 2700 websockets/WorkerThreadableWebSocketChannel.h 2701 2702 SOURCES += \ 2703 websockets/WorkerThreadableWebSocketChannel.cpp 2704 } 2694 2705 } 2695 2706 -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r55485 r55505 27050 27050 </File> 27051 27051 <File 27052 RelativePath="..\rendering\BidiRun.cpp" 27053 > 27054 </File> 27055 <File 27056 RelativePath="..\rendering\BidiRun.h" 27057 > 27058 </File> 27059 <File 27052 27060 RelativePath="..\rendering\break_lines.cpp" 27053 27061 > … … 27057 27065 > 27058 27066 </File> 27059 <File27060 RelativePath="..\rendering\BidiRun.cpp"27061 >27062 </File>27063 <File27064 RelativePath="..\rendering\BidiRun.h"27065 >27066 </File>27067 27067 <File 27068 27068 RelativePath="..\rendering\CounterNode.cpp" … … 27121 27121 > 27122 27122 </File> 27123 27123 <File 27124 27124 RelativePath="..\rendering\InlineIterator.h" 27125 27125 > … … 34257 34257 </File> 34258 34258 <File 34259 RelativePath="..\bindings\js\JavaScriptProfile.cpp" 34260 > 34261 </File> 34262 <File 34263 RelativePath="..\bindings\js\JavaScriptProfile.h" 34264 > 34265 </File> 34266 <File 34267 RelativePath="..\bindings\js\JavaScriptProfileNode.cpp" 34268 > 34269 </File> 34270 <File 34271 RelativePath="..\bindings\js\JavaScriptProfileNode.h" 34272 > 34273 </File> 34274 <File 34259 34275 RelativePath="..\bindings\js\JSAbstractWorkerCustom.cpp" 34260 34276 > … … 39943 39959 /> 39944 39960 </FileConfiguration> 39945 </File>39946 <File39947 RelativePath="..\bindings\js\JavaScriptProfile.cpp"39948 >39949 </File>39950 <File39951 RelativePath="..\bindings\js\JavaScriptProfile.h"39952 >39953 </File>39954 <File39955 RelativePath="..\bindings\js\JavaScriptProfileNode.cpp"39956 >39957 </File>39958 <File39959 RelativePath="..\bindings\js\JavaScriptProfileNode.h"39960 >39961 39961 </File> 39962 39962 <File … … 43057 43057 </File> 43058 43058 <File 43059 RelativePath="..\inspector\front-end\textViewer.css" 43060 > 43061 </File> 43062 <File 43059 43063 RelativePath="..\inspector\front-end\TextViewer.js" 43060 >43061 </File>43062 <File43063 RelativePath="..\inspector\front-end\textViewer.css"43064 43064 > 43065 43065 </File> … … 43487 43487 <File 43488 43488 RelativePath="..\websockets\WebSocketHandshake.h" 43489 > 43490 </File> 43491 <File 43492 RelativePath="..\websockets\WebSocketHandshakeRequest.cpp" 43493 > 43494 </File> 43495 <File 43496 RelativePath="..\websockets\WebSocketHandshakeRequest.h" 43489 43497 > 43490 43498 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r55491 r55505 1265 1265 75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; }; 1266 1266 75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; }; 1267 7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */; }; 1268 7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */; }; 1267 1269 7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BACE106C2DCA007B0823 /* HaltablePlugin.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1268 1270 7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7693BACF106C2DCA007B0823 /* PluginHalter.cpp */; }; … … 6699 6701 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; }; 6700 6702 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; }; 6703 7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshakeRequest.cpp; sourceTree = "<group>"; }; 6704 7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshakeRequest.h; sourceTree = "<group>"; }; 6701 6705 7693BACE106C2DCA007B0823 /* HaltablePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HaltablePlugin.h; sourceTree = "<group>"; }; 6702 6706 7693BACF106C2DCA007B0823 /* PluginHalter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginHalter.cpp; sourceTree = "<group>"; }; … … 11180 11184 isa = PBXGroup; 11181 11185 children = ( 11186 7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */, 11187 7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */, 11182 11188 5112247110CFB8C6008099D7 /* ThreadableWebSocketChannel.cpp */, 11183 11189 5112247310CFB8D8008099D7 /* ThreadableWebSocketChannel.h */, … … 18599 18605 E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */, 18600 18606 CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */, 18607 7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */, 18601 18608 ); 18602 18609 runOnlyForDeploymentPostprocessing = 0; … … 20788 20795 596229781133EFD700DC4CBB /* GeolocationPositionCache.cpp in Sources */, 20789 20796 0BC2C7771134A8FC000B2F61 /* CanvasSurface.cpp in Sources */, 20797 7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */, 20790 20798 ); 20791 20799 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/websockets/WebSocketChannel.cpp
r54927 r55505 45 45 #include "StringHash.h" 46 46 #include "WebSocketChannelClient.h" 47 #include "WebSocketHandshake.h" 47 48 48 49 #include <wtf/Deque.h> -
trunk/WebCore/websockets/WebSocketHandshake.cpp
r54707 r55505 131 131 } 132 132 133 void WebSocketHandshake::setSecure(bool secure)134 {135 m_secure = secure;136 }137 138 133 String WebSocketHandshake::clientOrigin() const 139 134 { … … 159 154 CString WebSocketHandshake::clientHandshakeMessage() const 160 155 { 156 // Keep the following consistent with clientHandshakeRequest(). 161 157 StringBuilder builder; 162 158 … … 168 164 builder.append("Host: "); 169 165 builder.append(m_url.host().lower()); 170 if (m_url.port()) { 171 if ((!m_secure && m_url.port() != 80) || (m_secure && m_url.port() != 443)) { 172 builder.append(":"); 173 builder.append(String::number(m_url.port())); 174 } 166 if (m_url.port() && ((!m_secure && m_url.port() != 80) || (m_secure && m_url.port() != 443))) { 167 builder.append(":"); 168 builder.append(String::number(m_url.port())); 175 169 } 176 170 builder.append("\r\n"); … … 183 177 builder.append("\r\n"); 184 178 } 179 185 180 KURL url = httpURLForAuthenticationAndCookies(); 186 // FIXME: set authentication information or cookies for url.187 // Set "Authorization: <credentials>" if authentication information exists for url.188 181 if (m_context->isDocument()) { 189 182 Document* document = static_cast<Document*>(m_context); … … 196 189 // Set "Cookie2: <cookie>" if cookies 2 exists for url? 197 190 } 191 198 192 builder.append("\r\n"); 199 193 return builder.toString().utf8(); 194 } 195 196 WebSocketHandshakeRequest WebSocketHandshake::clientHandshakeRequest() const 197 { 198 // Keep the following consistent with clientHandshakeMessage(). 199 WebSocketHandshakeRequest request(m_url, clientOrigin(), m_clientProtocol); 200 201 KURL url = httpURLForAuthenticationAndCookies(); 202 if (m_context->isDocument()) { 203 Document* document = static_cast<Document*>(m_context); 204 String cookie = cookieRequestHeaderFieldValue(document, url); 205 if (!cookie.isEmpty()) 206 request.addExtraHeaderField("Cookie", cookie); 207 // Set "Cookie2: <cookie>" if cookies 2 exists for url? 208 } 209 210 return request; 200 211 } 201 212 -
trunk/WebCore/websockets/WebSocketHandshake.h
r52892 r55505 36 36 #include "KURL.h" 37 37 #include "PlatformString.h" 38 #include "WebSocketHandshakeRequest.h" 38 39 #include <wtf/Noncopyable.h> 39 40 … … 59 60 60 61 bool secure() const; 61 void setSecure(bool secure);62 62 63 63 String clientOrigin() const; … … 65 65 66 66 CString clientHandshakeMessage() const; 67 WebSocketHandshakeRequest clientHandshakeRequest() const; 67 68 68 69 void reset();
Note: See TracChangeset
for help on using the changeset viewer.