Changeset 66794 in webkit


Ignore:
Timestamp:
Sep 4, 2010 7:48:30 AM (14 years ago)
Author:
diegohcg@webkit.org
Message:

Add NetworkingContext to avoid layer violations
https://bugs.webkit.org/show_bug.cgi?id=42292

Patch by Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> on 2010-09-03
Reviewed by Darin Adler.

WebCore:

Create and provide access to NetworkingContext in FrameLoader.

In the WebKit layer we added specific implementations of FrameNetworkingContext
so each port's FrameLoaderClient can add any port specific information to NetworkingContext
The NetworkingContext is, therefore, created by a FrameLoaderClient and stored
in the FrameLoader for each frame created. People must always use it
by calling FrameLoader::networkingContext() and never through their FrameLoaderClient.
The lifetime cycle of NetworkingContext is kept by a RefPtr, so the object is RefCounted.

It is still a preparation to NetworkingContext to be activated and
work for all ports.

  • WebCore.exp.in:
  • loader/EmptyClients.h:

(WebCore::EmptyFrameLoaderClient::createNetworkingContext):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::~FrameLoader):
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::networkingContext):

  • loader/FrameLoader.h:
  • loader/FrameLoaderClient.h:

WebKit/chromium:

Add Chromium's implementation of NetworkingContext.

  • src/FrameLoaderClientImpl.cpp:

(WebKit::FrameLoaderClientImpl::createNetworkingContext):

  • src/FrameLoaderClientImpl.h:

WebKit/efl:

Add createNetworkingContext to EFL's FrameLoaderClient.

  • WebCoreSupport/FrameLoaderClientEfl.cpp:

(WebCore::FrameLoaderClientEfl::createNetworkingContext):

  • WebCoreSupport/FrameLoaderClientEfl.h:

WebKit/gtk:

Add GTK's specific implementation of FrameNetworkingContext.

  • WebCoreSupport/FrameLoaderClientGtk.cpp:

(WebKit::FrameLoaderClient::createNetworkingContext):

  • WebCoreSupport/FrameLoaderClientGtk.h:

WebKit/mac:

Add Mac's specific implementation of FrameNetworkingContext.

  • WebCoreSupport/WebFrameLoaderClient.h:
  • WebCoreSupport/WebFrameLoaderClient.mm:
  • WebCoreSupport/WebFrameNetworkingContext.mm:

(WebFrameNetworkingContext::needsSiteSpecificQuirks):
(WebFrameNetworkingContext::localFileContentSniffingEnabled):
(WebFrameNetworkingContext::scheduledRunLoopPairs):
(WebFrameNetworkingContext::blockedError):

WebKit/qt:

Add Qt's specific implementation of NetworkingContext.

  • WebCoreSupport/FrameLoaderClientQt.cpp:

(WebCore::FrameLoaderClientQt::setFrame):
(WebCore::FrameLoaderClientQt::createNetworkingContext):

  • WebCoreSupport/FrameLoaderClientQt.h:
  • WebCoreSupport/FrameNetworkingContextQt.cpp:

(WebCore::FrameNetworkingContextQt::FrameNetworkingContextQt):
(WebCore::FrameNetworkingContextQt::create):
(WebCore::FrameNetworkingContextQt::originatingObject):
(WebCore::FrameNetworkingContextQt::networkAccessManager):

WebKit/win:

Add Win's specific implementation of NetworkingContext.

  • WebCoreSupport/WebFrameNetworkingContext.cpp:

(WebFrameNetworkingContext::create):
(WebFrameNetworkingContext::userAgent):
(WebFrameNetworkingContext::referrer):

  • WebFrame.cpp:

(WebFrame::createNetworkingContext):

  • WebFrame.h:

WebKit2:

Add FrameNetworkingContext implementation.

  • WebKit2.pro:
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::createNetworkingContext):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
  • WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:

(WebKit::WebFrameNetworkingContext::needsSiteSpecificQuirks):
(WebKit::WebFrameNetworkingContext::localFileContentSniffingEnabled):
(WebKit::WebFrameNetworkingContext::scheduledRunLoopPairs):
(WebKit::WebFrameNetworkingContext::blockedError):

  • WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp: Added.

