Title: [140962] trunk/Source/WebKit2
Revision
140962
Author
[email protected]
Date
2013-01-28 02:31:53 -0800 (Mon, 28 Jan 2013)

Log Message

[EFL][WK2] Use C API inside ewk_url_response
https://bugs.webkit.org/show_bug.cgi?id=107826

Reviewed by Andreas Kling.

* Shared/API/c/WKURLResponse.cpp:
(WKURLResponseGetExpectedContentsLength):
* Shared/API/c/WKURLResponse.h:

    Add new WK2 C API to get the expected contents length.

* UIProcess/API/efl/ewk_url_response.cpp:
(EwkUrlResponse::EwkUrlResponse):
(EwkUrlResponse::httpStatusCode):
(EwkUrlResponse::contentLength):
* UIProcess/API/efl/ewk_url_response_private.h:
(EwkUrlResponse::create):
(EwkUrlResponse):

    Change the methods to not call WebCore methods.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (140961 => 140962)


--- trunk/Source/WebKit2/ChangeLog	2013-01-28 10:27:46 UTC (rev 140961)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-28 10:31:53 UTC (rev 140962)
@@ -1,5 +1,28 @@
 2013-01-28  Kenneth Rohde Christiansen  <[email protected]>
 
+        [EFL][WK2] Use C API inside ewk_url_response
+        https://bugs.webkit.org/show_bug.cgi?id=107826
+
+        Reviewed by Andreas Kling.
+
+        * Shared/API/c/WKURLResponse.cpp:
+        (WKURLResponseGetExpectedContentsLength):
+        * Shared/API/c/WKURLResponse.h:
+
+            Add new WK2 C API to get the expected contents length.
+
+        * UIProcess/API/efl/ewk_url_response.cpp:
+        (EwkUrlResponse::EwkUrlResponse):
+        (EwkUrlResponse::httpStatusCode):
+        (EwkUrlResponse::contentLength):
+        * UIProcess/API/efl/ewk_url_response_private.h:
+        (EwkUrlResponse::create):
+        (EwkUrlResponse):
+
+            Change the methods to not call WebCore methods.
+
+2013-01-28  Kenneth Rohde Christiansen  <[email protected]>
+
         [WK2][EFL] Remove unneeded private methods
         https://bugs.webkit.org/show_bug.cgi?id=107693
 

Modified: trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp (140961 => 140962)


--- trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp	2013-01-28 10:27:46 UTC (rev 140961)
+++ trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp	2013-01-28 10:31:53 UTC (rev 140962)
@@ -61,3 +61,8 @@
 {
     return toImpl(responseRef)->resourceResponse().isAttachment();
 }
+
+uint32_t WKURLResponseGetExpectedContentLength(WKURLResponseRef responseRef)
+{
+    return toImpl(responseRef)->resourceResponse().expectedContentLength();
+}

Modified: trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h (140961 => 140962)


--- trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h	2013-01-28 10:27:46 UTC (rev 140961)
+++ trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h	2013-01-28 10:31:53 UTC (rev 140962)
@@ -44,6 +44,8 @@
 
 WK_EXPORT bool WKURLResponseIsAttachment(WKURLResponseRef);
 
+WK_EXPORT uint32_t WKURLResponseGetExpectedContentLength(WKURLResponseRef);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp (140961 => 140962)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp	2013-01-28 10:27:46 UTC (rev 140961)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp	2013-01-28 10:31:53 UTC (rev 140962)
@@ -31,15 +31,15 @@
 
 using namespace WebKit;
 
-EwkUrlResponse::EwkUrlResponse(const WebCore::ResourceResponse& coreResponse)
-    : m_coreResponse(coreResponse)
-    , m_url(AdoptWK, WKURLResponseCopyURL(WebKit::toAPI(coreResponse)))
-    , m_mimeType(AdoptWK, WKURLResponseCopyMIMEType(WebKit::toAPI(coreResponse)))
+EwkUrlResponse::EwkUrlResponse(WKURLResponseRef response)
+    : m_response(response)
+    , m_url(AdoptWK, WKURLResponseCopyURL(response))
+    , m_mimeType(AdoptWK, WKURLResponseCopyMIMEType(response))
 { }
 
 int EwkUrlResponse::httpStatusCode() const
 {
-    return m_coreResponse.httpStatusCode();
+    return WKURLResponseHTTPStatusCode(m_response.get());
 }
 
 const char* EwkUrlResponse::url() const
@@ -54,7 +54,7 @@
 
 unsigned long EwkUrlResponse::contentLength() const
 {
-    return m_coreResponse.expectedContentLength();
+    return WKURLResponseGetExpectedContentLength(m_response.get());
 }
 
 const char* ewk_url_response_url_get(const Ewk_Url_Response* response)

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h (140961 => 140962)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h	2013-01-28 10:27:46 UTC (rev 140961)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h	2013-01-28 10:31:53 UTC (rev 140962)
@@ -30,7 +30,6 @@
 #include "WKEinaSharedString.h"
 #include "WKURLResponse.h"
 #include "ewk_object_private.h"
-#include <WebCore/ResourceResponse.h>
 #include <wtf/PassRefPtr.h>
 
 /**
@@ -46,7 +45,7 @@
         if (!wkResponse)
             return 0;
 
-        return adoptRef(new EwkUrlResponse(WebKit::toImpl(wkResponse)->resourceResponse()));
+        return adoptRef(new EwkUrlResponse(wkResponse));
     }
 
     int httpStatusCode() const;
@@ -55,9 +54,9 @@
     unsigned long contentLength() const;
 
 private:
-    explicit EwkUrlResponse(const WebCore::ResourceResponse& coreResponse);
+    explicit EwkUrlResponse(WKURLResponseRef response);
 
-    WebCore::ResourceResponse m_coreResponse;
+    WKRetainPtr<WKURLResponseRef> m_response;
     WKEinaSharedString m_url;
     WKEinaSharedString m_mimeType;
 };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to