WebKit Bugzilla
Attachment 359823 Details for
Bug 193700
: Stop using NetworkProcess::singleton
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193700-20190122175534.patch (text/plain), 9.77 KB, created by
Alex Christensen
on 2019-01-22 17:55:35 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-01-22 17:55:35 PST
Size:
9.77 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 240314) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,27 @@ >+2019-01-22 Alex Christensen <achristensen@webkit.org> >+ >+ Stop using NetworkProcess::singleton >+ https://bugs.webkit.org/show_bug.cgi?id=193700 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This replaces it with a NeverDestroyed<Ref<NetworkProcess>> and paves the way for more interesting things. >+ >+ * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp: >+ * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: >+ (WebKit::initializeChildProcess<WebKit::NetworkProcess>): >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::NetworkProcess): >+ (WebKit::NetworkProcess::singleton): Deleted. >+ * NetworkProcess/NetworkProcess.h: >+ * NetworkProcess/soup/NetworkProcessMainSoup.cpp: >+ (WebKit::initializeChildProcess<WebKit::NetworkProcess>): >+ * NetworkProcess/win/NetworkProcessMainWin.cpp: >+ (WebKit::initializeChildProcess<WebKit::NetworkProcess>): >+ * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: >+ (WebKit::initializeChildProcess): >+ (WebKit::XPCServiceInitializer): >+ > 2019-01-22 Alex Christensen <achristensen@webkit.org> > > Fix an internal build failure after r240292 >Index: Source/WebKit/NetworkProcess/NetworkProcess.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.cpp (revision 240295) >+++ Source/WebKit/NetworkProcess/NetworkProcess.cpp (working copy) >@@ -117,28 +117,7 @@ static void callExitSoon(IPC::Connection > }); > } > >-NetworkProcess& NetworkProcess::singleton() >-{ >- static NeverDestroyed<Ref<NetworkProcess>> networkProcess(adoptRef(*new NetworkProcess)); >- return networkProcess.get(); >-} >- >-NetworkProcess::NetworkProcess() >- : m_hasSetCacheModel(false) >- , m_cacheModel(CacheModel::DocumentViewer) >- , m_diskCacheIsDisabledForTesting(false) >- , m_canHandleHTTPSServerTrustEvaluation(true) >- , m_downloadManager(*this) >-#if PLATFORM(COCOA) >- , m_clearCacheDispatchGroup(0) >-#endif >-#if ENABLE(CONTENT_EXTENSIONS) >- , m_networkContentRuleListManager(*this) >-#endif >- , m_storageTaskQueue(WorkQueue::create("com.apple.WebKit.StorageTask")) >-#if ENABLE(INDEXED_DATABASE) >- , m_idbPerOriginQuota(IDBServer::defaultPerOriginQuota) >-#endif >+NetworkProcess::NetworkProcess(ChildProcessInitializationParameters&& parameters) > { > NetworkProcessPlatformStrategies::initialize(); > >@@ -166,6 +145,8 @@ NetworkProcess::NetworkProcess() > for (auto& webProcessConnection : webProcessConnections) > webProcessConnection->setOnLineState(isOnLine); > }); >+ >+ initialize(WTFMove(parameters)); > } > > NetworkProcess::~NetworkProcess() >Index: Source/WebKit/NetworkProcess/NetworkProcess.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.h (revision 240292) >+++ Source/WebKit/NetworkProcess/NetworkProcess.h (working copy) >@@ -106,8 +106,8 @@ class NetworkProcess : public ChildProce > { > WTF_MAKE_NONCOPYABLE(NetworkProcess); > public: >+ NetworkProcess(ChildProcessInitializationParameters&&); > ~NetworkProcess(); >- static NetworkProcess& singleton(); > static constexpr ProcessType processType = ProcessType::Network; > > template <typename T> >@@ -286,8 +286,6 @@ public: > void requestCacheStorageSpace(PAL::SessionID, const WebCore::ClientOrigin&, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&&); > > private: >- NetworkProcess(); >- > void platformInitializeNetworkProcess(const NetworkProcessCreationParameters&); > > void terminate() override; >@@ -422,13 +420,13 @@ private: > Vector<RefPtr<NetworkConnectionToWebProcess>> m_webProcessConnections; > > String m_diskCacheDirectory; >- bool m_hasSetCacheModel; >+ bool m_hasSetCacheModel { false }; > CacheModel m_cacheModel; > bool m_suppressMemoryPressureHandler { false }; >- bool m_diskCacheIsDisabledForTesting; >- bool m_canHandleHTTPSServerTrustEvaluation; >+ bool m_diskCacheIsDisabledForTesting { false }; >+ bool m_canHandleHTTPSServerTrustEvaluation { true }; > String m_uiProcessBundleIdentifier; >- DownloadManager m_downloadManager; >+ DownloadManager m_downloadManager { *this }; > > HashMap<PAL::SessionID, Ref<CacheStorage::Engine>> m_cacheEngines; > >@@ -450,21 +448,21 @@ private: > // FIXME: We'd like to be able to do this without the #ifdef, but WorkQueue + BinarySemaphore isn't good enough since > // multiple requests to clear the cache can come in before previous requests complete, and we need to wait for all of them. > // In the future using WorkQueue and a counting semaphore would work, as would WorkQueue supporting the libdispatch concept of "work groups". >- dispatch_group_t m_clearCacheDispatchGroup; >+ dispatch_group_t m_clearCacheDispatchGroup { nullptr }; > > bool m_suppressesConnectionTerminationOnSystemChange { false }; > #endif > > #if ENABLE(CONTENT_EXTENSIONS) >- NetworkContentRuleListManager m_networkContentRuleListManager; >+ NetworkContentRuleListManager m_networkContentRuleListManager { *this }; > #endif > >- Ref<WorkQueue> m_storageTaskQueue; >+ Ref<WorkQueue> m_storageTaskQueue { WorkQueue::create("com.apple.WebKit.StorageTask") }; > > #if ENABLE(INDEXED_DATABASE) > HashMap<PAL::SessionID, String> m_idbDatabasePaths; > HashMap<PAL::SessionID, RefPtr<WebCore::IDBServer::IDBServer>> m_idbServers; >- uint64_t m_idbPerOriginQuota; >+ uint64_t m_idbPerOriginQuota { WebCore::IDBServer::defaultPerOriginQuota }; > #endif > > Deque<CrossThreadTask> m_storageTasks; >Index: Source/WebKit/NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp (revision 240292) >+++ Source/WebKit/NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp (working copy) >@@ -74,7 +74,7 @@ private: > void startRequest(GRefPtr<GTask>&& task) override > { > WebKitSoupRequestGeneric* request = WEBKIT_SOUP_REQUEST_GENERIC(g_task_get_source_object(task.get())); >- auto* customProtocolManager = NetworkProcess::singleton().supplement<LegacyCustomProtocolManager>(); >+ auto* customProtocolManager = lastCreatedNetworkProcess()->supplement<LegacyCustomProtocolManager>(); > if (!customProtocolManager) > return; > >Index: Source/WebKit/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm >=================================================================== >--- Source/WebKit/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm (revision 240291) >+++ Source/WebKit/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm (working copy) >@@ -40,6 +40,12 @@ public: > } > }; > >+template<> >+void initializeChildProcess<WebKit::NetworkProcess>(ChildProcessInitializationParameters&& parameters) >+{ >+ static NeverDestroyed<Ref<NetworkProcess>> networkProcess(adoptRef(*new NetworkProcess(WTFMove(parameters)))); >+} >+ > } // namespace WebKit > > using namespace WebKit; >Index: Source/WebKit/NetworkProcess/soup/NetworkProcessMainSoup.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/soup/NetworkProcessMainSoup.cpp (revision 240292) >+++ Source/WebKit/NetworkProcess/soup/NetworkProcessMainSoup.cpp (working copy) >@@ -33,6 +33,12 @@ > > namespace WebKit { > >+template<> >+void initializeChildProcess<WebKit::NetworkProcess>(ChildProcessInitializationParameters&& parameters) >+{ >+ static NeverDestroyed<Ref<NetworkProcess>> networkProcess(adoptRef(*new NetworkProcess(WTFMove(parameters)))); >+} >+ > class NetworkProcessMain final: public ChildProcessMainBase { > public: > void platformFinalize() override >Index: Source/WebKit/NetworkProcess/win/NetworkProcessMainWin.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/win/NetworkProcessMainWin.cpp (revision 240291) >+++ Source/WebKit/NetworkProcess/win/NetworkProcessMainWin.cpp (working copy) >@@ -31,6 +31,12 @@ > > namespace WebKit { > >+template<> >+void initializeChildProcess<WebKit::NetworkProcess>(ChildProcessInitializationParameters&& parameters) >+{ >+ static NeverDestroyed<Ref<NetworkProcess>> networkProcess(adoptRef(*new NetworkProcess(WTFMove(parameters)))); >+} >+ > int NetworkProcessMainWin(int argc, char** argv) > { > return ChildProcessMain<NetworkProcess, ChildProcessMainBase>(argc, argv); >Index: Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h >=================================================================== >--- Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h (revision 240291) >+++ Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h (working copy) >@@ -67,6 +67,12 @@ protected: > xpc_object_t m_initializerMessage; > }; > >+template<typename XPCServiceType> >+void initializeChildProcess(ChildProcessInitializationParameters&& parameters) >+{ >+ XPCServiceType::singleton().initialize(parameters); >+} >+ > template<typename XPCServiceType, typename XPCServiceInitializerDelegateType> > void XPCServiceInitializer(OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage) > { >@@ -119,7 +125,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END > > parameters.processType = XPCServiceType::processType; > >- XPCServiceType::singleton().initialize(parameters); >+ initializeChildProcess<XPCServiceType>(WTFMove(parameters)); > } > > int XPCServiceMain(int, const char**);
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 193700
:
359823
|
359829
|
359838
|
359847
|
359944