Changeset 150142 in webkit
- Timestamp:
- May 15, 2013 1:22:29 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r150062 r150142 964 964 Modules/websockets/WebSocketFrame.cpp 965 965 Modules/websockets/WebSocketHandshake.cpp 966 Modules/websockets/WebSocketHandshakeRequest.cpp967 966 Modules/websockets/WebSocketHandshakeResponse.cpp 968 967 Modules/websockets/WorkerThreadableWebSocketChannel.cpp -
trunk/Source/WebCore/ChangeLog
r150141 r150142 1 2013-05-15 Anders Carlsson <andersca@apple.com> 2 3 Remove WebSocketHandshakeRequest class 4 https://bugs.webkit.org/show_bug.cgi?id=116178 5 6 Reviewed by Andreas Kling. 7 8 Turns out WebSocketHandshakeRequest is just used by the web inspector, and there's no reason 9 why we can't just use a ResourceRequest instead. 10 11 * CMakeLists.txt: 12 * GNUmakefile.list.am: 13 * Modules/websockets/WebSocketChannel.cpp: 14 (WebCore::WebSocketChannel::didOpenSocketStream): 15 * Modules/websockets/WebSocketHandshake.cpp: 16 (WebCore::WebSocketHandshake::clientHandshakeRequest): 17 * Modules/websockets/WebSocketHandshake.h: 18 (WebCore): 19 * Modules/websockets/WebSocketHandshakeRequest.cpp: Removed. 20 * Modules/websockets/WebSocketHandshakeRequest.h: Removed. 21 * Target.pri: 22 * WebCore.vcproj/WebCore.vcproj: 23 * WebCore.vcxproj/WebCore.vcxproj: 24 * WebCore.vcxproj/WebCore.vcxproj.filters: 25 * WebCore.xcodeproj/project.pbxproj: 26 * inspector/InspectorInstrumentation.cpp: 27 (WebCore): 28 (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl): 29 * inspector/InspectorInstrumentation.h: 30 (InspectorInstrumentation): 31 (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest): 32 * inspector/InspectorResourceAgent.cpp: 33 (WebCore::InspectorResourceAgent::willSendWebSocketHandshakeRequest): 34 * inspector/InspectorResourceAgent.h: 35 (WebCore): 36 (InspectorResourceAgent): 37 * platform/network/HTTPRequest.cpp: 38 (WebCore): 39 1 40 2013-05-15 Darin Adler <darin@apple.com> 2 41 -
trunk/Source/WebCore/GNUmakefile.list.am
r150074 r150142 2260 2260 Source/WebCore/Modules/websockets/WebSocketHandshake.cpp \ 2261 2261 Source/WebCore/Modules/websockets/WebSocketHandshake.h \ 2262 Source/WebCore/Modules/websockets/WebSocketHandshakeRequest.cpp \2263 Source/WebCore/Modules/websockets/WebSocketHandshakeRequest.h \2264 2262 Source/WebCore/Modules/websockets/WebSocketHandshakeResponse.cpp \ 2265 2263 Source/WebCore/Modules/websockets/WebSocketHandshakeResponse.h \ -
trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp
r147938 r150142 48 48 #include "Page.h" 49 49 #include "ProgressTracker.h" 50 #include "ResourceRequest.h" 50 51 #include "ScriptCallStack.h" 51 52 #include "ScriptExecutionContext.h" … … 258 259 return; 259 260 if (m_identifier) 260 InspectorInstrumentation::willSendWebSocketHandshakeRequest(m_document, m_identifier, *m_handshake->clientHandshakeRequest());261 InspectorInstrumentation::willSendWebSocketHandshakeRequest(m_document, m_identifier, m_handshake->clientHandshakeRequest()); 261 262 CString handshakeMessage = m_handshake->clientHandshakeMessage(); 262 263 if (!handle->send(handshakeMessage.data(), handshakeMessage.length())) -
trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
r149120 r150142 44 44 #include "KURL.h" 45 45 #include "Logging.h" 46 #include "ResourceRequest.h" 46 47 #include "ScriptCallStack.h" 47 48 #include "ScriptExecutionContext.h" … … 237 238 } 238 239 239 PassRefPtr<WebSocketHandshakeRequest>WebSocketHandshake::clientHandshakeRequest() const240 ResourceRequest WebSocketHandshake::clientHandshakeRequest() const 240 241 { 241 242 // Keep the following consistent with clientHandshakeMessage(). 242 243 // FIXME: do we need to store m_secWebSocketKey1, m_secWebSocketKey2 and 243 // m_key3 in WebSocketHandshakeRequest? 244 RefPtr<WebSocketHandshakeRequest> request = WebSocketHandshakeRequest::create("GET", m_url); 245 request->addHeaderField("Upgrade", "websocket"); 246 request->addHeaderField("Connection", "Upgrade"); 247 request->addHeaderField("Host", hostName(m_url, m_secure)); 248 request->addHeaderField("Origin", clientOrigin()); 244 // m_key3 in the request? 245 ResourceRequest request(m_url); 246 request.setHTTPMethod("GET"); 247 248 request.addHTTPHeaderField("Connection", "Upgrade"); 249 request.addHTTPHeaderField("Host", hostName(m_url, m_secure)); 250 request.addHTTPHeaderField("Origin", clientOrigin()); 249 251 if (!m_clientProtocol.isEmpty()) 250 request ->addHeaderField("Sec-WebSocket-Protocol", m_clientProtocol);252 request.addHTTPHeaderField("Sec-WebSocket-Protocol", m_clientProtocol); 251 253 252 254 KURL url = httpURLForAuthenticationAndCookies(); … … 255 257 String cookie = cookieRequestHeaderFieldValue(document, url); 256 258 if (!cookie.isEmpty()) 257 request ->addHeaderField("Cookie", cookie);259 request.addHTTPHeaderField("Cookie", cookie); 258 260 // Set "Cookie2: <cookie>" if cookies 2 exists for url? 259 261 } 260 262 261 request ->addHeaderField("Pragma", "no-cache");262 request ->addHeaderField("Cache-Control", "no-cache");263 264 request ->addHeaderField("Sec-WebSocket-Key", m_secWebSocketKey);265 request ->addHeaderField("Sec-WebSocket-Version", "13");263 request.addHTTPHeaderField("Pragma", "no-cache"); 264 request.addHTTPHeaderField("Cache-Control", "no-cache"); 265 266 request.addHTTPHeaderField("Sec-WebSocket-Key", m_secWebSocketKey); 267 request.addHTTPHeaderField("Sec-WebSocket-Version", "13"); 266 268 const String extensionValue = m_extensionDispatcher.createHeaderValue(); 267 269 if (extensionValue.length()) 268 request ->addHeaderField("Sec-WebSocket-Extensions", extensionValue);270 request.addHTTPHeaderField("Sec-WebSocket-Extensions", extensionValue); 269 271 270 272 // Add a User-Agent header. 271 request ->addHeaderField("User-Agent", m_context->userAgent(m_context->url()));272 273 return request .release();273 request.addHTTPHeaderField("User-Agent", m_context->userAgent(m_context->url())); 274 275 return request; 274 276 } 275 277 -
trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.h
r128572 r150142 37 37 #include "WebSocketExtensionDispatcher.h" 38 38 #include "WebSocketExtensionProcessor.h" 39 #include "WebSocketHandshakeRequest.h"40 39 #include "WebSocketHandshakeResponse.h" 41 40 #include <wtf/PassOwnPtr.h> … … 44 43 namespace WebCore { 45 44 45 class ResourceRequest; 46 46 class ScriptExecutionContext; 47 47 … … 68 68 69 69 CString clientHandshakeMessage() const; 70 PassRefPtr<WebSocketHandshakeRequest>clientHandshakeRequest() const;70 ResourceRequest clientHandshakeRequest() const; 71 71 72 72 void reset(); -
trunk/Source/WebCore/Target.pri
r150045 r150142 4025 4025 Modules/websockets/WebSocketFrame.h \ 4026 4026 Modules/websockets/WebSocketHandshake.h \ 4027 Modules/websockets/WebSocketHandshakeRequest.h \4028 4027 Modules/websockets/WebSocketHandshakeResponse.h \ 4029 4028 Modules/websockets/WorkerThreadableWebSocketChannel.h \ … … 4039 4038 Modules/websockets/WebSocketFrame.cpp \ 4040 4039 Modules/websockets/WebSocketHandshake.cpp \ 4041 Modules/websockets/WebSocketHandshakeRequest.cpp \4042 4040 Modules/websockets/WebSocketHandshakeResponse.cpp \ 4043 4041 Modules/websockets/WorkerThreadableWebSocketChannel.cpp \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r150053 r150142 25911 25911 </File> 25912 25912 <File 25913 RelativePath="..\Modules\websockets\WebSocketHandshakeRequest.cpp"25914 >25915 </File>25916 <File25917 RelativePath="..\Modules\websockets\WebSocketHandshakeRequest.h"25918 >25919 </File>25920 <File25921 25913 RelativePath="..\Modules\websockets\WebSocketHandshakeResponse.cpp" 25922 25914 > -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r150053 r150142 3711 3711 <ClCompile Include="..\Modules\websockets\WebSocketFrame.cpp" /> 3712 3712 <ClCompile Include="..\Modules\websockets\WebSocketHandshake.cpp" /> 3713 <ClCompile Include="..\Modules\websockets\WebSocketHandshakeRequest.cpp" />3714 3713 <ClCompile Include="..\Modules\websockets\WebSocketHandshakeResponse.cpp" /> 3715 3714 <ClCompile Include="..\Modules\websockets\WorkerThreadableWebSocketChannel.cpp" /> … … 11309 11308 <ClInclude Include="..\Modules\websockets\WebSocketFrame.h" /> 11310 11309 <ClInclude Include="..\Modules\websockets\WebSocketHandshake.h" /> 11311 <ClInclude Include="..\Modules\websockets\WebSocketHandshakeRequest.h" />11312 <ClInclude Include="..\Modules\websockets\WebSocketHandshakeResponse.h" />11313 11310 <ClInclude Include="..\Modules\websockets\WorkerThreadableWebSocketChannel.h" /> 11314 11311 <ClInclude Include="..\Modules\speech\DOMWindowSpeechSynthesis.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r150053 r150142 589 589 <Filter>Modules\websockets</Filter> 590 590 </ClCompile> 591 <ClCompile Include="..\Modules\websockets\WebSocketHandshakeRequest.cpp">592 <Filter>Modules\websockets</Filter>593 </ClCompile>594 591 <ClCompile Include="..\Modules\websockets\WebSocketHandshakeResponse.cpp"> 595 592 <Filter>Modules\websockets</Filter> … … 7283 7280 </ClInclude> 7284 7281 <ClInclude Include="..\Modules\websockets\WebSocketHandshake.h"> 7285 <Filter>Modules\websockets</Filter>7286 </ClInclude>7287 <ClInclude Include="..\Modules\websockets\WebSocketHandshakeRequest.h">7288 7282 <Filter>Modules\websockets</Filter> 7289 7283 </ClInclude> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r150129 r150142 3198 3198 97AABD2614FA09D5007457AE /* WebSocketHandshake.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0B14FA09D5007457AE /* WebSocketHandshake.cpp */; }; 3199 3199 97AABD2714FA09D5007457AE /* WebSocketHandshake.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0C14FA09D5007457AE /* WebSocketHandshake.h */; }; 3200 97AABD2814FA09D5007457AE /* WebSocketHandshakeRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0D14FA09D5007457AE /* WebSocketHandshakeRequest.cpp */; };3201 97AABD2914FA09D5007457AE /* WebSocketHandshakeRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD0E14FA09D5007457AE /* WebSocketHandshakeRequest.h */; };3202 3200 97AABD2A14FA09D5007457AE /* WebSocketHandshakeResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABD0F14FA09D5007457AE /* WebSocketHandshakeResponse.cpp */; }; 3203 3201 97AABD2B14FA09D5007457AE /* WebSocketHandshakeResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AABD1014FA09D5007457AE /* WebSocketHandshakeResponse.h */; }; … … 9658 9656 97AABD0B14FA09D5007457AE /* WebSocketHandshake.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketHandshake.cpp; path = Modules/websockets/WebSocketHandshake.cpp; sourceTree = "<group>"; }; 9659 9657 97AABD0C14FA09D5007457AE /* WebSocketHandshake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketHandshake.h; path = Modules/websockets/WebSocketHandshake.h; sourceTree = "<group>"; }; 9660 97AABD0D14FA09D5007457AE /* WebSocketHandshakeRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketHandshakeRequest.cpp; path = Modules/websockets/WebSocketHandshakeRequest.cpp; sourceTree = "<group>"; };9661 97AABD0E14FA09D5007457AE /* WebSocketHandshakeRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketHandshakeRequest.h; path = Modules/websockets/WebSocketHandshakeRequest.h; sourceTree = "<group>"; };9662 9658 97AABD0F14FA09D5007457AE /* WebSocketHandshakeResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketHandshakeResponse.cpp; path = Modules/websockets/WebSocketHandshakeResponse.cpp; sourceTree = "<group>"; }; 9663 9659 97AABD1014FA09D5007457AE /* WebSocketHandshakeResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketHandshakeResponse.h; path = Modules/websockets/WebSocketHandshakeResponse.h; sourceTree = "<group>"; }; … … 16406 16402 97AABD0B14FA09D5007457AE /* WebSocketHandshake.cpp */, 16407 16403 97AABD0C14FA09D5007457AE /* WebSocketHandshake.h */, 16408 97AABD0D14FA09D5007457AE /* WebSocketHandshakeRequest.cpp */,16409 97AABD0E14FA09D5007457AE /* WebSocketHandshakeRequest.h */,16410 16404 97AABD0F14FA09D5007457AE /* WebSocketHandshakeResponse.cpp */, 16411 16405 97AABD1014FA09D5007457AE /* WebSocketHandshakeResponse.h */, … … 23997 23991 97AABD2514FA09D5007457AE /* WebSocketFrame.h in Headers */, 23998 23992 97AABD2714FA09D5007457AE /* WebSocketHandshake.h in Headers */, 23999 97AABD2914FA09D5007457AE /* WebSocketHandshakeRequest.h in Headers */,24000 23993 97AABD2B14FA09D5007457AE /* WebSocketHandshakeResponse.h in Headers */, 24001 23994 0F580FA31496939100FB5BD8 /* WebTiledBackingLayer.h in Headers */, … … 26983 26976 AAF5B7B71524B6C50004CB49 /* WebSocketFrame.cpp in Sources */, 26984 26977 97AABD2614FA09D5007457AE /* WebSocketHandshake.cpp in Sources */, 26985 97AABD2814FA09D5007457AE /* WebSocketHandshakeRequest.cpp in Sources */,26986 26978 97AABD2A14FA09D5007457AE /* WebSocketHandshakeResponse.cpp in Sources */, 26987 26979 0F580FA41496939100FB5BD8 /* WebTiledBackingLayer.mm in Sources */, -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r149125 r150142 1161 1161 } 1162 1162 1163 void InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const WebSocketHandshakeRequest& request, Document* document)1163 void InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const ResourceRequest& request, Document* document) 1164 1164 { 1165 1165 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r149980 r150142 45 45 #include "StorageArea.h" 46 46 #include "WebSocketFrame.h" 47 #include "WebSocketHandshakeRequest.h"48 47 #include "WebSocketHandshakeResponse.h" 49 48 #include <wtf/RefPtr.h> … … 271 270 #if ENABLE(WEB_SOCKETS) 272 271 static void didCreateWebSocket(Document*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL, const String& protocol); 273 static void willSendWebSocketHandshakeRequest(Document*, unsigned long identifier, const WebSocketHandshakeRequest&);272 static void willSendWebSocketHandshakeRequest(Document*, unsigned long identifier, const ResourceRequest&); 274 273 static void didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifier, const WebSocketHandshakeResponse&); 275 274 static void didCloseWebSocket(Document*, unsigned long identifier); … … 470 469 #if ENABLE(WEB_SOCKETS) 471 470 static void didCreateWebSocketImpl(InstrumentingAgents*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL, const String& protocol, Document*); 472 static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeRequest&, Document*);471 static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, unsigned long identifier, const ResourceRequest&, Document*); 473 472 static void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeResponse&, Document*); 474 473 static void didCloseWebSocketImpl(InstrumentingAgents*, unsigned long identifier, Document*); … … 1849 1848 } 1850 1849 1851 inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(Document* document, unsigned long identifier, const WebSocketHandshakeRequest& request)1850 inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(Document* document, unsigned long identifier, const ResourceRequest& request) 1852 1851 { 1853 1852 #if ENABLE(INSPECTOR) -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r149905 r150142 68 68 #include "SubresourceLoader.h" 69 69 #include "WebSocketFrame.h" 70 #include "WebSocketHandshakeRequest.h"71 70 #include "WebSocketHandshakeResponse.h" 72 71 #include "XMLHttpRequest.h" … … 488 487 } 489 488 490 void InspectorResourceAgent::willSendWebSocketHandshakeRequest(unsigned long identifier, const WebSocketHandshakeRequest& request)489 void InspectorResourceAgent::willSendWebSocketHandshakeRequest(unsigned long identifier, const ResourceRequest& request) 491 490 { 492 491 RefPtr<TypeBuilder::Network::WebSocketRequest> requestObject = TypeBuilder::Network::WebSocketRequest::create() 493 .setHeaders(buildObjectForHeaders(request.h eaderFields()));492 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); 494 493 m_frontend->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId(identifier), currentTime(), requestObject); 495 494 } -
trunk/Source/WebCore/inspector/InspectorResourceAgent.h
r148921 r150142 75 75 #if ENABLE(WEB_SOCKETS) 76 76 struct WebSocketFrame; 77 class WebSocketHandshakeRequest;78 77 class WebSocketHandshakeResponse; 79 78 #endif … … 128 127 #if ENABLE(WEB_SOCKETS) 129 128 void didCreateWebSocket(unsigned long identifier, const KURL& requestURL); 130 void willSendWebSocketHandshakeRequest(unsigned long identifier, const WebSocketHandshakeRequest&);129 void willSendWebSocketHandshakeRequest(unsigned long identifier, const ResourceRequest&); 131 130 void didReceiveWebSocketHandshakeResponse(unsigned long identifier, const WebSocketHandshakeResponse&); 132 131 void didCloseWebSocket(unsigned long identifier);
Note: See TracChangeset
for help on using the changeset viewer.