WebFrameNetworkingContext.cpp [plain text]
#include "config.h"
#include "WebFrameNetworkingContext.h"
#include "NetworkSession.h"
#include "SessionTracker.h"
#include "WebFrame.h"
#include "WebPage.h"
#include <WebCore/FrameLoader.h>
#include <WebCore/NetworkStorageSession.h>
#include <WebCore/SessionID.h>
#include <WebCore/Settings.h>
#include <WebCore/SoupNetworkSession.h>
using namespace WebCore;
namespace WebKit {
void WebFrameNetworkingContext::ensurePrivateBrowsingSession(SessionID sessionID)
{
ASSERT(RunLoop::isMain());
ASSERT(sessionID.isEphemeral());
if (NetworkStorageSession::storageSession(sessionID))
return;
NetworkStorageSession::ensurePrivateBrowsingSession(sessionID, String::number(sessionID.sessionID()));
SessionTracker::setSession(sessionID, NetworkSession::create(sessionID));
}
void WebFrameNetworkingContext::ensureWebsiteDataStoreSession(WebsiteDataStoreParameters&&)
{
}
WebFrameNetworkingContext::WebFrameNetworkingContext(WebFrame* frame)
: FrameNetworkingContext(frame->coreFrame())
{
}
NetworkStorageSession& WebFrameNetworkingContext::storageSession() const
{
if (frame()) {
if (auto* storageSession = NetworkStorageSession::storageSession(frame()->page()->sessionID()))
return *storageSession;
}
return NetworkStorageSession::defaultStorageSession();
}
WebFrameLoaderClient* WebFrameNetworkingContext::webFrameLoaderClient() const
{
if (!frame())
return nullptr;
return toWebFrameLoaderClient(frame()->loader().client());
}
}