+2010-12-21 Sam Weinig <weinig@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Implement encoding/decoding of ResourceRequest and
+ ResourceResponse for Windows/CFNetwork.
+
+ * Shared/win/WebCoreArgumentCodersWin.cpp:
+ (CoreIPC::encodeResourceRequest):
+ (CoreIPC::decodeResourceRequest):
+ (CoreIPC::encodeResourceResponse):
+ (CoreIPC::decodeResourceResponse):
+ * win/WebKit2.vcproj:
+ * win/WebKit2Common.vsprops:
+
2010-12-21 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
#include "WebCoreArgumentCoders.h"
-#include "NotImplemented.h"
+#if USE(CFNETWORK)
+#include "ArgumentCodersCF.h"
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
+#endif
namespace CoreIPC {
+// FIXME: These coders should really go in a WebCoreArgumentCodersCFNetwork file.
+
void encodeResourceRequest(ArgumentEncoder* encoder, const WebCore::ResourceRequest& resourceRequest)
{
- notImplemented();
+#if USE(CFNETWORK)
+ RetainPtr<CFDictionaryRef> dictionary(AdoptCF, wkCFURLRequestCreateSerializableRepresentation(resourceRequest.cfURLRequest(), CoreIPC::tokenNullTypeRef()));
+ encode(encoder, dictionary.get());
+#endif
}
bool decodeResourceRequest(ArgumentDecoder* decoder, WebCore::ResourceRequest& resourceRequest)
{
- notImplemented();
+#if USE(CFNETWORK)
+ RetainPtr<CFDictionaryRef> dictionary;
+ if (!decode(decoder, dictionary))
+ return false;
+
+ CFURLRequestRef cfURLRequest = wkCFURLRequestCreateFromSerializableRepresentation(dictionary.get(), CoreIPC::tokenNullTypeRef());
+ if (!cfURLRequest)
+ return false;
+
+ resourceRequest = WebCore::ResourceRequest(cfURLRequest);
+ return true;
+#else
return false;
+#endif
}
void encodeResourceResponse(ArgumentEncoder* encoder, const WebCore::ResourceResponse& resourceResponse)
{
- notImplemented();
+#if USE(CFNETWORK)
+ bool responseIsPresent = resourceResponse.cfURLResponse();
+ encoder->encode(responseIsPresent);
+
+ if (!responseIsPresent)
+ return;
+
+ RetainPtr<CFDictionaryRef> dictionary(AdoptCF, wkCFURLResponseCreateSerializableRepresentation(resourceResponse.cfURLResponse(), CoreIPC::tokenNullTypeRef()));
+ encode(encoder, dictionary.get());
+#endif
}
bool decodeResourceResponse(ArgumentDecoder* decoder, WebCore::ResourceResponse& resourceResponse)
{
- notImplemented();
+#if USE(CFNETWORK)
+ bool responseIsPresent;
+ decoder->decode(responseIsPresent);
+
+ if (!responseIsPresent) {
+ resourceResponse = WebCore::ResourceResponse();
+ return true;
+ }
+
+ RetainPtr<CFDictionaryRef> dictionary;
+ if (!decode(decoder, dictionary))
+ return false;
+
+ CFURLResponseRef cfURLResponse = wkCFURLResponseCreateFromSerializableRepresentation(dictionary.get(), CoreIPC::tokenNullTypeRef());
+ if (!cfURLResponse)
+ return false;
+
+ resourceResponse = WebCore::ResourceResponse(cfURLResponse);
+ return true;
+#else
return false;
+#endif
}
} // namespace CoreIPC
>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(ProjectDir)\..\Platform";"$(ProjectDir)\..\Platform\CoreIPC";"$(ProjectDir)\..\PluginProcess";"$(ProjectDir)\..\Shared";"$(ProjectDir)\..\Shared\win";"$(ProjectDir)\..\Shared\API\c";"$(ProjectDir)\..\Shared\API\c\cf";"$(ProjectDir)\..\Shared\API\c\win";"$(ProjectDir)\..\Shared\CoreIPCSupport";"$(ProjectDir)\..\Shared\Plugins";"$(ProjectDir)\..\Shared\Plugins\Netscape";"$(ProjectDir)\..\UIProcess";"$(ProjectDir)\..\UIProcess\API\C";"$(ProjectDir)\..\UIProcess\API\C\win";"$(ProjectDir)\..\UIProcess\API\cpp";"$(ProjectDir)\..\UIProcess\API\win";"$(ProjectDir)\..\UIProcess\Authentication";"$(ProjectDir)\..\UIProcess\Downloads";"$(ProjectDir)\..\UIProcess\Launcher";"$(ProjectDir)\..\UIProcess\Plugins";"$(ProjectDir)\..\UIProcess\win";"$(ProjectDir)\..\WebProcess";"$(ProjectDir)\..\WebProcess\WebCoreSupport";"$(ProjectDir)\..\WebProcess\WebCoreSupport\win";"$(ProjectDir)\..\WebProcess\WebPage";"$(ProjectDir)\..\WebProcess\WebPage\win";"$(ProjectDir)\..\WebProcess\InjectedBundle";"$(ProjectDir)\..\WebProcess\InjectedBundle\API\c";"$(ProjectDir)\..\WebProcess\InjectedBundle\DOM";"$(ProjectDir)\..\WebProcess\InjectedBundle\win";"$(ProjectDir)\..\WebProcess\Plugins";"$(ProjectDir)\..\WebProcess\Plugins\Netscape";"$(ProjectDir)\..\WebProcess\win";"$(ProjectDir)\..\WebProcess\Authentication";"$(ProjectDir)\..\WebProcess\Downloads";"$(ProjectDir)\..\WebProcess\Downloads\cf";"$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\private";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\Include\private";"$(WebKitLibrariesDir)\Include\pthreads";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\private\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\private\JavaScriptCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders""
+ AdditionalIncludeDirectories=""$(ProjectDir)\..\Platform";"$(ProjectDir)\..\Platform\CoreIPC";"$(ProjectDir)\..\PluginProcess";"$(ProjectDir)\..\Shared";"$(ProjectDir)\..\Shared\win";"$(ProjectDir)\..\Shared\cf";"$(ProjectDir)\..\Shared\API\c";"$(ProjectDir)\..\Shared\API\c\cf";"$(ProjectDir)\..\Shared\API\c\win";"$(ProjectDir)\..\Shared\CoreIPCSupport";"$(ProjectDir)\..\Shared\Plugins";"$(ProjectDir)\..\Shared\Plugins\Netscape";"$(ProjectDir)\..\UIProcess";"$(ProjectDir)\..\UIProcess\API\C";"$(ProjectDir)\..\UIProcess\API\C\win";"$(ProjectDir)\..\UIProcess\API\cpp";"$(ProjectDir)\..\UIProcess\API\win";"$(ProjectDir)\..\UIProcess\Authentication";"$(ProjectDir)\..\UIProcess\Downloads";"$(ProjectDir)\..\UIProcess\Launcher";"$(ProjectDir)\..\UIProcess\Plugins";"$(ProjectDir)\..\UIProcess\win";"$(ProjectDir)\..\WebProcess";"$(ProjectDir)\..\WebProcess\WebCoreSupport";"$(ProjectDir)\..\WebProcess\WebCoreSupport\win";"$(ProjectDir)\..\WebProcess\WebPage";"$(ProjectDir)\..\WebProcess\WebPage\win";"$(ProjectDir)\..\WebProcess\InjectedBundle";"$(ProjectDir)\..\WebProcess\InjectedBundle\API\c";"$(ProjectDir)\..\WebProcess\InjectedBundle\DOM";"$(ProjectDir)\..\WebProcess\InjectedBundle\win";"$(ProjectDir)\..\WebProcess\Plugins";"$(ProjectDir)\..\WebProcess\Plugins\Netscape";"$(ProjectDir)\..\WebProcess\win";"$(ProjectDir)\..\WebProcess\Authentication";"$(ProjectDir)\..\WebProcess\Downloads";"$(ProjectDir)\..\WebProcess\Downloads\cf";"$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\private";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\Include\private";"$(WebKitLibrariesDir)\Include\pthreads";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\private\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\private\JavaScriptCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders""
PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="WebKit2Prefix.h"