Commit f7f77664 authored by andersca@apple.com's avatar andersca@apple.com

Move HTTPRequest class to WebKit2

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

Reviewed by Darin Adler.

Source/WebCore:

HTTPRequest is only used by the "remote inspector" feature in WebKit2,
so there's no need to have it in WebCore.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

Move HTTPRequest to WebKit2 and put it in the WebKit namespace.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/InspectorServer/HTTPRequest.cpp: Renamed from Source/WebCore/platform/network/HTTPRequest.cpp.
* UIProcess/InspectorServer/HTTPRequest.h: Renamed from Source/WebCore/platform/network/HTTPRequest.h.
* UIProcess/InspectorServer/WebInspectorServer.cpp:
* UIProcess/InspectorServer/WebInspectorServer.h:
(WebInspectorServer):
* UIProcess/InspectorServer/WebSocketServerClient.h:
(WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest):
(WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest):
(WebKit::WebSocketServerClient::didEstablishWebSocketConnection):
* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
* UIProcess/InspectorServer/WebSocketServerConnection.h:
(WebKit):
(WebSocketServerConnection):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 90a10c58
......@@ -2041,7 +2041,6 @@ set(WebCore_SOURCES
platform/network/FormData.cpp
platform/network/HTTPHeaderMap.cpp
platform/network/HTTPParsers.cpp
platform/network/HTTPRequest.cpp
platform/network/MIMEHeader.cpp
platform/network/NetworkStateNotifier.cpp
platform/network/ParsedContentType.cpp
......
2013-05-15 Anders Carlsson <andersca@apple.com>
Move HTTPRequest class to WebKit2
https://bugs.webkit.org/show_bug.cgi?id=116192
Reviewed by Darin Adler.
HTTPRequest is only used by the "remote inspector" feature in WebKit2,
so there's no need to have it in WebCore.
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
2013-05-15 Oliver Hunt <oliver@apple.com>
RefCountedArray needs to use vector initialisers for its backing store
......
......@@ -5880,8 +5880,6 @@ webcore_platform_sources += \
Source/WebCore/platform/network/HTTPHeaderMap.h \
Source/WebCore/platform/network/HTTPParsers.cpp \
Source/WebCore/platform/network/HTTPParsers.h \
Source/WebCore/platform/network/HTTPRequest.cpp \
Source/WebCore/platform/network/HTTPRequest.h \
Source/WebCore/platform/network/MIMEHeader.cpp \
Source/WebCore/platform/network/MIMEHeader.h \
Source/WebCore/platform/network/NetworkingContext.h \
......
......@@ -1091,7 +1091,6 @@ SOURCES += \
platform/network/FormDataBuilder.cpp \
platform/network/HTTPHeaderMap.cpp \
platform/network/HTTPParsers.cpp \
platform/network/HTTPRequest.cpp \
platform/network/MIMEHeader.cpp \
platform/network/NetworkStateNotifier.cpp \
platform/network/NetworkStorageSessionStub.cpp \
......@@ -2328,7 +2327,6 @@ HEADERS += \
platform/network/FormData.h \
platform/network/HTTPHeaderMap.h \
platform/network/HTTPParsers.h \
platform/network/HTTPRequest.h \
platform/network/HTTPStatusCodes.h \
platform/network/MIMESniffing.h \
platform/network/NetworkStorageSession.h \
......
......@@ -32985,14 +32985,6 @@
RelativePath="..\platform\network\HTTPParsers.h"
>
</File>
<File
RelativePath="..\platform\network\HTTPRequest.cpp"
>
</File>
<File
RelativePath="..\platform\network\HTTPRequest.h"
>
</File>
<File
RelativePath="..\platform\network\MIMEHeader.cpp"
>
......@@ -4615,7 +4615,6 @@
<ClCompile Include="..\platform\network\FormDataBuilder.cpp" />
<ClCompile Include="..\platform\network\HTTPHeaderMap.cpp" />
<ClCompile Include="..\platform\network\HTTPParsers.cpp" />
<ClCompile Include="..\platform\network\HTTPRequest.cpp" />
<ClCompile Include="..\platform\network\MIMEHeader.cpp" />
<ClCompile Include="..\platform\network\NetworkStateNotifier.cpp" />
<ClCompile Include="..\platform\network\NetworkStorageSessionStub.cpp">
......@@ -1869,9 +1869,6 @@
<ClCompile Include="..\platform\network\HTTPParsers.cpp">
<Filter>platform\network</Filter>
</ClCompile>
<ClCompile Include="..\platform\network\HTTPRequest.cpp">
<Filter>platform\network</Filter>
</ClCompile>
<ClCompile Include="..\platform\network\MIMEHeader.cpp">
<Filter>platform\network</Filter>
</ClCompile>
......
......@@ -3404,8 +3404,6 @@
A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */; };
A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AFB34D115151A700B045CB /* StepRange.cpp */; };
A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
A5D214B112E905510090F370 /* HTTPRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5D214AE12E905510090F370 /* HTTPRequest.cpp */; };
A5D214B212E905510090F370 /* HTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A5D214AF12E905510090F370 /* HTTPRequest.h */; };
A6148A6212E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A6112E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h */; };
A6148A6712E41D940044A784 /* DOMHTMLKeygenElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A6512E41D940044A784 /* DOMHTMLKeygenElement.h */; };
A6148A6812E41D940044A784 /* DOMHTMLKeygenElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = A6148A6612E41D940044A784 /* DOMHTMLKeygenElement.mm */; };
......@@ -9892,8 +9890,6 @@
A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = "<group>"; };
A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEventCocoa.h; path = cocoa/KeyEventCocoa.h; sourceTree = "<group>"; };
A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KeyEventCocoa.mm; path = cocoa/KeyEventCocoa.mm; sourceTree = "<group>"; };
A5D214AE12E905510090F370 /* HTTPRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPRequest.cpp; sourceTree = "<group>"; };
A5D214AF12E905510090F370 /* HTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPRequest.h; sourceTree = "<group>"; };
A6148A6112E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLKeygenElementInternal.h; sourceTree = "<group>"; };
A6148A6512E41D940044A784 /* DOMHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLKeygenElement.h; sourceTree = "<group>"; };
A6148A6612E41D940044A784 /* DOMHTMLKeygenElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLKeygenElement.mm; sourceTree = "<group>"; };
......@@ -14540,8 +14536,6 @@
514C765C0CE923A1007EF3CD /* HTTPHeaderMap.h */,
514C765D0CE923A1007EF3CD /* HTTPParsers.cpp */,
514C765E0CE923A1007EF3CD /* HTTPParsers.h */,
A5D214AE12E905510090F370 /* HTTPRequest.cpp */,
A5D214AF12E905510090F370 /* HTTPRequest.h */,
37DDCD9213844FD50008B793 /* MIMEHeader.cpp */,
37DDCD9313844FD50008B793 /* MIMEHeader.h */,
628D214B12131ED10055DCFC /* NetworkingContext.h */,
......@@ -22118,7 +22112,6 @@
977B387A122883E900B81FF8 /* HTMLViewSourceParser.h in Headers */,
514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */,
514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */,
A5D214B212E905510090F370 /* HTTPRequest.h in Headers */,
375CD232119D43C800A2A859 /* Hyphenation.h in Headers */,
B275356E0B053814002CE64F /* Icon.h in Headers */,
97E4029013A696ED00913D67 /* IconController.h in Headers */,
......@@ -25301,7 +25294,6 @@
977B3879122883E900B81FF8 /* HTMLViewSourceParser.cpp in Sources */,
0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */,
A5D214B112E905510090F370 /* HTTPRequest.cpp in Sources */,
371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */,
375CD23B119D44EA00A2A859 /* HyphenationMac.mm in Sources */,
97E4028F13A696ED00913D67 /* IconController.cpp in Sources */,
......@@ -359,6 +359,7 @@ set(WebKit2_SOURCES
UIProcess/Downloads/DownloadProxy.cpp
UIProcess/Downloads/DownloadProxyMap.cpp
UIProcess/InspectorServer/HTTPRequest.cpp
UIProcess/InspectorServer/WebInspectorServer.cpp
UIProcess/InspectorServer/WebSocketServer.cpp
UIProcess/InspectorServer/WebSocketServerConnection.cpp
......
2013-05-15 Anders Carlsson <andersca@apple.com>
Move HTTPRequest class to WebKit2
https://bugs.webkit.org/show_bug.cgi?id=116192
Reviewed by Darin Adler.
Move HTTPRequest to WebKit2 and put it in the WebKit namespace.
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/InspectorServer/HTTPRequest.cpp: Renamed from Source/WebCore/platform/network/HTTPRequest.cpp.
* UIProcess/InspectorServer/HTTPRequest.h: Renamed from Source/WebCore/platform/network/HTTPRequest.h.
* UIProcess/InspectorServer/WebInspectorServer.cpp:
* UIProcess/InspectorServer/WebInspectorServer.h:
(WebInspectorServer):
* UIProcess/InspectorServer/WebSocketServerClient.h:
(WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest):
(WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest):
(WebKit::WebSocketServerClient::didEstablishWebSocketConnection):
* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
* UIProcess/InspectorServer/WebSocketServerConnection.h:
(WebKit):
(WebSocketServerConnection):
2013-05-15 Arnaud Renevier <a.renevier@sisa.samsung.com>
[GTK] [WebKit2] enable displaying console.log messages to system console
......
......@@ -979,6 +979,8 @@ webkit2_sources += \
Source/WebKit2/UIProcess/WebTextCheckerClient.h \
Source/WebKit2/UIProcess/WebUIClient.cpp \
Source/WebKit2/UIProcess/WebUIClient.h \
Source/WebKit2/UIProcess/InspectorServer/HTTPRequest.cpp \
Source/WebKit2/UIProcess/InspectorServer/HTTPRequest.h \
Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.cpp \
Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.h \
Source/WebKit2/UIProcess/InspectorServer/WebSocketServer.cpp \
......
......@@ -915,6 +915,7 @@ enable?(SECCOMP_FILTERS) {
enable?(INSPECTOR_SERVER) {
HEADERS += \
UIProcess/InspectorServer/HTTPRequest.h \
UIProcess/InspectorServer/WebInspectorServer.h \
UIProcess/InspectorServer/WebSocketServer.h \
UIProcess/InspectorServer/WebSocketServerClient.h \
......@@ -922,6 +923,7 @@ enable?(INSPECTOR_SERVER) {
UIProcess/InspectorServer/qt/WebSocketServerQt.h
SOURCES += \
UIProcess/InspectorServer/HTTPRequest.cpp \
UIProcess/InspectorServer/WebInspectorServer.cpp \
UIProcess/InspectorServer/WebSocketServer.cpp \
UIProcess/InspectorServer/WebSocketServerConnection.cpp \
......
......@@ -28,7 +28,9 @@
#include <wtf/text/CString.h>
namespace WebCore {
using namespace WebCore;
namespace WebKit {
PassRefPtr<HTTPRequest> HTTPRequest::parseHTTPRequestFromBuffer(const char* data, size_t length, String& failureReason)
{
......
......@@ -32,50 +32,50 @@
#ifndef HTTPRequest_h
#define HTTPRequest_h
#include "HTTPHeaderMap.h"
#include "HTTPParsers.h"
#include "KURL.h"
#include <WebCore/HTTPHeaderMap.h>
#include <WebCore/HTTPParsers.h>
#include <WebCore/KURL.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
namespace WebKit {
class HTTPRequest : public RefCounted<HTTPRequest> {
public:
static PassRefPtr<HTTPRequest> create() { return adoptRef(new HTTPRequest()); }
static PassRefPtr<HTTPRequest> create(const String& requestMethod, const KURL& url, HTTPVersion version) { return adoptRef(new HTTPRequest(requestMethod, url, version)); }
static PassRefPtr<HTTPRequest> create(const String& requestMethod, const WebCore::KURL& url, WebCore::HTTPVersion version) { return adoptRef(new HTTPRequest(requestMethod, url, version)); }
static PassRefPtr<HTTPRequest> parseHTTPRequestFromBuffer(const char* data, size_t length, String& failureReason);
virtual ~HTTPRequest();
String requestMethod() const { return m_requestMethod; }
void setRequestMethod(const String& method) { m_requestMethod = method; }
KURL url() const { return m_url; }
void setURL(const KURL& url) { m_url = url; }
WebCore::KURL url() const { return m_url; }
void setURL(const WebCore::KURL& url) { m_url = url; }
const Vector<unsigned char>& body() const { return m_body; }
const HTTPHeaderMap& headerFields() const { return m_headerFields; }
const WebCore::HTTPHeaderMap& headerFields() const { return m_headerFields; }
void addHeaderField(const AtomicString& name, const String& value) { m_headerFields.add(name, value); }
void addHeaderField(const char* name, const String& value) { m_headerFields.add(name, value); }
protected:
HTTPRequest();
HTTPRequest(const String& requestMethod, const KURL&, HTTPVersion);
HTTPRequest(const String& requestMethod, const WebCore::KURL&, WebCore::HTTPVersion);
// Parsing helpers.
size_t parseRequestLine(const char* data, size_t length, String& failureReason);
size_t parseHeaders(const char* data, size_t length, String& failureReason);
size_t parseRequestBody(const char* data, size_t length);
KURL m_url;
HTTPVersion m_httpVersion;
WebCore::KURL m_url;
WebCore::HTTPVersion m_httpVersion;
String m_requestMethod;
HTTPHeaderMap m_headerFields;
WebCore::HTTPHeaderMap m_headerFields;
Vector<unsigned char> m_body;
};
} // namespace WebCore
} // namespace WebKit
#endif // HTTPRequest_h
......@@ -30,9 +30,9 @@
#include "WebInspectorServer.h"
#include "HTTPRequest.h"
#include "WebInspectorProxy.h"
#include "WebSocketServerConnection.h"
#include <WebCore/HTTPRequest.h>
using namespace WebCore;
......
......@@ -54,9 +54,9 @@ private:
~WebInspectorServer();
// WebSocketServerClient implementation. Events coming from remote connections.
virtual void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, PassRefPtr<WebCore::HTTPRequest>);
virtual bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, PassRefPtr<WebCore::HTTPRequest>);
virtual void didEstablishWebSocketConnection(WebSocketServerConnection*, PassRefPtr<WebCore::HTTPRequest>);
virtual void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>);
virtual bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>);
virtual void didEstablishWebSocketConnection(WebSocketServerConnection*, PassRefPtr<HTTPRequest>);
virtual void didReceiveWebSocketMessage(WebSocketServerConnection*, const String& message);
virtual void didCloseWebSocketConnection(WebSocketServerConnection*);
......
......@@ -28,7 +28,7 @@
#if ENABLE(INSPECTOR_SERVER)
#include <WebCore/HTTPRequest.h>
#include "HTTPRequest.h"
#include <wtf/PassRefPtr.h>
#include <wtf/text/WTFString.h>
......@@ -41,13 +41,13 @@ public:
virtual ~WebSocketServerClient() { }
// Received an HTTP request but didn't know what to do with it.
virtual void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, PassRefPtr<WebCore::HTTPRequest>) { }
virtual void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) { }
// Received a WebSocket Upgrade HTTP request. Ask if we should handle it and upgrade.
virtual bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, PassRefPtr<WebCore::HTTPRequest>) { return true; }
virtual bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) { return true; }
// Established a WebSocket Connection.
virtual void didEstablishWebSocketConnection(WebSocketServerConnection*, PassRefPtr<WebCore::HTTPRequest>) { }
virtual void didEstablishWebSocketConnection(WebSocketServerConnection*, PassRefPtr<HTTPRequest>) { }
// Received a WebSocket message.
virtual void didReceiveWebSocketMessage(WebSocketServerConnection*, const String&) { }
......
......@@ -30,9 +30,9 @@
#include "WebSocketServerConnection.h"
#include "HTTPRequest.h"
#include "WebSocketServer.h"
#include "WebSocketServerClient.h"
#include <WebCore/HTTPRequest.h>
#include <WebCore/NotImplemented.h>
#include <WebCore/SocketStreamError.h>
#include <WebCore/SocketStreamHandle.h>
......
......@@ -37,12 +37,12 @@
namespace WebCore {
class HTTPHeaderMap;
class HTTPRequest;
class SocketStreamHandle;
}
namespace WebKit {
class HTTPRequest;
class WebSocketServer;
class WebSocketServerClient;
......@@ -76,7 +76,7 @@ private:
void readHTTPMessage();
// WebSocket Mode.
void upgradeToWebSocketServerConnection(PassRefPtr<WebCore::HTTPRequest>);
void upgradeToWebSocketServerConnection(PassRefPtr<HTTPRequest>);
void readWebSocketFrames();
bool readWebSocketFrame();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment