Changeset 141749 in webkit


Ignore:
Timestamp:
Feb 4, 2013 1:33:30 AM (11 years ago)
Author:
kbalazs@webkit.org
Message:

[Soup] Wrap SoupSession by NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=108615

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Implement NetworkStorageSession for ports using soup. It has been
separated from NetworkingContext, so now we have a default storage
session, which is the same as before but now wrapped with NetworkStorageSession,
and it can be overridden by the networking context.

No change in behavior so no new tests.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • PlatformBlackBerry.cmake:
  • PlatformEfl.cmake:
  • loader/CookieJar.cpp:

(WebCore):
Now we also get the storage session from the networking context
and not the other way.

  • platform/network/NetworkStorageSession.h:

(NetworkStorageSession):
(WebCore::NetworkStorageSession::setSoupSession):
(WebCore::NetworkStorageSession::soupSession):
Hold a SoupSession pointer for ports using soup. Added a setter because it is
necessary for API's that allow it to be specified per page, like EFL WK1.

  • platform/network/NetworkingContext.h:

(NetworkingContext):

  • platform/network/soup/CookieJarSoup.cpp:

(WebCore::cookieJarForSession):

  • platform/network/soup/NetworkStorageSessionSoup.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp.

(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::defaultStorageSession):
(WebCore::NetworkStorageSession::createDefaultSession):
(WebCore::NetworkStorageSession::createPrivateBrowsingSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):

  • platform/network/soup/ResourceHandleSoup.cpp:

(WebCore::sessionFromContext):

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • PlatformBlackBerry.cmake:
  • PlatformEfl.cmake:
  • loader/CookieJar.cpp:

(WebCore):

  • platform/network/NetworkStorageSession.h:

(NetworkStorageSession):
(WebCore::NetworkStorageSession::setSoupSession):
(WebCore::NetworkStorageSession::soupSession):

  • platform/network/NetworkingContext.h:

(NetworkingContext):

  • platform/network/soup/CookieJarSoup.cpp:

(WebCore::cookieJarForSession):

  • platform/network/soup/ResourceHandleSoup.cpp:

(WebCore::sessionFromContext):

Source/WebKit/efl:

Changed to hold the SoupSession pointer in a NetworkStorageSession
so we can pass it to WebCore. _Ewk_View_Private_Data has to be
changed for that reason.

  • WebCoreSupport/FrameNetworkingContextEfl.cpp:

(WebCore::FrameNetworkingContextEfl::storageSession):

  • WebCoreSupport/FrameNetworkingContextEfl.h:

(FrameNetworkingContextEfl):

  • ewk/ewk_view.cpp:

(_Ewk_View_Private_Data):
(_ewk_view_priv_new):
(ewk_view_soup_session_get):
(ewk_view_soup_session_set):
(EWKPrivate::storageSession):
(EWKPrivate):

  • ewk/ewk_view_private.h:

(EWKPrivate):

Source/WebKit/gtk:

  • WebCoreSupport/FrameNetworkingContextGtk.cpp:

(WebKit::FrameNetworkingContextGtk::storageSession):

  • WebCoreSupport/FrameNetworkingContextGtk.h:

(FrameNetworkingContextGtk):

Source/WebKit2:

  • WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:

(WebKit::WebFrameNetworkingContext::storageSession):

  • WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:

(WebFrameNetworkingContext):

