WebKit Bugzilla
Attachment 362677 Details for
Bug 194926
: NetworkSession should own NetworkStorageSession
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194926-20190221174702.patch (text/plain), 28.80 KB, created by
Alex Christensen
on 2019-02-21 17:47:03 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-02-21 17:47:03 PST
Size:
28.80 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 241924) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,60 @@ >+2019-02-21 Alex Christensen <achristensen@webkit.org> >+ >+ NetworkSession should own NetworkStorageSession >+ https://bugs.webkit.org/show_bug.cgi?id=194926 >+ <rdar://problem/47580502> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Instead of keeping two maps with the same keys that are supposed to stay synchronized but don't always. >+ >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::switchToNewTestingSession): >+ (WebKit::NetworkProcess::storageSession const): >+ (WebKit::NetworkProcess::defaultStorageSession const): >+ (WebKit::NetworkProcess::forEachNetworkStorageSession): >+ (WebKit::NetworkProcess::destroySession): >+ (WebKit::NetworkProcess::ensureSession): Deleted. >+ * NetworkProcess/NetworkProcess.h: >+ * NetworkProcess/NetworkProcessCreationParameters.cpp: >+ (WebKit::NetworkProcessCreationParameters::encode const): >+ (WebKit::NetworkProcessCreationParameters::decode): >+ * NetworkProcess/NetworkProcessCreationParameters.h: >+ * NetworkProcess/NetworkSession.cpp: >+ (WebKit::createNetworkStorageSession): >+ (WebKit::NetworkSession::NetworkSession): >+ * NetworkProcess/NetworkSession.h: >+ (WebKit::NetworkSession::setNewTestingSession): >+ (WebKit::NetworkSession::networkStorageSession): >+ * NetworkProcess/NetworkSessionCreationParameters.cpp: >+ (WebKit::NetworkSessionCreationParameters::privateSessionParameters): >+ (WebKit::NetworkSessionCreationParameters::encode const): >+ (WebKit::NetworkSessionCreationParameters::decode): >+ * NetworkProcess/NetworkSessionCreationParameters.h: >+ * NetworkProcess/cocoa/NetworkProcessCocoa.mm: >+ (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): >+ (WebKit::NetworkProcess::platformCreateDefaultStorageSession const): Deleted. >+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm: >+ (WebKit::mainBundleIdentifier): >+ (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): >+ * NetworkProcess/curl/NetworkSessionCurl.cpp: >+ (WebKit::NetworkSessionCurl::NetworkSessionCurl): >+ * NetworkProcess/mac/RemoteNetworkingContext.mm: >+ (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): >+ * NetworkProcess/soup/NetworkProcessSoup.cpp: >+ (WebKit::NetworkProcess::platformCreateDefaultStorageSession const): Deleted. >+ * NetworkProcess/soup/NetworkSessionSoup.cpp: >+ (WebKit::NetworkSessionSoup::NetworkSessionSoup): >+ * Shared/WebsiteDataStoreParameters.cpp: >+ (WebKit::WebsiteDataStoreParameters::encode const): >+ (WebKit::WebsiteDataStoreParameters::decode): >+ (WebKit::WebsiteDataStoreParameters::privateSessionParameters): >+ * Shared/WebsiteDataStoreParameters.h: >+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm: >+ (WebKit::WebProcessPool::platformInitializeNetworkProcess): >+ * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: >+ (WebKit::WebsiteDataStore::parameters): >+ > 2019-02-21 Don Olmstead <don.olmstead@sony.com> > > [MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics >Index: Source/WebKit/NetworkProcess/NetworkProcess.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.cpp (revision 241903) >+++ Source/WebKit/NetworkProcess/NetworkProcess.cpp (working copy) >@@ -461,6 +461,8 @@ void NetworkProcess::addWebsiteDataStore > > void NetworkProcess::switchToNewTestingSession() > { >+ auto* networkSession = m_networkSessions.get(PAL::SessionID::defaultSessionID()); >+ > #if PLATFORM(COCOA) > // Session name should be short enough for shared memory region name to be under the limit, otherwise sandbox rules won't work (see <rdar://problem/13642852>). > String sessionName = makeString("WebKit Test-", getCurrentProcessID()); >@@ -474,67 +476,33 @@ void NetworkProcess::switchToNewTestingS > cookieStorage = adoptCF(_CFURLStorageSessionCopyCookieStorage(kCFAllocatorDefault, session.get())); > } > >- m_defaultNetworkStorageSession = std::make_unique<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID(), WTFMove(session), WTFMove(cookieStorage)); >-#elif USE(SOUP) >- m_defaultNetworkStorageSession = std::make_unique<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID(), std::make_unique<WebCore::SoupNetworkSession>()); >-#elif USE(CURL) >- m_defaultNetworkStorageSession = std::make_unique<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID()); >-#endif >-} >- >-#if PLATFORM(COCOA) >-void NetworkProcess::ensureSession(const PAL::SessionID& sessionID, const String& identifierBase, RetainPtr<CFHTTPCookieStorageRef>&& cookieStorage) >-#else >-void NetworkProcess::ensureSession(const PAL::SessionID& sessionID, const String& identifierBase) >-#endif >-{ >- ASSERT(sessionID != PAL::SessionID::defaultSessionID()); >- >- auto addResult = m_networkStorageSessions.add(sessionID, nullptr); >- if (!addResult.isNewEntry) >- return; >- >-#if PLATFORM(COCOA) >- RetainPtr<CFURLStorageSessionRef> storageSession; >- RetainPtr<CFStringRef> cfIdentifier = String(identifierBase + ".PrivateBrowsing").createCFString(); >- if (sessionID.isEphemeral()) >- storageSession = adoptCF(createPrivateStorageSession(cfIdentifier.get())); >- else >- storageSession = WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier(cfIdentifier.get()); >- >- if (NetworkStorageSession::processMayUseCookieAPI()) { >- ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); >- if (!cookieStorage && storageSession) >- cookieStorage = adoptCF(_CFURLStorageSessionCopyCookieStorage(kCFAllocatorDefault, storageSession.get())); >- } >- >- addResult.iterator->value = std::make_unique<NetworkStorageSession>(sessionID, WTFMove(storageSession), WTFMove(cookieStorage)); >+ auto networkStorageSession = makeUniqueRef<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID(), WTFMove(session), WTFMove(cookieStorage)); > #elif USE(SOUP) >- addResult.iterator->value = std::make_unique<NetworkStorageSession>(sessionID, std::make_unique<SoupNetworkSession>(sessionID)); >+ auto networkStorageSession = makeUniqueRef<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID(), std::make_unique<WebCore::SoupNetworkSession>()); > #elif USE(CURL) >- addResult.iterator->value = std::make_unique<NetworkStorageSession>(sessionID); >+ auto networkStorageSession = makeUniqueRef<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID()); > #endif >+ networkSession->setNewTestingSession(WTFMove(networkStorageSession)); > } > > WebCore::NetworkStorageSession* NetworkProcess::storageSession(const PAL::SessionID& sessionID) const > { >- if (sessionID == PAL::SessionID::defaultSessionID()) >- return &defaultStorageSession(); >- return m_networkStorageSessions.get(sessionID); >+ if (auto* session = m_networkSessions.get(sessionID)) >+ return &session->networkStorageSession(); >+ return nullptr; > } > > WebCore::NetworkStorageSession& NetworkProcess::defaultStorageSession() const > { >- if (!m_defaultNetworkStorageSession) >- m_defaultNetworkStorageSession = platformCreateDefaultStorageSession(); >- return *m_defaultNetworkStorageSession; >+ auto* networkSession = m_networkSessions.get(PAL::SessionID::defaultSessionID()); >+ RELEASE_ASSERT(networkSession); >+ return networkSession->networkStorageSession(); > } > > void NetworkProcess::forEachNetworkStorageSession(const Function<void(WebCore::NetworkStorageSession&)>& functor) > { >- functor(defaultStorageSession()); >- for (auto& storageSession : m_networkStorageSessions.values()) >- functor(*storageSession); >+ for (auto& networkSession : m_networkSessions.values()) >+ functor(networkSession->networkStorageSession()); > } > > NetworkSession* NetworkProcess::networkSession(const PAL::SessionID& sessionID) const >@@ -553,7 +521,6 @@ void NetworkProcess::destroySession(cons > > if (auto session = m_networkSessions.take(sessionID)) > session->get().invalidateAndCancel(); >- m_networkStorageSessions.remove(sessionID); > m_sessionsControlledByAutomation.remove(sessionID); > CacheStorage::Engine::destroyEngine(*this, sessionID); > >Index: Source/WebKit/NetworkProcess/NetworkProcess.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.h (revision 241903) >+++ Source/WebKit/NetworkProcess/NetworkProcess.h (working copy) >@@ -147,11 +147,6 @@ public: > WebCore::NetworkStorageSession* storageSession(const PAL::SessionID&) const; > WebCore::NetworkStorageSession& defaultStorageSession() const; > void switchToNewTestingSession(); >-#if PLATFORM(COCOA) >- void ensureSession(const PAL::SessionID&, const String& identifier, RetainPtr<CFHTTPCookieStorageRef>&&); >-#else >- void ensureSession(const PAL::SessionID&, const String& identifier); >-#endif > > bool canHandleHTTPSServerTrustEvaluation() const { return m_canHandleHTTPSServerTrustEvaluation; } > >@@ -301,7 +296,6 @@ public: > > private: > void platformInitializeNetworkProcess(const NetworkProcessCreationParameters&); >- std::unique_ptr<WebCore::NetworkStorageSession> platformCreateDefaultStorageSession() const; > > void terminate() override; > void platformTerminate(); >@@ -452,8 +446,6 @@ private: > HashSet<PAL::SessionID> m_sessionsControlledByAutomation; > HashMap<PAL::SessionID, Vector<CacheStorageParametersCallback>> m_cacheStorageParametersCallbacks; > HashMap<PAL::SessionID, Ref<NetworkSession>> m_networkSessions; >- HashMap<PAL::SessionID, std::unique_ptr<WebCore::NetworkStorageSession>> m_networkStorageSessions; >- mutable std::unique_ptr<WebCore::NetworkStorageSession> m_defaultNetworkStorageSession; > NetworkBlobRegistry m_networkBlobRegistry; > > #if PLATFORM(COCOA) >Index: Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (revision 241903) >+++ Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (working copy) >@@ -49,9 +49,6 @@ void NetworkProcessCreationParameters::e > #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) > encoder << shouldEnableNetworkCacheSpeculativeRevalidation; > #endif >-#if PLATFORM(MAC) >- encoder << uiProcessCookieStorageIdentifier; >-#endif > #if PLATFORM(IOS_FAMILY) > encoder << cookieStorageDirectoryExtensionHandle; > encoder << containerCachesDirectoryExtensionHandle; >@@ -117,10 +114,6 @@ bool NetworkProcessCreationParameters::d > if (!decoder.decode(result.shouldEnableNetworkCacheSpeculativeRevalidation)) > return false; > #endif >-#if PLATFORM(MAC) >- if (!decoder.decode(result.uiProcessCookieStorageIdentifier)) >- return false; >-#endif > #if PLATFORM(IOS_FAMILY) > Optional<SandboxExtension::Handle> cookieStorageDirectoryExtensionHandle; > decoder >> cookieStorageDirectoryExtensionHandle; >Index: Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (revision 241903) >+++ Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (working copy) >@@ -60,9 +60,6 @@ struct NetworkProcessCreationParameters > #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) > bool shouldEnableNetworkCacheSpeculativeRevalidation { false }; > #endif >-#if PLATFORM(MAC) >- Vector<uint8_t> uiProcessCookieStorageIdentifier; >-#endif > #if PLATFORM(IOS_FAMILY) > SandboxExtension::Handle cookieStorageDirectoryExtensionHandle; > SandboxExtension::Handle containerCachesDirectoryExtensionHandle; >Index: Source/WebKit/NetworkProcess/NetworkSession.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkSession.cpp (revision 241903) >+++ Source/WebKit/NetworkProcess/NetworkSession.cpp (working copy) >@@ -35,6 +35,7 @@ > #include <WebCore/NetworkStorageSession.h> > > #if PLATFORM(COCOA) >+#include "CookieStorageUtilsCF.h" > #include "NetworkSessionCocoa.h" > #endif > #if USE(SOUP) >@@ -62,15 +63,51 @@ Ref<NetworkSession> NetworkSession::crea > > NetworkStorageSession& NetworkSession::networkStorageSession() const > { >- auto* storageSession = m_networkProcess->storageSession(m_sessionID); >- RELEASE_ASSERT(storageSession); >- return *storageSession; >+ return m_networkStorageSession.get(); > } > >-NetworkSession::NetworkSession(NetworkProcess& networkProcess, PAL::SessionID sessionID) >- : m_sessionID(sessionID) >+static UniqueRef<WebCore::NetworkStorageSession> createNetworkStorageSession(NetworkProcess& networkProcess, NetworkSessionCreationParameters& parameters) >+{ >+#if PLATFORM(COCOA) >+ RetainPtr<CFHTTPCookieStorageRef> cookieStorage; >+ if (!parameters.sessionID.isEphemeral() && !parameters.uiProcessCookieStorageIdentifier.isEmpty()) >+ cookieStorage = cookieStorageFromIdentifyingData(parameters.uiProcessCookieStorageIdentifier); >+ >+ String base = networkProcess.uiProcessBundleIdentifier(); >+ if (base.isNull()) >+ base = mainBundleIdentifier(); >+ String identifierBase = makeString(base, '.', parameters.sessionID.sessionID()); >+ >+ RetainPtr<CFURLStorageSessionRef> storageSession; >+ RetainPtr<CFStringRef> cfIdentifier = String(identifierBase + ".PrivateBrowsing").createCFString(); >+ if (parameters.sessionID.isEphemeral()) >+ storageSession = adoptCF(createPrivateStorageSession(cfIdentifier.get())); >+ else >+ storageSession = WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier(cfIdentifier.get()); >+ if (NetworkStorageSession::processMayUseCookieAPI()) { >+ ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); >+ if (!cookieStorage && storageSession) >+ cookieStorage = adoptCF(_CFURLStorageSessionCopyCookieStorage(kCFAllocatorDefault, storageSession.get())); >+ } >+#endif >+ >+ if (parameters.sessionID == PAL::SessionID::defaultSessionID()) { >+ return makeUniqueRef<WebCore::NetworkStorageSession>(parameters.sessionID >+#if PLATFORM(COCOA) >+ , WTFMove(storageSession), WTFMove(cookieStorage) >+#elif USE(SOUP) >+ , std::make_unique<SoupNetworkSession>(PAL::SessionID::defaultSessionID()) >+#endif >+ ); >+ } >+ return makeUniqueRef<WebCore::NetworkStorageSession>(parameters.sessionID); >+} >+ >+NetworkSession::NetworkSession(NetworkProcess& networkProcess, NetworkSessionCreationParameters& parameters) >+ : m_sessionID(parameters.sessionID) > , m_networkProcess(networkProcess) > , m_adClickAttribution(makeUniqueRef<NetworkAdClickAttribution>()) >+ , m_networkStorageSession(createNetworkStorageSession(networkProcess, parameters)) > { > } > >Index: Source/WebKit/NetworkProcess/NetworkSession.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkSession.h (revision 241903) >+++ Source/WebKit/NetworkProcess/NetworkSession.h (working copy) >@@ -80,8 +80,12 @@ public: > void dumpAdClickAttribution(CompletionHandler<void(String)>&&); > void clearAdClickAttribution(CompletionHandler<void()>&&); > >+ void setNewTestingSession(UniqueRef<WebCore::NetworkStorageSession>&& networkStorageSession) { m_networkStorageSession = WTFMove(networkStorageSession); } >+ >+ WebCore::NetworkStorageSession& networkStorageSession() { return m_networkStorageSession.get(); } >+ > protected: >- NetworkSession(NetworkProcess&, PAL::SessionID); >+ NetworkSession(NetworkProcess&, NetworkSessionCreationParameters&); > > PAL::SessionID m_sessionID; > Ref<NetworkProcess> m_networkProcess; >@@ -91,6 +95,9 @@ protected: > RefPtr<WebResourceLoadStatisticsStore> m_resourceLoadStatistics; > #endif > UniqueRef<NetworkAdClickAttribution> m_adClickAttribution; >+ UniqueRef<WebCore::NetworkStorageSession> m_networkStorageSession; > }; > >+String mainBundleIdentifier(); >+ > } // namespace WebKit >Index: Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp (revision 241903) >+++ Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp (working copy) >@@ -40,7 +40,7 @@ namespace WebKit { > > NetworkSessionCreationParameters NetworkSessionCreationParameters::privateSessionParameters(const PAL::SessionID& sessionID) > { >- return { sessionID, { }, AllowsCellularAccess::Yes >+ return { sessionID, { }, { }, AllowsCellularAccess::Yes > #if PLATFORM(COCOA) > , { }, { }, { }, false, { }, { }, { } > #endif >@@ -57,6 +57,7 @@ NetworkSessionCreationParameters Network > void NetworkSessionCreationParameters::encode(IPC::Encoder& encoder) const > { > encoder << sessionID; >+ encoder << uiProcessCookieStorageIdentifier; > encoder << boundInterfaceIdentifier; > encoder << allowsCellularAccess; > #if PLATFORM(COCOA) >@@ -87,6 +88,11 @@ Optional<NetworkSessionCreationParameter > if (!decoder.decode(sessionID)) > return WTF::nullopt; > >+ Optional<Vector<uint8_t>> uiProcessCookieStorageIdentifier; >+ decoder >> uiProcessCookieStorageIdentifier; >+ if (!uiProcessCookieStorageIdentifier) >+ return WTF::nullopt; >+ > Optional<String> boundInterfaceIdentifier; > decoder >> boundInterfaceIdentifier; > if (!boundInterfaceIdentifier) >@@ -174,6 +180,7 @@ Optional<NetworkSessionCreationParameter > > return {{ > sessionID >+ , WTFMove(*uiProcessCookieStorageIdentifier) > , WTFMove(*boundInterfaceIdentifier) > , WTFMove(*allowsCellularAccess) > #if PLATFORM(COCOA) >Index: Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h (revision 241903) >+++ Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h (working copy) >@@ -59,6 +59,7 @@ struct NetworkSessionCreationParameters > static NetworkSessionCreationParameters privateSessionParameters(const PAL::SessionID&); > > PAL::SessionID sessionID { PAL::SessionID::defaultSessionID() }; >+ Vector<uint8_t> uiProcessCookieStorageIdentifier; > String boundInterfaceIdentifier; > AllowsCellularAccess allowsCellularAccess { AllowsCellularAccess::Yes }; > #if PLATFORM(COCOA) >Index: Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (revision 241903) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (working copy) >@@ -94,7 +94,7 @@ void NetworkProcess::platformInitializeN > initializeNetworkSettings(); > > #if PLATFORM(MAC) >- setSharedHTTPCookieStorage(parameters.uiProcessCookieStorageIdentifier); >+ setSharedHTTPCookieStorage(parameters.defaultDataStoreParameters.networkSessionParameters.uiProcessCookieStorageIdentifier); > #endif > > WebCore::NetworkStorageSession::setStorageAccessAPIEnabled(parameters.storageAccessAPIEnabled); >@@ -130,11 +130,6 @@ void NetworkProcess::platformInitializeN > [NSURLCache setSharedURLCache:urlCache.get()]; > } > >-std::unique_ptr<WebCore::NetworkStorageSession> NetworkProcess::platformCreateDefaultStorageSession() const >-{ >- return std::make_unique<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID()); >-} >- > RetainPtr<CFDataRef> NetworkProcess::sourceApplicationAuditData() const > { > #if USE(SOURCE_APPLICATION_AUDIT_DATA) >Index: Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (revision 241903) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (working copy) >@@ -786,6 +786,11 @@ - (void)URLSession:(NSURLSession *)sessi > > namespace WebKit { > >+String mainBundleIdentifier() >+{ >+ return [[NSBundle mainBundle] bundleIdentifier]; >+} >+ > #if !ASSERT_DISABLED > static bool sessionsCreated = false; > #endif >@@ -845,7 +850,7 @@ static NSDictionary *proxyDictionary(con > } > > NetworkSessionCocoa::NetworkSessionCocoa(NetworkProcess& networkProcess, NetworkSessionCreationParameters&& parameters) >- : NetworkSession(networkProcess, parameters.sessionID) >+ : NetworkSession(networkProcess, parameters) > , m_boundInterfaceIdentifier(parameters.boundInterfaceIdentifier) > , m_proxyConfiguration(parameters.proxyConfiguration) > , m_shouldLogCookieInformation(parameters.shouldLogCookieInformation) >Index: Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp (revision 241903) >+++ Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp (working copy) >@@ -38,7 +38,7 @@ namespace WebKit { > using namespace WebCore; > > NetworkSessionCurl::NetworkSessionCurl(NetworkProcess& networkProcess, NetworkSessionCreationParameters&& parameters) >- : NetworkSession(networkProcess, parameters.sessionID) >+ : NetworkSession(networkProcess, parameters) > { > if (!parameters.cookiePersistentStorageFile.isEmpty()) > networkStorageSession().setCookieDatabase(makeUniqueRef<CookieJarDB>(parameters.cookiePersistentStorageFile)); >Index: Source/WebKit/NetworkProcess/mac/RemoteNetworkingContext.mm >=================================================================== >--- Source/WebKit/NetworkProcess/mac/RemoteNetworkingContext.mm (revision 241903) >+++ Source/WebKit/NetworkProcess/mac/RemoteNetworkingContext.mm (working copy) >@@ -47,19 +47,9 @@ void RemoteNetworkingContext::ensureWebs > if (networkProcess.storageSession(sessionID)) > return; > >- String base = networkProcess.uiProcessBundleIdentifier(); >- if (base.isNull()) >- base = [[NSBundle mainBundle] bundleIdentifier]; >- > if (!sessionID.isEphemeral()) > SandboxExtension::consumePermanently(parameters.cookieStoragePathExtensionHandle); > >- RetainPtr<CFHTTPCookieStorageRef> uiProcessCookieStorage; >- if (!sessionID.isEphemeral() && !parameters.uiProcessCookieStorageIdentifier.isEmpty()) >- uiProcessCookieStorage = cookieStorageFromIdentifyingData(parameters.uiProcessCookieStorageIdentifier); >- >- networkProcess.ensureSession(sessionID, makeString(base, '.', sessionID.sessionID()), WTFMove(uiProcessCookieStorage)); >- > auto* session = networkProcess.storageSession(sessionID); > for (const auto& cookie : parameters.pendingCookies) > session->setCookie(cookie); >Index: Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp (revision 241903) >+++ Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp (working copy) >@@ -129,11 +129,6 @@ void NetworkProcess::platformInitializeN > setIgnoreTLSErrors(parameters.ignoreTLSErrors); > } > >-std::unique_ptr<WebCore::NetworkStorageSession> NetworkProcess::platformCreateDefaultStorageSession() const >-{ >- return std::make_unique<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID(), std::make_unique<SoupNetworkSession>(PAL::SessionID::defaultSessionID())); >-} >- > void NetworkProcess::setIgnoreTLSErrors(bool ignoreTLSErrors) > { > SoupNetworkSession::setShouldIgnoreTLSErrors(ignoreTLSErrors); >Index: Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp (revision 241903) >+++ Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp (working copy) >@@ -37,7 +37,7 @@ namespace WebKit { > using namespace WebCore; > > NetworkSessionSoup::NetworkSessionSoup(NetworkProcess& networkProcess, NetworkSessionCreationParameters&& parameters) >- : NetworkSession(networkProcess, parameters.sessionID) >+ : NetworkSession(networkProcess, parameters) > { > networkStorageSession().setCookieObserverHandler([this] { > this->networkProcess().supplement<WebCookieManager>()->notifyCookiesDidChange(m_sessionID); >Index: Source/WebKit/Shared/WebsiteDataStoreParameters.cpp >=================================================================== >--- Source/WebKit/Shared/WebsiteDataStoreParameters.cpp (revision 241903) >+++ Source/WebKit/Shared/WebsiteDataStoreParameters.cpp (working copy) >@@ -38,7 +38,6 @@ WebsiteDataStoreParameters::~WebsiteData > void WebsiteDataStoreParameters::encode(IPC::Encoder& encoder) const > { > encoder << networkSessionParameters; >- encoder << uiProcessCookieStorageIdentifier; > encoder << cookieStoragePathExtensionHandle; > encoder << pendingCookies; > >@@ -64,12 +63,6 @@ Optional<WebsiteDataStoreParameters> Web > return WTF::nullopt; > parameters.networkSessionParameters = WTFMove(*networkSessionParameters); > >- Optional<Vector<uint8_t>> uiProcessCookieStorageIdentifier; >- decoder >> uiProcessCookieStorageIdentifier; >- if (!uiProcessCookieStorageIdentifier) >- return WTF::nullopt; >- parameters.uiProcessCookieStorageIdentifier = WTFMove(*uiProcessCookieStorageIdentifier); >- > Optional<SandboxExtension::Handle> cookieStoragePathExtensionHandle; > decoder >> cookieStoragePathExtensionHandle; > if (!cookieStoragePathExtensionHandle) >@@ -124,7 +117,7 @@ Optional<WebsiteDataStoreParameters> Web > WebsiteDataStoreParameters WebsiteDataStoreParameters::privateSessionParameters(PAL::SessionID sessionID) > { > ASSERT(sessionID.isEphemeral()); >- return { { }, { }, { }, NetworkSessionCreationParameters::privateSessionParameters(sessionID) >+ return { { }, { }, NetworkSessionCreationParameters::privateSessionParameters(sessionID) > #if ENABLE(INDEXED_DATABASE) > , { }, { } > #if PLATFORM(IOS_FAMILY) >Index: Source/WebKit/Shared/WebsiteDataStoreParameters.h >=================================================================== >--- Source/WebKit/Shared/WebsiteDataStoreParameters.h (revision 241903) >+++ Source/WebKit/Shared/WebsiteDataStoreParameters.h (working copy) >@@ -51,7 +51,6 @@ struct WebsiteDataStoreParameters { > void encode(IPC::Encoder&) const; > static Optional<WebsiteDataStoreParameters> decode(IPC::Decoder&); > >- Vector<uint8_t> uiProcessCookieStorageIdentifier; > SandboxExtension::Handle cookieStoragePathExtensionHandle; > Vector<WebCore::Cookie> pendingCookies; > NetworkSessionCreationParameters networkSessionParameters; >Index: Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (revision 241903) >+++ Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (working copy) >@@ -285,9 +285,9 @@ void WebProcessPool::platformInitializeN > parameters.shouldSuppressMemoryPressureHandler = [defaults boolForKey:WebKitSuppressMemoryPressureHandlerDefaultsKey]; > > #if PLATFORM(MAC) >- ASSERT(parameters.uiProcessCookieStorageIdentifier.isEmpty()); >+ ASSERT(parameters.defaultDataStoreParameters.networkSessionParameters.uiProcessCookieStorageIdentifier.isEmpty()); > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); >- parameters.uiProcessCookieStorageIdentifier = identifyingDataFromCookieStorage([[NSHTTPCookieStorage sharedHTTPCookieStorage] _cookieStorage]); >+ parameters.defaultDataStoreParameters.networkSessionParameters.uiProcessCookieStorageIdentifier = identifyingDataFromCookieStorage([[NSHTTPCookieStorage sharedHTTPCookieStorage] _cookieStorage]); > #endif > > parameters.storageAccessAPIEnabled = storageAccessAPIEnabled(); >Index: Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm >=================================================================== >--- Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (revision 241903) >+++ Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (working copy) >@@ -91,6 +91,7 @@ WebsiteDataStoreParameters WebsiteDataSt > WebsiteDataStoreParameters parameters; > parameters.networkSessionParameters = { > m_sessionID, >+ m_uiProcessCookieStorageIdentifier, > m_boundInterfaceIdentifier, > m_allowsCellularAccess, > m_proxyConfiguration, >@@ -114,7 +115,7 @@ WebsiteDataStoreParameters WebsiteDataSt > m_uiProcessCookieStorageIdentifier = identifyingDataFromCookieStorage(m_cfCookieStorage.get()); > } > >- parameters.uiProcessCookieStorageIdentifier = m_uiProcessCookieStorageIdentifier; >+ parameters.networkSessionParameters.uiProcessCookieStorageIdentifier = m_uiProcessCookieStorageIdentifier; > parameters.networkSessionParameters.sourceApplicationBundleIdentifier = m_configuration->sourceApplicationBundleIdentifier(); > parameters.networkSessionParameters.sourceApplicationSecondaryIdentifier = m_configuration->sourceApplicationSecondaryIdentifier(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194926
: 362677