Title: [104168] trunk/Source/WebKit2
Revision
104168
Author
[email protected]
Date
2012-01-05 09:02:21 -0800 (Thu, 05 Jan 2012)

Log Message

Pass WebFrame instead of WebCore::Frame to the WebKit2 specific FrameNetworkingContext
https://bugs.webkit.org/show_bug.cgi?id=75550

Make the WebKit2 FrameNetworkingContext implementation store the
WebFrame instead of the WebCore::Frame as this is needed for the Qt
port to implement a.o. HTTP autentication and SSL support.

As the WebFrameNetworkingContext is partly shared across all WebKit2 ports,
all port specific files have been modified.

For the Qt implementation of FrameNetworkingContext, we also set a
property to the originatingObject for the page ID. We also switch to
using an OwnPtr instead of a raw C++ pointer for the
m_originatingObject member.

Based on original patch by Peter Hartmann.

Patch by Alexander Færøy <[email protected]> on 2012-01-05
Reviewed by Kenneth Rohde Christiansen.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createNetworkingContext):
* WebProcess/WebCoreSupport/efl/WebFrameNetworkingContext.h:
(WebFrameNetworkingContext::create):
(WebFrameNetworkingContext::WebFrameNetworkingContext):
* WebProcess/WebCoreSupport/gtk/WebFrameNetworkingContext.h:
(WebFrameNetworkingContext::create):
(WebFrameNetworkingContext::WebFrameNetworkingContext):
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
(WebKit::WebFrameNetworkingContext::create):
(WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
* WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp:
(WebCore::WebFrameNetworkingContext::WebFrameNetworkingContext):
(WebCore::WebFrameNetworkingContext::~WebFrameNetworkingContext):
(WebCore::WebFrameNetworkingContext::create):
* WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h:
(WebFrameNetworkingContext::create):
(WebFrameNetworkingContext::WebFrameNetworkingContext):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (104167 => 104168)


--- trunk/Source/WebKit2/ChangeLog	2012-01-05 16:45:48 UTC (rev 104167)
+++ trunk/Source/WebKit2/ChangeLog	2012-01-05 17:02:21 UTC (rev 104168)
@@ -1,3 +1,44 @@
+2012-01-05  Alexander Færøy  <[email protected]>
+
+        Pass WebFrame instead of WebCore::Frame to the WebKit2 specific FrameNetworkingContext
+        https://bugs.webkit.org/show_bug.cgi?id=75550
+
+        Make the WebKit2 FrameNetworkingContext implementation store the
+        WebFrame instead of the WebCore::Frame as this is needed for the Qt
+        port to implement a.o. HTTP autentication and SSL support.
+
+        As the WebFrameNetworkingContext is partly shared across all WebKit2 ports,
+        all port specific files have been modified.
+
+        For the Qt implementation of FrameNetworkingContext, we also set a
+        property to the originatingObject for the page ID. We also switch to
+        using an OwnPtr instead of a raw C++ pointer for the
+        m_originatingObject member.
+
+        Based on original patch by Peter Hartmann.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createNetworkingContext):
+        * WebProcess/WebCoreSupport/efl/WebFrameNetworkingContext.h:
+        (WebFrameNetworkingContext::create):
+        (WebFrameNetworkingContext::WebFrameNetworkingContext):
+        * WebProcess/WebCoreSupport/gtk/WebFrameNetworkingContext.h:
+        (WebFrameNetworkingContext::create):
+        (WebFrameNetworkingContext::WebFrameNetworkingContext):
+        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
+        (WebKit::WebFrameNetworkingContext::create):
+        (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
+        * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp:
+        (WebCore::WebFrameNetworkingContext::WebFrameNetworkingContext):
+        (WebCore::WebFrameNetworkingContext::~WebFrameNetworkingContext):
+        (WebCore::WebFrameNetworkingContext::create):
+        * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h:
+        * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h:
+        (WebFrameNetworkingContext::create):
+        (WebFrameNetworkingContext::WebFrameNetworkingContext):
+
 2012-01-05  Kenneth Rohde Christiansen  <[email protected]>
 
         [Qt] Implement QQuickWebView::inputMethodQuery

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (104167 => 104168)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2012-01-05 16:45:48 UTC (rev 104167)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2012-01-05 17:02:21 UTC (rev 104168)
@@ -1438,7 +1438,7 @@
 
 PassRefPtr<FrameNetworkingContext> WebFrameLoaderClient::createNetworkingContext()
 {
-    return WebFrameNetworkingContext::create(m_frame->coreFrame());
+    return WebFrameNetworkingContext::create(m_frame);
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebFrameNetworkingContext.h (104167 => 104168)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebFrameNetworkingContext.h	2012-01-05 16:45:48 UTC (rev 104167)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebFrameNetworkingContext.h	2012-01-05 17:02:21 UTC (rev 104168)
@@ -26,18 +26,20 @@
 #ifndef WebFrameNetworkingContext_h
 #define WebFrameNetworkingContext_h
 
+#include "WebFrame.h"
+
 #include <WebCore/FrameNetworkingContext.h>
 
 class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext {
 public:
-    static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame*)
+    static PassRefPtr<WebFrameNetworkingContext> create(WebKit::WebFrame*)
     {
         return 0;
     }
 
 private:
-    WebFrameNetworkingContext(WebCore::Frame* frame)
-        : WebCore::FrameNetworkingContext(frame)
+    WebFrameNetworkingContext(WebKit::WebFrame* frame)
+        : WebCore::FrameNetworkingContext(frame->coreFrame())
     {
     }
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebFrameNetworkingContext.h (104167 => 104168)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebFrameNetworkingContext.h	2012-01-05 16:45:48 UTC (rev 104167)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebFrameNetworkingContext.h	2012-01-05 17:02:21 UTC (rev 104168)
@@ -27,18 +27,20 @@
 #ifndef WebFrameNetworkingContext_h
 #define WebFrameNetworkingContext_h
 
+#include "WebFrame.h"
+
 #include <WebCore/FrameNetworkingContext.h>
 
 class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext {
 public:
-    static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame*)
+    static PassRefPtr<WebFrameNetworkingContext> create(WebKit::WebFrame*)
     {
         return 0;
     }
 
 private:
-    WebFrameNetworkingContext(WebCore::Frame* frame)
-        : WebCore::FrameNetworkingContext(frame)
+    WebFrameNetworkingContext(WebKit::WebFrame* frame)
+        : WebCore::FrameNetworkingContext(frame->coreFrame())
     {
     }
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h (104167 => 104168)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h	2012-01-05 16:45:48 UTC (rev 104167)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h	2012-01-05 17:02:21 UTC (rev 104168)
@@ -20,20 +20,22 @@
 #ifndef WebFrameNetworkingContext_h
 #define WebFrameNetworkingContext_h
 
+#include "WebFrame.h"
+
 #import <WebCore/FrameNetworkingContext.h>
 
 namespace WebKit {
 
 class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext {
 public:
-    static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame* frame)
+    static PassRefPtr<WebFrameNetworkingContext> create(WebFrame* frame)
     {
         return adoptRef(new WebFrameNetworkingContext(frame));
     }
 
 private:
-    WebFrameNetworkingContext(WebCore::Frame* frame)
-        : WebCore::FrameNetworkingContext(frame)
+    WebFrameNetworkingContext(WebFrame* frame)
+        : WebCore::FrameNetworkingContext(frame->coreFrame())
     {
     }
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp (104167 => 104168)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp	2012-01-05 16:45:48 UTC (rev 104167)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp	2012-01-05 17:02:21 UTC (rev 104168)
@@ -20,27 +20,35 @@
 #include "config.h"
 #include "WebFrameNetworkingContext.h"
 
+#include "WebFrame.h"
+#include "WebPage.h"
 #include "WebProcess.h"
 #include <QNetworkAccessManager>
 #include <QObject>
 
 namespace WebCore {
 
-WebFrameNetworkingContext::WebFrameNetworkingContext(Frame* frame)
-    : FrameNetworkingContext(frame)
-    , m_originatingObject(0)
+WebFrameNetworkingContext::WebFrameNetworkingContext(WebKit::WebFrame* frame)
+    : FrameNetworkingContext(frame->coreFrame())
+    , m_originatingObject(adoptPtr(new QObject))
     , m_mimeSniffingEnabled(true)
 {
+    // The page ID is needed later for HTTP authentication and SSL errors.
+    m_originatingObject->setProperty("pageID", qulonglong(frame->page()->pageID()));
 }
 
-PassRefPtr<WebFrameNetworkingContext> WebFrameNetworkingContext::create(Frame* frame)
+WebFrameNetworkingContext::~WebFrameNetworkingContext()
 {
+}
+
+PassRefPtr<WebFrameNetworkingContext> WebFrameNetworkingContext::create(WebKit::WebFrame* frame)
+{
     return adoptRef(new WebFrameNetworkingContext(frame));
 }
 
 QObject* WebFrameNetworkingContext::originatingObject() const
 {
-    return m_originatingObject;
+    return m_originatingObject.get();
 }
 
 QNetworkAccessManager* WebFrameNetworkingContext::networkAccessManager() const

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h (104167 => 104168)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h	2012-01-05 16:45:48 UTC (rev 104167)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h	2012-01-05 17:02:21 UTC (rev 104168)
@@ -22,21 +22,28 @@
 
 #include <WebCore/FrameNetworkingContext.h>
 
+#include <wtf/OwnPtr.h>
+
+namespace WebKit {
+class WebFrame;
+}
+
 namespace WebCore {
 
 class WebFrameNetworkingContext : public FrameNetworkingContext {
 public:
-    static PassRefPtr<WebFrameNetworkingContext> create(Frame*);
+    static PassRefPtr<WebFrameNetworkingContext> create(WebKit::WebFrame*);
 
 private:
-    WebFrameNetworkingContext(Frame*);
+    WebFrameNetworkingContext(WebKit::WebFrame*);
+    virtual ~WebFrameNetworkingContext();
 
     virtual QObject* originatingObject() const;
     virtual QNetworkAccessManager* networkAccessManager() const;
     virtual bool mimeSniffingEnabled() const;
     virtual bool thirdPartyCookiePolicyPermission(const QUrl&) const;
 
-    QObject* m_originatingObject;
+    OwnPtr<QObject> m_originatingObject;
     bool m_mimeSniffingEnabled;
 };
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h (104167 => 104168)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h	2012-01-05 16:45:48 UTC (rev 104167)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h	2012-01-05 17:02:21 UTC (rev 104168)
@@ -20,20 +20,22 @@
 #ifndef WebFrameNetworkingContext_h
 #define WebFrameNetworkingContext_h
 
+#include "WebFrame.h"
+
 #include <WebCore/FrameNetworkingContext.h>
 #include <WebCore/ResourceError.h>
 #include <WebCore/ResourceRequest.h>
 
 class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext {
 public:
-    static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame* frame)
+    static PassRefPtr<WebFrameNetworkingContext> create(WebKit::WebFrame* frame)
     {
         return adoptRef(new WebFrameNetworkingContext(frame));
     }
 
 private:
-    WebFrameNetworkingContext(WebCore::Frame* frame)
-        : WebCore::FrameNetworkingContext(frame)
+    WebFrameNetworkingContext(WebKit::WebFrame* frame)
+        : WebCore::FrameNetworkingContext(frame->coreFrame())
     {
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to