Location:
trunk/Source
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r141733 r141749  
    20602060    platform/network/MIMEHeader.cpp
    20612061    platform/network/NetworkStateNotifier.cpp
    2062     platform/network/NetworkStorageSessionStub.cpp
    20632062    platform/network/ParsedContentType.cpp
    20642063    platform/network/ProtectionSpace.cpp
  • trunk/Source/WebCore/ChangeLog

    r141747 r141749  
     12013-02-04  Balazs Kelemen  <kbalazs@webkit.org>
     2
     3        [Soup] Wrap SoupSession by NetworkStorageSession
     4        https://bugs.webkit.org/show_bug.cgi?id=108615
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Implement NetworkStorageSession for ports using soup. It has been
     9        separated from NetworkingContext, so now we have a default storage
     10        session, which is the same as before but now wrapped with NetworkStorageSession,
     11        and it can be overridden by the networking context.
     12
     13        No change in behavior so no new tests.
     14
     15        * CMakeLists.txt:
     16        * GNUmakefile.list.am:
     17        * PlatformBlackBerry.cmake:
     18        * PlatformEfl.cmake:
     19        * loader/CookieJar.cpp:
     20        (WebCore):
     21        Now we also get the storage session from the networking context
     22        and not the other way.
     23
     24        * platform/network/NetworkStorageSession.h:
     25        (NetworkStorageSession):
     26        (WebCore::NetworkStorageSession::setSoupSession):
     27        (WebCore::NetworkStorageSession::soupSession):
     28        Hold a SoupSession pointer for ports using soup. Added a setter because it is
     29        necessary for API's that allow it to be specified per page, like EFL WK1.
     30
     31        * platform/network/NetworkingContext.h:
     32        (NetworkingContext):
     33        * platform/network/soup/CookieJarSoup.cpp:
     34        (WebCore::cookieJarForSession):
     35        * platform/network/soup/NetworkStorageSessionSoup.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp.
     36        (WebCore::NetworkStorageSession::NetworkStorageSession):
     37        (WebCore::NetworkStorageSession::defaultStorageSession):
     38        (WebCore::NetworkStorageSession::createDefaultSession):
     39        (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
     40        (WebCore::NetworkStorageSession::switchToNewTestingSession):
     41        * platform/network/soup/ResourceHandleSoup.cpp:
     42        (WebCore::sessionFromContext):
     43
     44        * CMakeLists.txt:
     45        * GNUmakefile.list.am:
     46        * PlatformBlackBerry.cmake:
     47        * PlatformEfl.cmake:
     48        * loader/CookieJar.cpp:
     49        (WebCore):
     50        * platform/network/NetworkStorageSession.h:
     51        (NetworkStorageSession):
     52        (WebCore::NetworkStorageSession::setSoupSession):
     53        (WebCore::NetworkStorageSession::soupSession):
     54        * platform/network/NetworkingContext.h:
     55        (NetworkingContext):
     56        * platform/network/soup/CookieJarSoup.cpp:
     57        (WebCore::cookieJarForSession):
     58        * platform/network/soup/ResourceHandleSoup.cpp:
     59        (WebCore::sessionFromContext):
     60
    1612013-02-04  Andrey Lushnikov  <lushnikov@chromium.org>
    262
  • trunk/Source/WebCore/GNUmakefile.list.am

    r141735 r141749  
    58175817        Source/WebCore/platform/network/NetworkStateNotifier.h \
    58185818        Source/WebCore/platform/network/NetworkStorageSession.h \
    5819         Source/WebCore/platform/network/NetworkStorageSessionStub.cpp \
    58205819        Source/WebCore/platform/network/ParsedContentType.cpp \
    58215820        Source/WebCore/platform/network/ParsedContentType.h \
     
    58555854        Source/WebCore/platform/network/soup/GOwnPtrSoup.cpp \
    58565855        Source/WebCore/platform/network/soup/GOwnPtrSoup.h \
     5856        Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp \
    58575857        Source/WebCore/platform/network/soup/ProxyServerSoup.cpp \
    58585858        Source/WebCore/platform/network/soup/ResourceError.h \
  • trunk/Source/WebCore/PlatformBlackBerry.cmake

    r137514 r141749  
    8787list(APPEND WebCore_SOURCES
    8888    platform/network/MIMESniffing.cpp
     89    platform/network/NetworkStorageSessionStub.cpp
    8990    platform/network/ProxyServer.cpp
    9091    platform/network/blackberry/AutofillBackingStore.cpp
  • trunk/Source/WebCore/PlatformEfl.cmake

    r141291 r141749  
    151151    platform/network/soup/DNSSoup.cpp
    152152    platform/network/soup/GOwnPtrSoup.cpp
     153    platform/network/soup/NetworkStorageSessionSoup.cpp
    153154    platform/network/soup/ProxyResolverSoup.cpp
    154155    platform/network/soup/ProxyServerSoup.cpp
  • trunk/Source/WebCore/loader/CookieJar.cpp

    r138421 r141749  
    5757}
    5858
    59 #if PLATFORM(MAC) || USE(CFNETWORK)
     59#if PLATFORM(MAC) || USE(CFNETWORK) || USE(SOUP)
    6060inline NetworkStorageSession& storageSession(const Document* document)
    6161{
  • trunk/Source/WebCore/platform/network/NetworkStorageSession.h

    r138476 r141749  
    3333typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
    3434typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
     35#elif USE(SOUP)
     36typedef struct _SoupCookieJar SoupCookieJar;
     37typedef struct _SoupSession SoupSession;
    3538#endif
    3639
     
    4346public:
    4447    static NetworkStorageSession& defaultStorageSession();
    45     static PassOwnPtr<NetworkStorageSession> createDefaultSession(const String& identifierBase);
     48    static PassOwnPtr<NetworkStorageSession> createDefaultSession(const String& identifierBase = String());
    4649    static PassOwnPtr<NetworkStorageSession> createPrivateBrowsingSession(const String& identifierBase);
    4750
     
    5356    RetainPtr<CFHTTPCookieStorageRef> cookieStorage() const;
    5457    bool isPrivateBrowsingSession() const { return m_isPrivate; }
     58#elif USE(SOUP)
     59    void setSoupSession(SoupSession* session) { m_session = session; }
     60    SoupSession* soupSession() const { return m_session; }
    5561#else
    5662    NetworkStorageSession(NetworkingContext*);
     
    6571    RetainPtr<CFURLStorageSessionRef> m_platformSession;
    6672    bool m_isPrivate;
     73#elif USE(SOUP)
     74    NetworkStorageSession(SoupSession*);
     75    SoupSession* m_session;
    6776#else
    6877    RefPtr<NetworkingContext> m_context;
  • trunk/Source/WebCore/platform/network/NetworkingContext.h

    r138413 r141749  
    7979#endif
    8080
    81 #if PLATFORM(MAC) || USE(CFNETWORK)
    82 
     81#if PLATFORM(MAC) || USE(CFNETWORK) || USE(SOUP)
    8382    virtual NetworkStorageSession& storageSession() const = 0;
    8483#endif
     
    9998
    10099#if USE(SOUP)
    101     // FIXME: Wrap SoupSession into a NetworkStorageSession to make the code cross-platform.
    102     virtual SoupSession* soupSession() const = 0;
    103100    virtual uint64_t initiatingPageID() const = 0;
    104101#endif
  • trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp

    r138413 r141749  
    3535static SoupCookieJar* cookieJarForSession(const NetworkStorageSession& session)
    3636{
    37     if (!session.context())
     37    if (!session.soupSession())
    3838        return soupCookieJar();
    39     return SOUP_COOKIE_JAR(soup_session_get_feature(session.context()->soupSession(), SOUP_TYPE_COOKIE_JAR));
     39    return SOUP_COOKIE_JAR(soup_session_get_feature(session.soupSession(), SOUP_TYPE_COOKIE_JAR));
    4040}
    4141
  • trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r141727 r141749  
    259259static SoupSession* sessionFromContext(NetworkingContext* context)
    260260{
    261     return (context && context->isValid()) ? context->soupSession() : ResourceHandle::defaultSession();
     261    if (!context || !context->isValid())
     262        return ResourceHandle::defaultSession();
     263    return context->storageSession().soupSession();
    262264}
    263265
  • trunk/Source/WebKit/efl/ChangeLog

    r141736 r141749  
     12013-02-04  Balazs Kelemen  <kbalazs@webkit.org>
     2
     3        [Soup] Wrap SoupSession by NetworkStorageSession
     4        https://bugs.webkit.org/show_bug.cgi?id=108615
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Changed to hold the SoupSession pointer in a NetworkStorageSession
     9        so we can pass it to WebCore. _Ewk_View_Private_Data has to be
     10        changed for that reason.
     11
     12        * WebCoreSupport/FrameNetworkingContextEfl.cpp:
     13        (WebCore::FrameNetworkingContextEfl::storageSession):
     14        * WebCoreSupport/FrameNetworkingContextEfl.h:
     15        (FrameNetworkingContextEfl):
     16        * ewk/ewk_view.cpp:
     17        (_Ewk_View_Private_Data):
     18        (_ewk_view_priv_new):
     19        (ewk_view_soup_session_get):
     20        (ewk_view_soup_session_set):
     21        (EWKPrivate::storageSession):
     22        (EWKPrivate):
     23        * ewk/ewk_view_private.h:
     24        (EWKPrivate):
     25
    1262013-02-03  KwangYong Choi  <ky0.choi@samsung.com>
    227
  • trunk/Source/WebKit/efl/WebCoreSupport/FrameNetworkingContextEfl.cpp

    r130259 r141749  
    3535#include "ewk_frame.h"
    3636#include "ewk_view.h"
     37#include "ewk_view_private.h"
    3738
    3839#include <Evas.h>
     
    5152}
    5253
    53 SoupSession* FrameNetworkingContextEfl::soupSession() const
     54NetworkStorageSession& FrameNetworkingContextEfl::storageSession() const
    5455{
    55     return ewk_view_soup_session_get(ewk_frame_view_get(m_ewkFrame));
     56    if (NetworkStorageSession* session = EWKPrivate::storageSession(ewk_frame_view_get(m_ewkFrame)))
     57        return *session;
     58    return NetworkStorageSession::defaultStorageSession();
    5659}
    5760
  • trunk/Source/WebKit/efl/WebCoreSupport/FrameNetworkingContextEfl.h

    r138326 r141749  
    3939
    4040    WebCore::Frame* coreFrame() const { return frame(); }
    41     virtual SoupSession* soupSession() const;
    4241    virtual uint64_t initiatingPageID() const;
    4342
    4443private:
     44    virtual WebCore::NetworkStorageSession& storageSession() const;
     45
    4546    FrameNetworkingContextEfl(Frame*, Evas_Object*);
    4647
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r141040 r141749  
    5050#include "JSDOMWindow.h"
    5151#include "JSLock.h"
     52#include "NetworkStorageSession.h"
    5253#include "Operations.h"
    5354#include "PageClientEfl.h"
     
    273274    OwnPtr<WebCore::NavigatorContentUtilsClientEfl> navigatorContentUtilsClient;
    274275#endif
     276    OwnPtr<WebCore::NetworkStorageSession> storageSession;
    275277    struct {
    276278        Ewk_Menu menu;
     
    370372        Ecore_Animator* animator;
    371373    } animatedZoom;
    372     SoupSession* soupSession;
    373374    const char* cursorGroup;
    374375    Evas_Object* cursorObject;
     
    927928    priv->history = ewk_history_new(static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList()));
    928929
    929     priv->soupSession = WebCore::ResourceHandle::defaultSession();
     930    priv->storageSession = WebCore::NetworkStorageSession::createDefaultSession();
    930931
    931932    priv->pageClient = adoptPtr(new PageClientEfl(smartData->self));
     
    43824383    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
    43834384    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
    4384     return priv->soupSession;
     4385    return priv->storageSession->soupSession();
    43854386}
    43864387
     
    43944395        return;
    43954396    }
    4396     priv->soupSession = session;
     4397    priv->storageSession->setSoupSession(session);
    43974398}
    43984399
     
    48524853}
    48534854
     4855WebCore::NetworkStorageSession* storageSession(const Evas_Object* ewkView)
     4856{
     4857    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
     4858    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
     4859    return priv->storageSession.get();
     4860}
     4861
    48544862} // namespace EWKPrivate
  • trunk/Source/WebKit/efl/ewk/ewk_view_private.h

    r134743 r141749  
    2424
    2525#include "Frame.h"
     26#include "NetworkStorageSession.h"
    2627#include "Page.h"
    2728#include "Widget.h"
     
    175176WebCore::Page *corePage(const Evas_Object *ewkView);
    176177PlatformPageClient corePageClient(Evas_Object* ewkView);
     178WebCore::NetworkStorageSession* storageSession(const Evas_Object* ewkView);
    177179} // namespace EWKPrivate
    178180
  • trunk/Source/WebKit/gtk/ChangeLog

    r141736 r141749  
     12013-02-04  Balazs Kelemen  <kbalazs@webkit.org>
     2
     3        [Soup] Wrap SoupSession by NetworkStorageSession
     4        https://bugs.webkit.org/show_bug.cgi?id=108615
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * WebCoreSupport/FrameNetworkingContextGtk.cpp:
     9        (WebKit::FrameNetworkingContextGtk::storageSession):
     10        * WebCoreSupport/FrameNetworkingContextGtk.h:
     11        (FrameNetworkingContextGtk):
     12
    1132013-02-03  KwangYong Choi  <ky0.choi@samsung.com>
    214
  • trunk/Source/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.cpp

    r130259 r141749  
    2222#include "FrameNetworkingContextGtk.h"
    2323
     24#include "NetworkStorageSession.h"
    2425#include "NotImplemented.h"
    25 #include "ResourceHandle.h"
    2626
    2727using namespace WebCore;
     
    2929namespace WebKit {
    3030
    31 SoupSession* FrameNetworkingContextGtk::soupSession() const
     31NetworkStorageSession& FrameNetworkingContextGtk::storageSession() const
    3232{
    33     return ResourceHandle::defaultSession();
     33    return NetworkStorageSession::defaultStorageSession();
    3434}
    3535
  • trunk/Source/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h

    r130259 r141749  
    3333
    3434    WebCore::Frame* coreFrame() const { return frame(); }
    35     virtual SoupSession* soupSession() const;
    3635    virtual uint64_t initiatingPageID() const;
    3736
    3837private:
     38    virtual WebCore::NetworkStorageSession& storageSession() const;
     39
    3940    FrameNetworkingContextGtk(WebCore::Frame* frame)
    4041        : WebCore::FrameNetworkingContext(frame)
  • trunk/Source/WebKit2/ChangeLog

    r141744 r141749  
     12013-02-04  Balazs Kelemen  <kbalazs@webkit.org>
     2
     3        [Soup] Wrap SoupSession by NetworkStorageSession
     4        https://bugs.webkit.org/show_bug.cgi?id=108615
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
     9        (WebKit::WebFrameNetworkingContext::storageSession):
     10        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
     11        (WebFrameNetworkingContext):
     12
    1132013-02-03  David Kilzer  <ddkilzer@apple.com>
    214
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp

    r130259 r141749  
    2929#include "WebFrame.h"
    3030#include "WebPage.h"
    31 #include <WebCore/ResourceHandle.h>
    3231
    3332using namespace WebCore;
     
    4342}
    4443
    45 SoupSession* WebFrameNetworkingContext::soupSession() const
     44NetworkStorageSession& WebFrameNetworkingContext::storageSession() const
    4645{
    47     return ResourceHandle::defaultSession();
     46    return NetworkStorageSession::defaultStorageSession();
    4847}
    4948
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h

    r130259 r141749  
    4545    WebFrameNetworkingContext(WebFrame*);
    4646
    47     virtual SoupSession* soupSession() const;
     47    virtual WebCore::NetworkStorageSession& storageSession() const;
    4848    virtual uint64_t initiatingPageID() const;
    4949
Note: See TracChangeset for help on using the changeset viewer.