Add URLResponse API for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=45062
Reviewed by Anders Carlsson.
Add WebURLResponse class and WKURLResponseRef C API to go with it. Right now,
instance of WKURLResponseRef are manipulated via platform types just like
WKURLRequestRef.
This just adds the type and conversion functions, no uses yet.
* Shared/APIObject.h:
* Shared/WebCoreArgumentCoders.h:
* Shared/WebURLResponse.cpp: Added.
(WebKit::WebURLResponse::WebURLResponse):
* Shared/WebURLResponse.h: Added.
(WebKit::WebURLResponse::create):
(WebKit::WebURLResponse::resourceResponse):
(WebKit::WebURLResponse::type):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(CoreIPC::encodeWithNSKeyedArchiver):
(CoreIPC::decodeWithNSKeyedArchiver):
(CoreIPC::encodeResourceRequest):
(CoreIPC::decodeResourceRequest):
* Shared/mac/WebURLResponseMac.mm: Added.
(WebKit::WebURLResponse::WebURLResponse):
(WebKit::WebURLResponse::platformResponse):
* Shared/qt/WebURLResponseQt.cpp: Added.
(WebKit::WebURLResponse::WebURLResponse):
(WebKit::WebURLResponse::platformResponse):
* Shared/win/WebURLResponseWin.cpp: Added.
(WebKit::WebURLResponse::WebURLResponse):
(WebKit::WebURLResponse::platformResponse):
* UIProcess/API/C/WKURLResponse.cpp: Added.
(WKURLResponseGetTypeID):
* UIProcess/API/C/WKURLResponse.h: Added.
* UIProcess/API/C/cf/WKURLResponseCF.cpp: Added.
(WKURLResponseCreateWithCFURLResponse):
(WKURLResponseCopyCFURLResponse):
* UIProcess/API/C/cf/WKURLResponseCF.h: Added.
* UIProcess/API/C/mac/WKURLResponseNS.h: Added.
* UIProcess/API/C/mac/WKURLResponseNS.mm: Added.
(WKURLResponseCreateWithNSURLResponse):
(WKURLResponseCopyNSURLResponse):
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:
* win/WebKit2Generated.make:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/UIProcess/API/C/WKURLResponse.cpp b/WebKit2/UIProcess/API/C/WKURLResponse.cpp
new file mode 100644
index 0000000..285c127
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKURLResponse.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WKURLResponse.h"
+
+#include "WKAPICast.h"
+#include "WebURLResponse.h"
+
+using namespace WebKit;
+
+WKTypeID WKURLResponseGetTypeID()
+{
+ return toRef(WebURLResponse::APIType);
+}
+