(WebCore::WebFrameNetworkingContext::WebFrameNetworkingContext):
(WebCore::WebFrameNetworkingContext::create):
(WebCore::WebFrameNetworkingContext::originatingObject):
(WebCore::WebFrameNetworkingContext::networkAccessManager):

  • WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h: Added.
  • WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
  • WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.

(WebFrameNetworkingContext::create):
(WebFrameNetworkingContext::WebFrameNetworkingContext):

  • win/WebKit2.vcproj:
  • win/WebKit2Common.vsprops:
Location:
trunk
Files:
1 added
34 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66791 r66794  
     12010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add NetworkingContext to avoid layer violations
     6        https://bugs.webkit.org/show_bug.cgi?id=42292
     7
     8        Create and provide access to NetworkingContext in FrameLoader.
     9
     10        In the WebKit layer we added specific implementations of FrameNetworkingContext
     11        so each port's FrameLoaderClient can add any port specific information to NetworkingContext
     12        The NetworkingContext is, therefore, created by a FrameLoaderClient and stored
     13        in the FrameLoader for each frame created. People must always use it
     14        by calling FrameLoader::networkingContext() and never through their FrameLoaderClient.
     15        The lifetime cycle of NetworkingContext is kept by a RefPtr, so the object is RefCounted.
     16
     17        It is still a preparation to NetworkingContext to be activated and
     18        work for all ports.
     19
     20        * WebCore.exp.in:
     21        * loader/EmptyClients.h:
     22        (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
     23        * loader/FrameLoader.cpp:
     24        (WebCore::FrameLoader::~FrameLoader):
     25        (WebCore::FrameLoader::init):
     26        (WebCore::FrameLoader::networkingContext):
     27        * loader/FrameLoader.h:
     28        * loader/FrameLoaderClient.h:
     29
    1302010-09-03  Kinuko Yasuda  <kinuko@chromium.org>
    231
  • trunk/WebCore/WebCore.exp.in

    r66721 r66794  
    857857__ZNK7WebCore11CachedImage5imageEv
    858858__ZNK7WebCore11FrameLoader10isCompleteEv
     859__ZNK7WebCore11FrameLoader12blockedErrorERKNS_15ResourceRequestE
    859860__ZNK7WebCore11FrameLoader14cancelledErrorERKNS_15ResourceRequestE
    860861__ZNK7WebCore11FrameLoader14frameHasLoadedEv
  • trunk/WebCore/loader/EmptyClients.h

    r66746 r66794  
    4141#include "FocusDirection.h"
    4242#include "FrameLoaderClient.h"
     43#include "FrameNetworkingContext.h"
    4344#include "InspectorClient.h"
    4445#include "PluginHalterClient.h"
     
    367368#endif
    368369
     370    virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext() { return PassRefPtr<FrameNetworkingContext>(); }
    369371};
    370372
  • trunk/WebCore/loader/FrameLoader.cpp

    r66710 r66794  
    5959#include "FrameLoadRequest.h"
    6060#include "FrameLoaderClient.h"
     61#include "FrameNetworkingContext.h"
    6162#include "FrameTree.h"
    6263#include "FrameView.h"
     
    217218       
    218219    m_client->frameLoaderDestroyed();
     220
     221    if (m_networkingContext)
     222        m_networkingContext->invalidate();
    219223}
    220224
     
    237241    m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocument);
    238242    m_didCallImplicitClose = true;
     243
     244    m_networkingContext = m_client->createNetworkingContext();
    239245}
    240246
     
    34483454}
    34493455
     3456NetworkingContext* FrameLoader::networkingContext() const
     3457{
     3458    return m_networkingContext.get();
     3459}
     3460
    34503461bool FrameLoaderClient::hasHTMLView() const
    34513462{
  • trunk/WebCore/loader/FrameLoader.h

    r66677 r66794  
    6363class Frame;
    6464class FrameLoaderClient;
     65class FrameNetworkingContext;
    6566class HistoryItem;
    6667class HTMLFormElement;
    6768class IconLoader;
    6869class NavigationAction;
     70class NetworkingContext;
    6971class ProtectionSpace;
    7072class ResourceError;
     
    332334    bool pageDismissalEventBeingDispatched() const { return m_pageDismissalEventBeingDispatched; }
    333335
     336    inline NetworkingContext* networkingContext() const;
     337
    334338private:
    335339    bool canCachePageContainingThisFrame();
     
    498502    bool m_didDispatchDidCommitLoad;
    499503#endif
     504
     505    RefPtr<FrameNetworkingContext> m_networkingContext;
    500506};
    501507
  • trunk/WebCore/loader/FrameLoaderClient.h

    r65021 r66794  
    5353    class Frame;
    5454    class FrameLoader;
     55    class FrameNetworkingContext;
    5556    class HistoryItem;
    5657    class HTMLAppletElement;
     
    283284        // This callback is similar, but for plugins.
    284285        virtual void didNotAllowPlugins() { }
     286
     287        virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext() = 0;
    285288    };
    286289
  • trunk/WebKit/chromium/ChangeLog

    r66777 r66794  
     12010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add NetworkingContext to avoid layer violations
     6        https://bugs.webkit.org/show_bug.cgi?id=42292
     7
     8        Add Chromium's implementation of NetworkingContext.
     9
     10        * src/FrameLoaderClientImpl.cpp:
     11        (WebKit::FrameLoaderClientImpl::createNetworkingContext):
     12        * src/FrameLoaderClientImpl.h:
     13
    1142010-09-02  Vangelis Kokkevis  <vangelis@chromium.org>
    215
  • trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp

    r65604 r66794  
    3838#include "FrameLoader.h"
    3939#include "FrameLoadRequest.h"
     40#include "FrameNetworkingContextImpl.h"
    4041#include "FrameView.h"
    4142#include "HTTPParsers.h"
     
    15131514}
    15141515
     1516PassRefPtr<FrameNetworkingContext> FrameLoaderClientImpl::createNetworkingContext()
     1517{
     1518    return FrameNetworkingContextImpl::create(m_webFrame->frame());
     1519}
     1520
    15151521} // namespace WebKit
  • trunk/WebKit/chromium/src/FrameLoaderClientImpl.h

    r65021 r66794  
    199199    virtual void didNotAllowPlugins();
    200200
     201    virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
     202
    201203private:
    202204    void makeDocumentView();
  • trunk/WebKit/efl/ChangeLog

    r66738 r66794  
     12010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add NetworkingContext to avoid layer violations
     6        https://bugs.webkit.org/show_bug.cgi?id=42292
     7
     8        Add createNetworkingContext to EFL's FrameLoaderClient.
     9
     10        * WebCoreSupport/FrameLoaderClientEfl.cpp:
     11        (WebCore::FrameLoaderClientEfl::createNetworkingContext):
     12        * WebCoreSupport/FrameLoaderClientEfl.h:
     13
    1142010-09-03  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
    215
  • trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp

    r65163 r66794  
    4040#include "FormState.h"
    4141#include "FrameLoader.h"
     42#include "FrameNetworkingContext.h"
    4243#include "FrameTree.h"
    4344#include "FrameView.h"
     
    946947}
    947948
    948 }
     949PassRefPtr<FrameNetworkingContext> FrameLoaderClientEfl::createNetworkingContext()
     950{
     951    return FrameNetworkingContext::create(core(m_webFrame.get()));
     952}
     953
     954}
  • trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h

    r62666 r66794  
    203203    virtual bool canCachePage() const;
    204204    virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&);
     205
     206    virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
    205207 private:
    206208    Evas_Object *m_view;
  • trunk/WebKit/gtk/ChangeLog

    r66725 r66794  
     12010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add NetworkingContext to avoid layer violations
     6        https://bugs.webkit.org/show_bug.cgi?id=42292
     7
     8        Add GTK's specific implementation of FrameNetworkingContext.
     9
     10        * WebCoreSupport/FrameLoaderClientGtk.cpp:
     11        (WebKit::FrameLoaderClient::createNetworkingContext):
     12        * WebCoreSupport/FrameLoaderClientGtk.h:
     13
    1142010-09-03  Xan Lopez  <xlopez@igalia.com>
    215
  • trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

    r66024 r66794  
    3333#include "FormState.h"
    3434#include "FrameLoader.h"
     35#include "FrameNetworkingContextGtk.h"
    3536#include "FrameView.h"
    3637#include "FrameTree.h"
     
    11941195}
    11951196
    1196 }
     1197PassRefPtr<FrameNetworkingContext> FrameLoaderClient::createNetworkingContext()
     1198{
     1199    return FrameNetworkingContextGtk::create(core(m_frame));
     1200}
     1201
     1202}
  • trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h

    r65021 r66794  
    182182        virtual bool canCachePage() const;
    183183        virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
     184
     185        virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
     186
    184187    private:
    185188        WebKitWebFrame* m_frame;
  • trunk/WebKit/mac/ChangeLog

    r66733 r66794  
     12010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add NetworkingContext to avoid layer violations
     6        https://bugs.webkit.org/show_bug.cgi?id=42292
     7
     8        Add Mac's specific implementation of FrameNetworkingContext.
     9
     10        * WebCoreSupport/WebFrameLoaderClient.h:
     11        * WebCoreSupport/WebFrameLoaderClient.mm:
     12        * WebCoreSupport/WebFrameNetworkingContext.mm:
     13        (WebFrameNetworkingContext::needsSiteSpecificQuirks):
     14        (WebFrameNetworkingContext::localFileContentSniffingEnabled):
     15        (WebFrameNetworkingContext::scheduledRunLoopPairs):
     16        (WebFrameNetworkingContext::blockedError):
     17
    1182010-09-03  John Sullivan  <sullivan@apple.com>
    219
  • trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h

    r65021 r66794  
    229229    virtual bool canCachePage() const;
    230230   
     231    virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
     232
    231233    RetainPtr<WebFrame> m_webFrame;
    232234
  • trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r66577 r66794  
    4848#import "WebFrameInternal.h"
    4949#import "WebFrameLoadDelegate.h"
     50#import "WebFrameNetworkingContext.h"
    5051#import "WebFrameViewInternal.h"
    5152#import "WebHTMLRepresentationPrivate.h"
     
    19051906}
    19061907
     1908PassRefPtr<FrameNetworkingContext> WebFrameLoaderClient::createNetworkingContext()
     1909{
     1910    return WebFrameNetworkingContext::create(core(m_webFrame.get()));
     1911}
     1912
    19071913#if ENABLE(JAVA_BRIDGE)
    19081914jobject WebFrameLoaderClient::javaApplet(NSView* view)
  • trunk/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm

    r65579 r66794  
    1818*/
    1919
    20 // Checking this file in empty to get the build system work out of the way.
    21 // Will put the code in here later.
     20#import "WebFrameNetworkingContext.h"
     21
     22#import <WebCore/Page.h>
     23#import <WebCore/ResourceError.h>
     24#import <WebCore/Settings.h>
     25
     26using namespace WebCore;
     27
     28bool WebFrameNetworkingContext::needsSiteSpecificQuirks() const
     29{
     30    return frame() && frame()->settings() && frame()->settings()->needsSiteSpecificQuirks();
     31}
     32
     33bool WebFrameNetworkingContext::localFileContentSniffingEnabled() const
     34{
     35    return frame() && frame()->settings() && frame()->settings()->localFileContentSniffingEnabled();
     36}
     37
     38SchedulePairHashSet* WebFrameNetworkingContext::scheduledRunLoopPairs() const
     39{
     40    return frame() && frame()->page() ? frame()->page()->scheduledRunLoopPairs() : 0;
     41}
     42
     43ResourceError WebFrameNetworkingContext::blockedError(const ResourceRequest& request) const
     44{
     45    return frame()->loader()->blockedError(request);
     46}
  • trunk/WebKit/qt/ChangeLog

    r66720 r66794  
     12010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add NetworkingContext to avoid layer violations
     6        https://bugs.webkit.org/show_bug.cgi?id=42292
     7
     8        Add Qt's specific implementation of NetworkingContext.
     9
     10        * WebCoreSupport/FrameLoaderClientQt.cpp:
     11        (WebCore::FrameLoaderClientQt::setFrame):
     12        (WebCore::FrameLoaderClientQt::createNetworkingContext):
     13        * WebCoreSupport/FrameLoaderClientQt.h:
     14        * WebCoreSupport/FrameNetworkingContextQt.cpp:
     15        (WebCore::FrameNetworkingContextQt::FrameNetworkingContextQt):
     16        (WebCore::FrameNetworkingContextQt::create):
     17        (WebCore::FrameNetworkingContextQt::originatingObject):
     18        (WebCore::FrameNetworkingContextQt::networkAccessManager):
     19
    1202010-09-02  Yury Semikhatsky  <yurys@chromium.org>
    221
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r66030 r66794  
    3636#include "FormState.h"
    3737#include "FrameLoaderClientQt.h"
     38#include "FrameNetworkingContextQt.h"
    3839#include "FrameTree.h"
    3940#include "FrameView.h"
     
    205206    m_webFrame = webFrame;
    206207    m_frame = frame;
     208
    207209    if (!m_webFrame || !m_webFrame->page()) {
    208210        qWarning("FrameLoaderClientQt::setFrame frame without Page!");
     
    15201522}
    15211523
     1524PassRefPtr<FrameNetworkingContext> FrameLoaderClientQt::createNetworkingContext()
     1525{
     1526    return FrameNetworkingContextQt::create(m_frame, m_webFrame, m_webFrame->page()->networkAccessManager());
     1527}
     1528
    15221529}
    15231530
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h

    r65708 r66794  
    3636#include "FrameLoaderClient.h"
    3737#include "KURL.h"
     38#include <wtf/OwnPtr.h>
    3839#include "PluginView.h"
    3940#include "RefCounted.h"
     
    5253class FormState;
    5354class NavigationAction;
     55class FrameNetworkingContext;
    5456class ResourceLoader;
    5557
     
    214216    QString chooseFile(const QString& oldFile);
    215217
     218    virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext();
     219
    216220    static bool dumpFrameLoaderCallbacks;
    217221    static bool dumpResourceLoadCallbacks;
  • trunk/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp

    r65579 r66794  
    1818*/
    1919
    20 // Checking this file in empty to get the build system work out of the way.
    21 // Will put the code in here later.
     20#include "config.h"
     21
     22#include "FrameNetworkingContextQt.h"
     23
     24#include <QNetworkAccessManager>
     25#include <QObject>
     26
     27namespace WebCore {
     28
     29FrameNetworkingContextQt::FrameNetworkingContextQt(Frame* frame, QObject* originatingObject, QNetworkAccessManager* networkAccessManager)
     30    : FrameNetworkingContext(frame)
     31    , m_originatingObject(originatingObject)
     32    , m_networkAccessManager(networkAccessManager)
     33{
     34}
     35
     36PassRefPtr<FrameNetworkingContextQt> FrameNetworkingContextQt::create(Frame* frame, QObject* originatingObject, QNetworkAccessManager* networkAccessManager)
     37{
     38    return adoptRef(new FrameNetworkingContextQt(frame, originatingObject, networkAccessManager));
     39}
     40
     41QObject* FrameNetworkingContextQt::originatingObject() const
     42{
     43    return m_originatingObject;
     44}
     45
     46QNetworkAccessManager* FrameNetworkingContextQt::networkAccessManager() const
     47{
     48    return m_networkAccessManager;
     49}
     50
     51}
  • trunk/WebKit/win/ChangeLog

    r66767 r66794  
     12010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add NetworkingContext to avoid layer violations
     6        https://bugs.webkit.org/show_bug.cgi?id=42292
     7
     8        Add Win's specific implementation of NetworkingContext.
     9
     10        * WebCoreSupport/WebFrameNetworkingContext.cpp:
     11        (WebFrameNetworkingContext::create):
     12        (WebFrameNetworkingContext::userAgent):
     13        (WebFrameNetworkingContext::referrer):
     14        * WebFrame.cpp:
     15        (WebFrame::createNetworkingContext):
     16        * WebFrame.h:
     17
    1182010-09-03  Adam Roben  <aroben@apple.com>
    219
  • trunk/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp

    r65579 r66794  
    1818*/
    1919
    20 // Checking this file in empty to get the build system work out of the way.
    21 // Will put the code in here later.
     20#include "config.h"
     21
     22#include "WebFrameNetworkingContext.h"
     23
     24using namespace WebCore;
     25
     26PassRefPtr<WebFrameNetworkingContext> WebFrameNetworkingContext::create(Frame* frame, const String& userAgent)
     27{
     28    return adoptRef(new WebFrameNetworkingContext(frame, userAgent));
     29}
     30
     31String WebFrameNetworkingContext::userAgent() const
     32{
     33    return m_userAgent;
     34}
     35
     36String WebFrameNetworkingContext::referrer() const
     37{
     38    return frame()->loader()->referrer();
     39}
  • trunk/WebKit/win/WebFrame.cpp

    r66580 r66794  
    4343#include "WebEditorClient.h"
    4444#include "WebError.h"
     45#include "WebFrameNetworkingContext.h"
    4546#include "WebFramePolicyListener.h"
    4647#include "WebHistory.h"
     
    26152616}
    26162617
     2618PassRefPtr<FrameNetworkingContext> WebFrame::createNetworkingContext()
     2619{
     2620    return WebFrameNetworkingContext::create(core(this), userAgent(url()));
     2621}
  • trunk/WebKit/win/WebFrame.h

    r65107 r66794  
    344344    virtual void registerForIconNotification(bool listen);
    345345
     346    virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
     347
    346348    // WebFrame
    347349    PassRefPtr<WebCore::Frame> init(IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
  • trunk/WebKit2/ChangeLog

    r66790 r66794  
     12010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add NetworkingContext to avoid layer violations
     6        https://bugs.webkit.org/show_bug.cgi?id=42292
     7
     8        Add FrameNetworkingContext implementation.
     9
     10        * WebKit2.pro:
     11        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     12        (WebKit::WebFrameLoaderClient::createNetworkingContext):
     13        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
     14        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
     15        (WebKit::WebFrameNetworkingContext::needsSiteSpecificQuirks):
     16        (WebKit::WebFrameNetworkingContext::localFileContentSniffingEnabled):
     17        (WebKit::WebFrameNetworkingContext::scheduledRunLoopPairs):
     18        (WebKit::WebFrameNetworkingContext::blockedError):
     19        * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp: Added.
     20        (WebCore::WebFrameNetworkingContext::WebFrameNetworkingContext):
     21        (WebCore::WebFrameNetworkingContext::create):
     22        (WebCore::WebFrameNetworkingContext::originatingObject):
     23        (WebCore::WebFrameNetworkingContext::networkAccessManager):
     24        * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h: Added.
     25        * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
     26        * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.
     27        (WebFrameNetworkingContext::create):
     28        (WebFrameNetworkingContext::WebFrameNetworkingContext):
     29        * win/WebKit2.vcproj:
     30        * win/WebKit2Common.vsprops:
     31
    1322010-09-03  Sam Weinig  <sam@webkit.org>
    233
  • trunk/WebKit2/WebKit2.pro

    r66688 r66794  
    124124    WebProcess/Plugins/Netscape \
    125125    WebProcess/WebCoreSupport \
     126    WebProcess/WebCoreSupport/qt \
    126127    WebProcess/WebPage \
    127128    $$INCLUDEPATH
     
    251252    WebProcess/WebCoreSupport/WebPopupMenu.h \
    252253    WebProcess/WebCoreSupport/WebSearchPopupMenu.h \
     254    WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h \
    253255    WebProcess/WebPage/ChunkedUpdateDrawingArea.h \
    254256    WebProcess/WebPage/DrawingArea.h \
     
    359361    WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp \
    360362    WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp \
     363    WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp \
    361364    WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp \
    362365    WebProcess/WebPage/DrawingArea.cpp \
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r66789 r66794  
    3636#include "WebEvent.h"
    3737#include "WebFrame.h"
     38#include "WebFrameNetworkingContext.h"
    3839#include "WebNavigationDataStore.h"
    3940#include "WebPage.h"
     
    10511052}
    10521053
     1054PassRefPtr<FrameNetworkingContext> WebFrameLoaderClient::createNetworkingContext()
     1055{
     1056    return WebFrameNetworkingContext::create(m_frame->coreFrame());
     1057}
     1058
    10531059} // namespace WebKit
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

    r65021 r66794  
    205205   
    206206    void receivedData(const char* data, int length, const WTF::String& textEncoding);
     207
     208    virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
    207209   
    208210    WebFrame* m_frame;
  • trunk/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm

    r65579 r66794  
    1818*/
    1919
    20 // Checking this file in empty to get the build system work out of the way.
    21 // Will put the code in here later.
     20#import "WebFrameNetworkingContext.h"
     21
     22#import <WebCore/Page.h>
     23#import <WebCore/ResourceError.h>
     24#import <WebCore/Settings.h>
     25
     26using namespace WebCore;
     27
     28namespace WebKit {
     29
     30bool WebFrameNetworkingContext::needsSiteSpecificQuirks() const
     31{
     32    return frame() && frame()->settings() && frame()->settings()->needsSiteSpecificQuirks();
     33}
     34
     35bool WebFrameNetworkingContext::localFileContentSniffingEnabled() const
     36{
     37    return frame() && frame()->settings() && frame()->settings()->localFileContentSniffingEnabled();
     38}
     39
     40SchedulePairHashSet* WebFrameNetworkingContext::scheduledRunLoopPairs() const
     41{
     42    return frame() && frame()->page() ? frame()->page()->scheduledRunLoopPairs() : 0;
     43}
     44
     45ResourceError WebFrameNetworkingContext::blockedError(const ResourceRequest& request) const
     46{
     47    return frame()->loader()->blockedError(request);
     48}
     49
     50}
  • trunk/WebKit2/WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h

    r66793 r66794  
    1818*/
    1919
    20 // Checking this file in empty to get the build system work out of the way.
    21 // Will put the code in here later.
     20#ifndef WebFrameNetworkingContext_h
     21#define WebFrameNetworkingContext_h
     22
     23#include <WebCore/FrameNetworkingContext.h>
     24
     25namespace WebCore {
     26
     27class WebFrameNetworkingContext : public FrameNetworkingContext {
     28public:
     29    static PassRefPtr<WebFrameNetworkingContext> create(Frame*);
     30
     31private:
     32    WebFrameNetworkingContext(Frame*);
     33
     34    virtual QObject* originatingObject() const;
     35    virtual QNetworkAccessManager* networkAccessManager() const;
     36
     37    QObject* m_originatingObject;
     38    QNetworkAccessManager* m_networkAccessManager;
     39};
     40
     41}
     42
     43#endif // WebFrameNetworkingContext_h
  • trunk/WebKit2/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp

    r66793 r66794  
    1717    Boston, MA 02110-1301, USA.
    1818*/
    19 
    2019// Checking this file in empty to get the build system work out of the way.
    2120// Will put the code in here later.
  • trunk/WebKit2/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h

    r66793 r66794  
    1818*/
    1919
    20 // Checking this file in empty to get the build system work out of the way.
    21 // Will put the code in here later.
     20#ifndef WebFrameNetworkingContext_h
     21#define WebFrameNetworkingContext_h
     22
     23#include <WebCore/FrameNetworkingContext.h>
     24
     25class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext {
     26public:
     27    static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame*)
     28    {
     29        return 0;
     30    }
     31
     32private:
     33    WebFrameNetworkingContext(WebCore::Frame* frame)
     34        : WebCore::FrameNetworkingContext(frame)
     35    {
     36    }
     37
     38    virtual WTF::String userAgent() const;
     39    virtual WTF::String referrer() const;
     40
     41    WTF::String m_userAgent;
     42};
     43
     44#endif // WebFrameNetworkingContext_h
  • trunk/WebKit2/win/WebKit2.vcproj

    r66688 r66794  
    691691                                                >
    692692                                        </File>
     693                                        <File
     694                                                RelativePath="..\WebProcess\WebCoreSupport\win\WebFrameNetworkingContext.cpp"
     695                                                >
     696                                        </File>
     697                                        <File
     698                                                RelativePath="..\WebProcess\WebCoreSupport\win\WebFrameNetworkingContext.h"
     699                                                >
     700                                        </File>
    693701                                </Filter>
    694702                        </Filter>
  • trunk/WebKit2/win/WebKit2Common.vsprops

    • Property svn:executable set to *
    r64795 r66794  
    77        <Tool
    88                Name="VCCLCompilerTool"
    9                 AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
     9                AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
    1010                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
    1111                UsePrecompiledHeader="2"
Note: See TracChangeset for help on using the changeset viewer.