Changeset 219290 in webkit


Ignore:
Timestamp:
Jul 10, 2017 6:21:35 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
https://bugs.webkit.org/show_bug.cgi?id=166029

Reviewed by Michael Catanzaro.

Source/WebCore:

Add clearSoupNetworkSessionAndCookieStorage() to clear the SoupNetworkSession and cookie storage of the main
network session, ensuring the cookies database is properly closed.

  • platform/network/NetworkStorageSession.h:
  • platform/network/soup/NetworkStorageSessionSoup.cpp:

(WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):

Source/WebKit2:

Clear the SoupNetworkSession and cookie storage after the main loop quits.

  • NetworkProcess/soup/NetworkProcessMainSoup.cpp:

(WebKit::NetworkProcessMainUnix):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r219289 r219290  
     12017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
     4        https://bugs.webkit.org/show_bug.cgi?id=166029
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Add clearSoupNetworkSessionAndCookieStorage() to clear the SoupNetworkSession and cookie storage of the main
     9        network session, ensuring the cookies database is properly closed.
     10
     11        * platform/network/NetworkStorageSession.h:
     12        * platform/network/soup/NetworkStorageSessionSoup.cpp:
     13        (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
     14
    1152017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
  • trunk/Source/WebCore/platform/network/NetworkStorageSession.h

    r218615 r219290  
    9393    SoupNetworkSession* soupNetworkSession() const { return m_session.get(); };
    9494    SoupNetworkSession& getOrCreateSoupNetworkSession() const;
     95    void clearSoupNetworkSessionAndCookieStorage();
    9596    SoupCookieJar* cookieStorage() const;
    9697    void setCookieStorage(SoupCookieJar*);
  • trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp

    r215883 r219290  
    104104}
    105105
     106void NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage()
     107{
     108    ASSERT(defaultSession().get() == this);
     109    m_session = nullptr;
     110    m_cookieObserverHandler = nullptr;
     111    m_cookieStorage = nullptr;
     112}
     113
    106114void NetworkStorageSession::cookiesDidChange(NetworkStorageSession* session)
    107115{
  • trunk/Source/WebKit2/ChangeLog

    r219287 r219290  
     12017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
     4        https://bugs.webkit.org/show_bug.cgi?id=166029
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Clear the SoupNetworkSession and cookie storage after the main loop quits.
     9
     10        * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
     11        (WebKit::NetworkProcessMainUnix):
     12
    1132017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>
    214
  • trunk/Source/WebKit2/NetworkProcess/soup/NetworkProcessMainSoup.cpp

    r206772 r219290  
    3030#include "ChildProcessMain.h"
    3131#include "NetworkProcessMainUnix.h"
     32#include <WebCore/NetworkStorageSession.h>
    3233
    3334namespace WebKit {
    3435
     36class NetworkProcessMain final: public ChildProcessMainBase {
     37public:
     38    void platformFinalize() override
     39    {
     40        WebCore::NetworkStorageSession::defaultStorageSession().clearSoupNetworkSessionAndCookieStorage();
     41    }
     42};
     43
    3544int NetworkProcessMainUnix(int argc, char** argv)
    3645{
    37     return ChildProcessMain<NetworkProcess, ChildProcessMainBase>(argc, argv);
     46    return ChildProcessMain<NetworkProcess, NetworkProcessMain>(argc, argv);
    3847}
    3948
Note: See TracChangeset for help on using the changeset viewer.