Rename shared() static member functions to singleton() for singleton classes.
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jan 2015 20:49:33 +0000 (20:49 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jan 2015 20:49:33 +0000 (20:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141088

Reviewed by Ryosuke Niwa and Benjamin Poulain.

Rename shared() static member functions to singleton() for singleton
classes as per the recent coding style change.
Source/JavaScriptCore:

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::singleton):
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::shared): Deleted.
* inspector/remote/RemoteInspectorDebuggable.cpp:
(Inspector::RemoteInspectorDebuggable::~RemoteInspectorDebuggable):
(Inspector::RemoteInspectorDebuggable::init):
(Inspector::RemoteInspectorDebuggable::update):
(Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
(Inspector::RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection):
(Inspector::RemoteInspectorDebuggable::unpauseForInitializedInspector):
* inspector/remote/RemoteInspectorDebuggableConnection.mm:
(Inspector::RemoteInspectorDebuggableConnection::setup):
(Inspector::RemoteInspectorDebuggableConnection::sendMessageToFrontend):

Source/WebKit:

* Storage/WebDatabaseProvider.cpp:
(WebDatabaseProvider::singleton):
(WebDatabaseProvider::shared): Deleted.
* Storage/WebDatabaseProvider.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@179409 268f45cc-cd09-0410-ab3c-d52691b4dbfc

281 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/remote/RemoteInspector.h
Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm
Source/WebCore/ChangeLog
Source/WebCore/Modules/gamepad/GamepadManager.cpp
Source/WebCore/Modules/gamepad/GamepadManager.h
Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp
Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp
Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp
Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
Source/WebCore/crypto/CryptoAlgorithmRegistry.h
Source/WebCore/crypto/CryptoKey.cpp
Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp
Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp
Source/WebCore/history/BackForwardList.cpp
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/history/HistoryItem.cpp
Source/WebCore/history/PageCache.cpp
Source/WebCore/history/PageCache.h
Source/WebCore/loader/CrossOriginPreflightResultCache.cpp
Source/WebCore/loader/CrossOriginPreflightResultCache.h
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/HistoryController.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DebugPageOverlays.cpp
Source/WebCore/page/DebugPageOverlays.h
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/PageGroup.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/scrolling/ScrollingThread.cpp
Source/WebCore/page/scrolling/ScrollingThread.h
Source/WebCore/platform/GamepadProvider.cpp
Source/WebCore/platform/GamepadProvider.h
Source/WebCore/platform/MemoryPressureHandler.cpp
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/LayerChangesFlusher.cpp
Source/WebCore/platform/graphics/ca/win/LayerChangesFlusher.h
Source/WebCore/platform/ios/wak/FloatingPointEnvironment.cpp
Source/WebCore/platform/ios/wak/FloatingPointEnvironment.h
Source/WebCore/platform/ios/wak/WebCoreThread.mm
Source/WebCore/platform/mac/HIDGamepadProvider.cpp
Source/WebCore/platform/mac/HIDGamepadProvider.h
Source/WebCore/platform/mediastream/MediaStreamCenter.cpp
Source/WebCore/platform/mediastream/MediaStreamCenter.h
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm
Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.cpp
Source/WebCore/platform/network/DNSResolveQueue.cpp
Source/WebCore/platform/network/DNSResolveQueue.h
Source/WebCore/platform/network/cf/DNSCFNet.cpp
Source/WebCore/platform/network/soup/DNSSoup.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/MockPageOverlayClient.cpp
Source/WebCore/testing/MockPageOverlayClient.h
Source/WebCore/workers/WorkerThread.cpp
Source/WebKit/ChangeLog
Source/WebKit/Storage/WebDatabaseProvider.cpp
Source/WebKit/Storage/WebDatabaseProvider.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/History/WebBackForwardList.mm
Source/WebKit/mac/Misc/WebCache.mm
Source/WebKit/mac/Misc/WebCoreStatistics.mm
Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
Source/WebKit/mac/Plugins/WebNetscapePluginPackage.mm
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCache.cpp
Source/WebKit/win/WebCoreStatistics.cpp
Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp
Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.h
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/DatabaseProcess/DatabaseProcess.h
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit2/NetworkProcess/NetworkProcess.cpp
Source/WebKit2/NetworkProcess/NetworkProcess.h
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCache.h
Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm
Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm
Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
Source/WebKit2/PluginProcess/PluginProcess.cpp
Source/WebKit2/PluginProcess/PluginProcess.h
Source/WebKit2/PluginProcess/WebProcessConnection.cpp
Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm
Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm
Source/WebKit2/Shared/ConnectionStack.cpp
Source/WebKit2/Shared/ConnectionStack.h
Source/WebKit2/Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.h
Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h
Source/WebKit2/Shared/WebMemorySampler.cpp
Source/WebKit2/Shared/WebMemorySampler.h
Source/WebKit2/Shared/ios/ChildProcessIOS.mm
Source/WebKit2/Shared/linux/SeccompFilters/SeccompBroker.cpp
Source/WebKit2/Shared/mac/CookieStorageShim.h
Source/WebKit2/Shared/mac/CookieStorageShim.mm
Source/WebKit2/Shared/mac/SecItemShim.cpp
Source/WebKit2/Shared/mac/SecItemShim.h
Source/WebKit2/Shared/unix/ChildProcessMain.h
Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp
Source/WebKit2/UIProcess/API/efl/ewk_main.cpp
Source/WebKit2/UIProcess/API/efl/ewk_main_private.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.cpp
Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.h
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp
Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp
Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.h
Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPasteboardProxy.cpp
Source/WebKit2/UIProcess/WebPasteboardProxy.h
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebTextChecker.cpp
Source/WebKit2/UIProcess/WebTextChecker.h
Source/WebKit2/UIProcess/efl/EwkDebug.h
Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp
Source/WebKit2/UIProcess/efl/WebContextEfl.cpp
Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp
Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp
Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.h
Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.mm
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/mac/SecItemShimProxy.cpp
Source/WebKit2/UIProcess/mac/SecItemShimProxy.h
Source/WebKit2/UIProcess/mac/ServicesController.h
Source/WebKit2/UIProcess/mac/ServicesController.mm
Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h
Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm
Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm
Source/WebKit2/UIProcess/mac/WindowServerConnection.h
Source/WebKit2/UIProcess/mac/WindowServerConnection.mm
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp
Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.cpp
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp
Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebGeolocationClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlugInClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebVibrationClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm
Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp
Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.cpp
Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp
Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp
Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
Source/WebKit2/WebProcess/WebPage/WebInspectorUI.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp
Source/WebKit2/WebProcess/WebPage/gtk/PrinterListGtk.cpp
Source/WebKit2/WebProcess/WebPage/gtk/PrinterListGtk.h
Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm
Source/WebKit2/WebProcess/efl/ExtensionManagerEfl.cpp
Source/WebKit2/WebProcess/efl/ExtensionManagerEfl.h
Source/WebKit2/WebProcess/efl/WebInjectedBundleMainEfl.cpp
Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.cpp
Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h
Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp
Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.cpp
Tools/DumpRenderTree/WorkQueue.cpp
Tools/DumpRenderTree/WorkQueue.h
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
Tools/DumpRenderTree/mac/TestRunnerMac.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Tools/DumpRenderTree/win/FrameLoadDelegate.cpp
Tools/DumpRenderTree/win/TestRunnerWin.cpp
Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
Tools/TestWebKitAPI/InjectedBundleController.cpp
Tools/TestWebKitAPI/InjectedBundleController.h
Tools/TestWebKitAPI/InjectedBundleMain.cpp
Tools/TestWebKitAPI/InjectedBundleTest.h
Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
Tools/TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp
Tools/TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp
Tools/TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
Tools/TestWebKitAPI/TestsController.cpp
Tools/TestWebKitAPI/TestsController.h
Tools/TestWebKitAPI/efl/main.cpp
Tools/TestWebKitAPI/gtk/main.cpp
Tools/TestWebKitAPI/ios/mainIOS.mm
Tools/TestWebKitAPI/mac/mainMac.mm
Tools/TestWebKitAPI/win/main.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp
Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
Tools/WebKitTestRunner/InjectedBundle/GCController.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
Tools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TextInputController.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm
Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/WorkQueueManager.cpp
Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp
Tools/WebKitTestRunner/cg/TestInvocationCG.cpp
Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm
Tools/WebKitTestRunner/mac/WebKitTestRunnerEvent.mm

index 7481ff8..dfa4d3c 100644 (file)
@@ -1,3 +1,29 @@
+2015-01-30  Chris Dumez  <cdumez@apple.com>
+
+        Rename shared() static member functions to singleton() for singleton classes.
+        https://bugs.webkit.org/show_bug.cgi?id=141088
+
+        Reviewed by Ryosuke Niwa and Benjamin Poulain.
+
+        Rename shared() static member functions to singleton() for singleton
+        classes as per the recent coding style change.
+
+        * inspector/remote/RemoteInspector.h:
+        * inspector/remote/RemoteInspector.mm:
+        (Inspector::RemoteInspector::singleton):
+        (Inspector::RemoteInspector::start):
+        (Inspector::RemoteInspector::shared): Deleted.
+        * inspector/remote/RemoteInspectorDebuggable.cpp:
+        (Inspector::RemoteInspectorDebuggable::~RemoteInspectorDebuggable):
+        (Inspector::RemoteInspectorDebuggable::init):
+        (Inspector::RemoteInspectorDebuggable::update):
+        (Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
+        (Inspector::RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection):
+        (Inspector::RemoteInspectorDebuggable::unpauseForInitializedInspector):
+        * inspector/remote/RemoteInspectorDebuggableConnection.mm:
+        (Inspector::RemoteInspectorDebuggableConnection::setup):
+        (Inspector::RemoteInspectorDebuggableConnection::sendMessageToFrontend):
+
 2015-01-30  Geoffrey Garen  <ggaren@apple.com>
 
         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
index 0dffc28..2cd8519 100644 (file)
@@ -46,7 +46,7 @@ struct RemoteInspectorDebuggableInfo;
 class JS_EXPORT_PRIVATE RemoteInspector final : public RemoteInspectorXPCConnection::Client {
 public:
     static void startDisabled();
-    static RemoteInspector& shared();
+    static RemoteInspector& singleton();
     friend class NeverDestroyed<RemoteInspector>;
 
     void registerDebuggable(RemoteInspectorDebuggable*);
index c8a39e6..46d5044 100644 (file)
@@ -91,7 +91,7 @@ void RemoteInspector::startDisabled()
     RemoteInspector::startEnabled = false;
 }
 
-RemoteInspector& RemoteInspector::shared()
+RemoteInspector& RemoteInspector::singleton()
 {
     static NeverDestroyed<RemoteInspector> shared;
 
@@ -309,7 +309,7 @@ void RemoteInspector::start()
     });
 
     notify_register_dispatch(WIRServiceAvailableNotification, &m_notifyToken, m_xpcQueue, ^(int) {
-        RemoteInspector::shared().setupXPCConnectionIfNeeded();
+        RemoteInspector::singleton().setupXPCConnectionIfNeeded();
     });
 
     notify_post(WIRServiceAvailabilityCheckNotification);
index dfee0eb..ac83a18 100644 (file)
@@ -42,17 +42,17 @@ RemoteInspectorDebuggable::RemoteInspectorDebuggable()
 
 RemoteInspectorDebuggable::~RemoteInspectorDebuggable()
 {
-    RemoteInspector::shared().unregisterDebuggable(this);
+    RemoteInspector::singleton().unregisterDebuggable(this);
 }
 
 void RemoteInspectorDebuggable::init()
 {
-    RemoteInspector::shared().registerDebuggable(this);
+    RemoteInspector::singleton().registerDebuggable(this);
 }
 
 void RemoteInspectorDebuggable::update()
 {
-    RemoteInspector::shared().updateDebuggable(this);
+    RemoteInspector::singleton().updateDebuggable(this);
 }
 
 void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed)
@@ -63,9 +63,9 @@ void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed)
     m_allowed = allowed;
 
     if (m_allowed && automaticInspectionAllowed())
-        RemoteInspector::shared().updateDebuggableAutomaticInspectCandidate(this);
+        RemoteInspector::singleton().updateDebuggableAutomaticInspectCandidate(this);
     else
-        RemoteInspector::shared().updateDebuggable(this);
+        RemoteInspector::singleton().updateDebuggable(this);
 }
 
 RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const
@@ -87,13 +87,13 @@ void RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection()
     ASSERT(automaticInspectionAllowed());
 
     EventLoop loop;
-    while (RemoteInspector::shared().waitingForAutomaticInspection(identifier()) && !loop.ended())
+    while (RemoteInspector::singleton().waitingForAutomaticInspection(identifier()) && !loop.ended())
         loop.cycle();
 }
 
 void RemoteInspectorDebuggable::unpauseForInitializedInspector()
 {
-    RemoteInspector::shared().setupCompleted(identifier());
+    RemoteInspector::singleton().setupCompleted(identifier());
 }
 
 } // namespace Inspector
index a97dcbb..8e79a56 100644 (file)
@@ -161,7 +161,7 @@ bool RemoteInspectorDebuggableConnection::setup(bool isAutomaticInspection)
         {
             std::lock_guard<std::mutex> lock(m_debuggableMutex);
             if (!m_debuggable || !m_debuggable->remoteDebuggingAllowed() || m_debuggable->hasLocalDebugger()) {
-                RemoteInspector::shared().setupFailed(identifier());
+                RemoteInspector::singleton().setupFailed(identifier());
                 m_debuggable = nullptr;
             } else {
                 m_debuggable->connect(this, isAutomaticInspection);
@@ -220,7 +220,7 @@ void RemoteInspectorDebuggableConnection::sendMessageToBackend(NSString *message
 
 bool RemoteInspectorDebuggableConnection::sendMessageToFrontend(const String& message)
 {
-    RemoteInspector::shared().sendMessageToRemoteFrontend(identifier(), message);
+    RemoteInspector::singleton().sendMessageToRemoteFrontend(identifier(), message);
 
     return true;
 }
index 7d21697..613daac 100644 (file)
@@ -1,3 +1,13 @@
+2015-01-30  Chris Dumez  <cdumez@apple.com>
+
+        Rename shared() static member functions to singleton() for singleton classes.
+        https://bugs.webkit.org/show_bug.cgi?id=141088
+
+        Reviewed by Ryosuke Niwa and Benjamin Poulain.
+
+        Rename shared() static member functions to singleton() for singleton
+        classes as per the recent coding style change.
+
 2015-01-30  Matthew Mirman  <mmirman@apple.com>
 
         Added ClientRect as an interface that requires attributes 
index c3e086f..68c7d04 100644 (file)
@@ -47,7 +47,7 @@ static NavigatorGamepad* navigatorGamepadFromDOMWindow(DOMWindow* window)
     return NavigatorGamepad::from(navigator);
 }
 
-GamepadManager& GamepadManager::shared()
+GamepadManager& GamepadManager::singleton()
 {
     static NeverDestroyed<GamepadManager> sharedManager;
     return sharedManager;
@@ -61,7 +61,7 @@ GamepadManager::GamepadManager()
 void GamepadManager::platformGamepadConnected(PlatformGamepad& platformGamepad)
 {
     // Notify blind Navigators and Windows about all gamepads except for this one.
-    for (auto* gamepad : GamepadProvider::shared().platformGamepads()) {
+    for (auto* gamepad : GamepadProvider::singleton().platformGamepads()) {
         if (!gamepad || gamepad == &platformGamepad)
             continue;
 
@@ -119,7 +119,7 @@ void GamepadManager::platformGamepadInputActivity()
     if (m_gamepadBlindNavigators.isEmpty() && m_gamepadBlindDOMWindows.isEmpty())
         return;
 
-    for (auto* gamepad : GamepadProvider::shared().platformGamepads())
+    for (auto* gamepad : GamepadProvider::singleton().platformGamepads())
         makeGamepadVisible(*gamepad, m_gamepadBlindNavigators, m_gamepadBlindDOMWindows);
 
     m_gamepadBlindNavigators.clear();
@@ -218,7 +218,7 @@ void GamepadManager::maybeStartMonitoringGamepads()
     if (!m_navigators.isEmpty() || !m_domWindows.isEmpty()) {
         LOG(Gamepad, "GamepadManager has %i NavigatorGamepads and %i DOMWindows registered, is starting gamepad monitoring", m_navigators.size(), m_domWindows.size());
         m_isMonitoringGamepads = true;
-        GamepadProvider::shared().startMonitoringGamepads(this);
+        GamepadProvider::singleton().startMonitoringGamepads(this);
     }
 }
 
@@ -230,7 +230,7 @@ void GamepadManager::maybeStopMonitoringGamepads()
     if (m_navigators.isEmpty() && m_domWindows.isEmpty()) {
         LOG(Gamepad, "GamepadManager has no NavigatorGamepads or DOMWindows registered, is stopping gamepad monitoring");
         m_isMonitoringGamepads = false;
-        GamepadProvider::shared().stopMonitoringGamepads(this);
+        GamepadProvider::singleton().stopMonitoringGamepads(this);
     }
 }
 
index 10460b8..11148e1 100644 (file)
@@ -44,7 +44,7 @@ class GamepadManager : public GamepadProviderClient {
     WTF_MAKE_NONCOPYABLE(GamepadManager);
     friend class NeverDestroyed<GamepadManager>;
 public:
-    static GamepadManager& shared();
+    static GamepadManager& singleton();
 
     virtual void platformGamepadConnected(PlatformGamepad&) override final;
     virtual void platformGamepadDisconnected(PlatformGamepad&) override final;
index 5d7b539..18f1b4e 100644 (file)
@@ -43,12 +43,12 @@ namespace WebCore {
 NavigatorGamepad::NavigatorGamepad()
     : m_navigationStart(std::numeric_limits<double>::infinity())
 {
-    GamepadManager::shared().registerNavigator(this);
+    GamepadManager::singleton().registerNavigator(this);
 }
 
 NavigatorGamepad::~NavigatorGamepad()
 {
-    GamepadManager::shared().unregisterNavigator(this);
+    GamepadManager::singleton().unregisterNavigator(this);
 }
 
 const char* NavigatorGamepad::supplementName()
@@ -91,7 +91,7 @@ const Vector<RefPtr<Gamepad>>& NavigatorGamepad::gamepads()
     if (m_gamepads.isEmpty())
         return m_gamepads;
 
-    const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::shared().platformGamepads();
+    const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::singleton().platformGamepads();
 
     for (unsigned i = 0; i < platformGamepads.size(); ++i) {
         if (!platformGamepads[i]) {
@@ -108,7 +108,7 @@ const Vector<RefPtr<Gamepad>>& NavigatorGamepad::gamepads()
 
 void NavigatorGamepad::gamepadsBecameVisible()
 {
-    const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::shared().platformGamepads();
+    const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::singleton().platformGamepads();
     m_gamepads.resize(platformGamepads.size());
 
     for (unsigned i = 0; i < platformGamepads.size(); ++i) {
@@ -128,7 +128,7 @@ void NavigatorGamepad::gamepadConnected(PlatformGamepad& platformGamepad)
     }
 
     unsigned index = platformGamepad.index();
-    ASSERT(GamepadProvider::shared().platformGamepads()[index] == &platformGamepad);
+    ASSERT(GamepadProvider::singleton().platformGamepads()[index] == &platformGamepad);
 
     // The new index should already fit in the existing array, or should be exactly one past-the-end of the existing array.
     ASSERT(index <= m_gamepads.size());
index b9c654c..31fc198 100644 (file)
@@ -151,7 +151,7 @@ const AtomicString& MediaStreamTrack::readyState() const
 void MediaStreamTrack::getSources(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrackSourcesCallback> callback, ExceptionCode& ec)
 {
     RefPtr<MediaStreamTrackSourcesRequest> request = MediaStreamTrackSourcesRequest::create(context, callback);
-    if (!MediaStreamCenter::shared().getMediaStreamTrackSources(request.release()))
+    if (!MediaStreamCenter::singleton().getMediaStreamTrackSources(request.release()))
         ec = NOT_SUPPORTED_ERR;
 }
 
index cbd6fba..c532d78 100644 (file)
@@ -114,7 +114,7 @@ void UserMediaRequest::start()
 {
     // 1 - make sure the system is capable of supporting the audio and video constraints. We don't want to ask for
     // user permission if the constraints can not be suported.
-    MediaStreamCenter::shared().validateRequestConstraints(this, m_audioConstraints, m_videoConstraints);
+    MediaStreamCenter::singleton().validateRequestConstraints(this, m_audioConstraints, m_videoConstraints);
 }
 
     
@@ -133,7 +133,7 @@ void UserMediaRequest::userMediaAccessGranted()
     RefPtr<UserMediaRequest> protectedThis(this);
     callOnMainThread([protectedThis] {
         // 3 - the user granted access, ask platform to create the media stream descriptors.
-        MediaStreamCenter::shared().createMediaStream(protectedThis.get(), protectedThis->m_audioConstraints, protectedThis->m_videoConstraints);
+        MediaStreamCenter::singleton().createMediaStream(protectedThis.get(), protectedThis->m_audioConstraints, protectedThis->m_videoConstraints);
     });
 }
 
index 96e57f3..02f8587 100644 (file)
@@ -1163,7 +1163,7 @@ __ZN7WebCore30hostNameNeedsDecodingWithRangeEP8NSString8_NSRange
 __ZN7WebCore30hostNameNeedsEncodingWithRangeEP8NSString8_NSRange
 __ZN7WebCore30overrideUserPreferredLanguagesERKN3WTF6VectorINS0_6StringELm0ENS0_15CrashOnOverflowEEE
 __ZN7WebCore31CrossOriginPreflightResultCache5emptyEv
-__ZN7WebCore31CrossOriginPreflightResultCache6sharedEv
+__ZN7WebCore31CrossOriginPreflightResultCache9singletonEv
 __ZN7WebCore31equalIgnoringFragmentIdentifierERKNS_3URLES2_
 __ZN7WebCore33stripLeadingAndTrailingHTMLSpacesERKN3WTF6StringE
 __ZN7WebCore36largestRectWithAspectRatioInsideRectEfRKNS_9FloatRectE
@@ -1613,7 +1613,7 @@ __ZN7WebCore9PageCache10setMaxSizeEj
 __ZN7WebCore9PageCache14pruneToSizeNowEjNS_13PruningReasonE
 __ZN7WebCore9PageCache34markPagesForVisitedLinkStyleRecalcEv
 __ZN7WebCore9PageCache6removeERNS_11HistoryItemE
-__ZN7WebCore9PageCache6sharedEv
+__ZN7WebCore9PageCache9singletonEv
 __ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE
 __ZN7WebCore9Scrollbar11mouseExitedEv
 __ZN7WebCore9Scrollbar12mouseEnteredEv
@@ -2760,7 +2760,7 @@ __ZN7WebCore23atBoundaryOfGranularityERKNS_15VisiblePositionENS_15TextGranularit
 __ZN7WebCore24DocumentMarkerController14markersInRangeEPNS_5RangeENS_14DocumentMarker11MarkerTypesE
 __ZN7WebCore24FloatingPointEnvironment21enableDenormalSupportEv
 __ZN7WebCore24FloatingPointEnvironment25saveMainThreadEnvironmentEv
-__ZN7WebCore24FloatingPointEnvironment6sharedEv
+__ZN7WebCore24FloatingPointEnvironment9singletonEv
 __ZN7WebCore24acquireLineBreakIteratorEN3WTF10StringViewERKNS0_12AtomicStringEPKtjNS_21LineBreakIteratorModeEb
 __ZN7WebCore24charactersAroundPositionERKNS_15VisiblePositionERiS3_S3_
 __ZN7WebCore24createTemporaryDirectoryEP8NSString
@@ -3137,8 +3137,8 @@ __ZNK7WebCore7Element25containsFullScreenElementEv
 
 #if ENABLE(GAMEPAD)
 __ZN7WebCore15GamepadProvider17setSharedProviderERS0_
-__ZN7WebCore15GamepadProvider6sharedEv
-__ZN7WebCore18HIDGamepadProvider6sharedEv
+__ZN7WebCore15GamepadProvider9singletonEv
+__ZN7WebCore18HIDGamepadProvider9singletonEv
 #endif
 
 #if ENABLE(GEOLOCATION)
index 769d72d..64d56d9 100644 (file)
@@ -79,7 +79,7 @@ bool JSCryptoAlgorithmDictionary::getAlgorithmIdentifier(ExecState* exec, JSValu
         return false;
     }
 
-    if (!CryptoAlgorithmRegistry::shared().getIdentifierForName(algorithmName, algorithmIdentifier)) {
+    if (!CryptoAlgorithmRegistry::singleton().getIdentifierForName(algorithmName, algorithmIdentifier)) {
         setDOMException(exec, NOT_SUPPORTED_ERR);
         return false;
     }
index 02fa1c0..a8917d7 100644 (file)
@@ -170,49 +170,50 @@ bool JSCryptoKeySerializationJWK::reconcileAlgorithm(std::unique_ptr<CryptoAlgor
         return true;
     }
 
+    auto& algorithmRegisty = CryptoAlgorithmRegistry::singleton();
     std::unique_ptr<CryptoAlgorithm> algorithm;
     std::unique_ptr<CryptoAlgorithmParameters> parameters;
     if (m_jwkAlgorithmName == "HS256") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::HMAC);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::HMAC);
         parameters = createHMACParameters(CryptoAlgorithmIdentifier::SHA_256);
     } else if (m_jwkAlgorithmName == "HS384") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::HMAC);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::HMAC);
         parameters = createHMACParameters(CryptoAlgorithmIdentifier::SHA_384);
     } else if (m_jwkAlgorithmName == "HS512") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::HMAC);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::HMAC);
         parameters = createHMACParameters(CryptoAlgorithmIdentifier::SHA_512);
     } else if (m_jwkAlgorithmName == "RS256") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
         parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_256);
     } else if (m_jwkAlgorithmName == "RS384") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
         parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_384);
     } else if (m_jwkAlgorithmName == "RS512") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
         parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_512);
     } else if (m_jwkAlgorithmName == "RSA1_5") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5);
         parameters = std::make_unique<CryptoAlgorithmParameters>();
     } else if (m_jwkAlgorithmName == "RSA-OAEP") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSA_OAEP);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSA_OAEP);
         parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_1);
     } else if (m_jwkAlgorithmName == "A128CBC") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::AES_CBC);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::AES_CBC);
         parameters = std::make_unique<CryptoAlgorithmParameters>();
     } else if (m_jwkAlgorithmName == "A192CBC") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::AES_CBC);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::AES_CBC);
         parameters = std::make_unique<CryptoAlgorithmParameters>();
     } else if (m_jwkAlgorithmName == "A256CBC") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::AES_CBC);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::AES_CBC);
         parameters = std::make_unique<CryptoAlgorithmParameters>();
     } else if (m_jwkAlgorithmName == "A128KW") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::AES_KW);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::AES_KW);
         parameters = std::make_unique<CryptoAlgorithmParameters>();
     } else if (m_jwkAlgorithmName == "A192KW") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::AES_KW);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::AES_KW);
         parameters = std::make_unique<CryptoAlgorithmParameters>();
     } else if (m_jwkAlgorithmName == "A256KW") {
-        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::AES_KW);
+        algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::AES_KW);
         parameters = std::make_unique<CryptoAlgorithmParameters>();
     } else {
         throwTypeError(m_exec, "Unsupported JWK algorithm " + m_jwkAlgorithmName);
index b2a6488..6baefcd 100644 (file)
@@ -67,7 +67,7 @@ static std::unique_ptr<CryptoAlgorithm> createAlgorithmFromJSValue(ExecState* ex
         return nullptr;
     }
 
-    auto result = CryptoAlgorithmRegistry::shared().create(algorithmIdentifier);
+    auto result = CryptoAlgorithmRegistry::singleton().create(algorithmIdentifier);
     if (!result)
         setDOMException(exec, NOT_SUPPORTED_ERR);
     return result;
index 7f4eee3..40dd2c9 100644 (file)
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-CryptoAlgorithmRegistry& CryptoAlgorithmRegistry::shared()
+CryptoAlgorithmRegistry& CryptoAlgorithmRegistry::singleton()
 {
     static NeverDestroyed<CryptoAlgorithmRegistry> registry;
 
index f094814..bd64b14 100644 (file)
@@ -45,7 +45,7 @@ class CryptoAlgorithmRegistry {
     friend class NeverDestroyed<CryptoAlgorithmRegistry>;
 
 public:
-    static CryptoAlgorithmRegistry& shared();
+    static CryptoAlgorithmRegistry& singleton();
 
     bool getIdentifierForName(const String&, CryptoAlgorithmIdentifier&);
     String nameForIdentifier(CryptoAlgorithmIdentifier);
index ba2f02a..53d1c1e 100644 (file)
@@ -63,7 +63,7 @@ String CryptoKey::type() const
 
 void CryptoKey::buildAlgorithmDescription(CryptoAlgorithmDescriptionBuilder& builder) const
 {
-    builder.add("name", CryptoAlgorithmRegistry::shared().nameForIdentifier(m_algorithm));
+    builder.add("name", CryptoAlgorithmRegistry::singleton().nameForIdentifier(m_algorithm));
     // Subclasses will add other keys.
 }
 
index 5fa1384..b551f7a 100644 (file)
@@ -72,7 +72,7 @@ void CryptoKeyHMAC::buildAlgorithmDescription(CryptoAlgorithmDescriptionBuilder&
     CryptoKey::buildAlgorithmDescription(builder);
 
     auto hashDescriptionBuilder = builder.createEmptyClone();
-    hashDescriptionBuilder->add("name", CryptoAlgorithmRegistry::shared().nameForIdentifier(m_hash));
+    hashDescriptionBuilder->add("name", CryptoAlgorithmRegistry::singleton().nameForIdentifier(m_hash));
     builder.add("hash", *hashDescriptionBuilder);
 
     builder.add("length", m_key.size());
index b56ac22..b33a64e 100644 (file)
@@ -181,7 +181,7 @@ void CryptoKeyRSA::buildAlgorithmDescription(CryptoAlgorithmDescriptionBuilder&
 
     if (m_restrictedToSpecificHash) {
         auto hashDescriptionBuilder = builder.createEmptyClone();
-        hashDescriptionBuilder->add("name", CryptoAlgorithmRegistry::shared().nameForIdentifier(m_hash));
+        hashDescriptionBuilder->add("name", CryptoAlgorithmRegistry::singleton().nameForIdentifier(m_hash));
         builder.add("hash", *hashDescriptionBuilder);
     }
 }
index b3ad619..eae62bc 100644 (file)
@@ -68,7 +68,7 @@ void BackForwardList::addItem(PassRefPtr<HistoryItem> prpItem)
             RefPtr<HistoryItem> item = m_entries.last();
             m_entries.removeLast();
             m_entryHash.remove(item);
-            PageCache::shared().remove(*item);
+            PageCache::singleton().remove(*item);
         }
     }
 
@@ -78,7 +78,7 @@ void BackForwardList::addItem(PassRefPtr<HistoryItem> prpItem)
         RefPtr<HistoryItem> item = m_entries[0];
         m_entries.remove(0);
         m_entryHash.remove(item);
-        PageCache::shared().remove(*item);
+        PageCache::singleton().remove(*item);
         m_current--;
     }
 
@@ -175,7 +175,7 @@ void BackForwardList::setCapacity(int size)
         RefPtr<HistoryItem> item = m_entries.last();
         m_entries.removeLast();
         m_entryHash.remove(item);
-        PageCache::shared().remove(*item);
+        PageCache::singleton().remove(*item);
     }
 
     if (!size)
@@ -245,7 +245,7 @@ bool BackForwardList::clearAllPageCaches()
     for (auto& item : m_entries) {
         if (item->isInPageCache()) {
             didRemoveAtLeastOneItem = true;
-            PageCache::shared().remove(*item);
+            PageCache::singleton().remove(*item);
         }
     }
     return didRemoveAtLeastOneItem;
@@ -255,7 +255,7 @@ bool BackForwardList::clearAllPageCaches()
 void BackForwardList::close()
 {
     for (auto& item : m_entries)
-        PageCache::shared().remove(*item);
+        PageCache::singleton().remove(*item);
     m_entries.clear();
     m_entryHash.clear();
     m_page = nullptr;
index ecf4ea8..e65ce6e 100644 (file)
@@ -173,7 +173,7 @@ CachedFrame::CachedFrame(Frame& frame)
 
     frame.loader().client().savePlatformDataToCachedFrame(this);
 
-    if (m_isComposited && PageCache::shared().shouldClearBackingStores())
+    if (m_isComposited && PageCache::singleton().shouldClearBackingStores())
         frame.view()->clearBackingStores();
 
     // documentWillSuspendForPageCache() can set up a layout timer on the FrameView, so clear timers after that.
index 1b525df..c3c367f 100644 (file)
@@ -286,7 +286,7 @@ void HistoryItem::setURLString(const String& urlString)
 
 void HistoryItem::setURL(const URL& url)
 {
-    PageCache::shared().remove(*this);
+    PageCache::singleton().remove(*this);
     setURLString(url.string());
     clearDocumentState();
 }
index 22d6802..9620990 100644 (file)
@@ -291,7 +291,7 @@ static void logCanCachePageDecision(Page& page)
     diagnosticLoggingClient.logDiagnosticMessageWithResult(DiagnosticLoggingKeys::pageCacheKey(), emptyString(), rejectReasons ? DiagnosticLoggingResultFail : DiagnosticLoggingResultPass);
 }
 
-PageCache& PageCache::shared()
+PageCache& PageCache::singleton()
 {
     static NeverDestroyed<PageCache> globalPageCache;
     return globalPageCache;
@@ -484,7 +484,7 @@ CachedPage* PageCache::get(HistoryItem& item, Page* page) const
     if (cachedPage->hasExpired()) {
         LOG(PageCache, "Not restoring page for %s from back/forward cache because cache entry has expired", item.url().string().ascii().data());
         logPageCacheFailureDiagnosticMessage(page, DiagnosticLoggingKeys::expiredKey());
-        PageCache::shared().remove(item);
+        PageCache::singleton().remove(item);
         return nullptr;
     }
     return cachedPage;
index 9536a9f..0f2fb49 100644 (file)
@@ -44,7 +44,7 @@ class PageCache {
     WTF_MAKE_NONCOPYABLE(PageCache); WTF_MAKE_FAST_ALLOCATED;
 public:
     // Function to obtain the global page cache.
-    WEBCORE_EXPORT static PageCache& shared();
+    WEBCORE_EXPORT static PageCache& singleton();
 
     bool canCache(Page*) const;
 
@@ -73,7 +73,7 @@ public:
     void setShouldClearBackingStores(bool flag) { m_shouldClearBackingStores = flag; }
 
 private:
-    PageCache() = default; // Use shared() instead.
+    PageCache() = default; // Use singleton() instead.
     ~PageCache() = delete; // Make sure nobody accidentally calls delete -- WebCore does not delete singletons.
 
     static bool canCachePageContainingThisFrame(Frame&);
index 8d1ec42..a0f28dc 100644 (file)
@@ -151,7 +151,7 @@ bool CrossOriginPreflightResultCacheItem::allowsRequest(StoredCredentials includ
     return true;
 }
 
-CrossOriginPreflightResultCache& CrossOriginPreflightResultCache::shared()
+CrossOriginPreflightResultCache& CrossOriginPreflightResultCache::singleton()
 {
     ASSERT(isMainThread());
 
index e7d281b..f4785ff 100644 (file)
@@ -66,7 +66,7 @@ class CrossOriginPreflightResultCache {
     WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCache); WTF_MAKE_FAST_ALLOCATED;
 
 public:
-    WEBCORE_EXPORT static CrossOriginPreflightResultCache& shared();
+    WEBCORE_EXPORT static CrossOriginPreflightResultCache& singleton();
 
     void appendEntry(const String& origin, const URL&, std::unique_ptr<CrossOriginPreflightResultCacheItem>);
     bool canSkipPreflight(const String& origin, const URL&, StoredCredentials, const String& method, const HTTPHeaderMap& requestHeaders);
index 9529811..e1ab138 100644 (file)
@@ -104,7 +104,7 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(const ResourceReques
         m_simpleRequest = false;
         m_actualRequest = WTF::move(crossOriginRequest);
 
-        if (CrossOriginPreflightResultCache::shared().canSkipPreflight(securityOrigin()->toString(), m_actualRequest->url(), m_options.allowCredentials(), m_actualRequest->httpMethod(), m_actualRequest->httpHeaderFields()))
+        if (CrossOriginPreflightResultCache::singleton().canSkipPreflight(securityOrigin()->toString(), m_actualRequest->url(), m_options.allowCredentials(), m_actualRequest->httpMethod(), m_actualRequest->httpHeaderFields()))
             preflightSuccess();
         else
             makeCrossOriginAccessRequestWithPreflight(*m_actualRequest);
@@ -256,7 +256,7 @@ void DocumentThreadableLoader::didReceiveResponse(unsigned long identifier, cons
             return;
         }
 
-        CrossOriginPreflightResultCache::shared().appendEntry(securityOrigin()->toString(), m_actualRequest->url(), WTF::move(preflightResult));
+        CrossOriginPreflightResultCache::singleton().appendEntry(securityOrigin()->toString(), m_actualRequest->url(), WTF::move(preflightResult));
     } else {
         if (!m_sameOriginRequest && m_options.crossOriginRequestPolicy == UseAccessControl) {
             if (!passesAccessControlCheck(response, m_options.allowCredentials(), securityOrigin(), accessControlErrorDescription)) {
index 7319088..059f0ff 100644 (file)
@@ -1741,7 +1741,7 @@ void FrameLoader::commitProvisionalLoad()
 
     std::unique_ptr<CachedPage> cachedPage;
     if (m_loadingFromCachedPage && history().provisionalItem())
-        cachedPage = PageCache::shared().take(*history().provisionalItem(), m_frame.page());
+        cachedPage = PageCache::singleton().take(*history().provisionalItem(), m_frame.page());
 
     LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame.tree().uniqueName().string().utf8().data(),
         m_frame.document() ? m_frame.document()->url().stringCenterEllipsizedToLength().utf8().data() : "",
@@ -1758,11 +1758,12 @@ void FrameLoader::commitProvisionalLoad()
             LOG(MemoryPressure, "Pruning page cache because under memory pressure at: %s", __PRETTY_FUNCTION__);
             LOG(PageCache, "Pruning page cache to 0 due to memory pressure");
             // Don't cache any page if we are under memory pressure.
-            PageCache::shared().pruneToSizeNow(0, PruningReason::MemoryPressure);
+            PageCache::singleton().pruneToSizeNow(0, PruningReason::MemoryPressure);
         } else if (systemMemoryLevel() <= memoryLevelThresholdToPrunePageCache) {
             LOG(MemoryPressure, "Pruning page cache because system memory level is %d at: %s", systemMemoryLevel(), __PRETTY_FUNCTION__);
-            LOG(PageCache, "Pruning page cache to %d due to low memory (level %d less or equal to %d threshold)", PageCache::shared().maxSize() / 2, systemMemoryLevel(), memoryLevelThresholdToPrunePageCache);
-            PageCache::shared().pruneToSizeNow(PageCache::shared().maxSize() / 2, PruningReason::MemoryPressure);
+            auto& pageCache = PageCache::singleton();
+            LOG(PageCache, "Pruning page cache to %d due to low memory (level %d less or equal to %d threshold)", pageCache.maxSize() / 2, systemMemoryLevel(), memoryLevelThresholdToPrunePageCache);
+            pageCache.pruneToSizeNow(pageCache.maxSize() / 2, PruningReason::MemoryPressure);
         }
     }
 #endif
@@ -1772,8 +1773,8 @@ void FrameLoader::commitProvisionalLoad()
     // Check to see if we need to cache the page we are navigating away from into the back/forward cache.
     // We are doing this here because we know for sure that a new page is about to be loaded.
     HistoryItem& item = *history().currentItem();
-    if (!m_frame.tree().parent() && PageCache::shared().canCache(m_frame.page()) && !item.isInPageCache())
-        PageCache::shared().add(item, *m_frame.page());
+    if (!m_frame.tree().parent() && PageCache::singleton().canCache(m_frame.page()) && !item.isInPageCache())
+        PageCache::singleton().add(item, *m_frame.page());
 
     if (m_loadType != FrameLoadType::Replace)
         closeOldDataSources();
@@ -3159,7 +3160,7 @@ void FrameLoader::loadDifferentDocumentItem(HistoryItem& item, FrameLoadType loa
     // Remember this item so we can traverse any child items as child frames load
     history().setProvisionalItem(&item);
 
-    if (CachedPage* cachedPage = PageCache::shared().get(item, m_frame.page())) {
+    if (CachedPage* cachedPage = PageCache::singleton().get(item, m_frame.page())) {
         auto documentLoader = cachedPage->documentLoader();
         documentLoader->setTriggeringAction(NavigationAction(documentLoader->request(), loadType, false));
         documentLoader->setLastCheckedRequest(ResourceRequest());
index 833e588..acf9090 100644 (file)
@@ -238,7 +238,7 @@ void HistoryController::invalidateCurrentItemCachedPage()
         return;
 
     // When we are pre-commit, the currentItem is where any page cache data resides.
-    std::unique_ptr<CachedPage> cachedPage = PageCache::shared().take(*currentItem(), m_frame.page());
+    std::unique_ptr<CachedPage> cachedPage = PageCache::singleton().take(*currentItem(), m_frame.page());
     if (!cachedPage)
         return;
 
@@ -336,7 +336,7 @@ void HistoryController::updateForReload()
 #endif
 
     if (m_currentItem) {
-        PageCache::shared().remove(*m_currentItem);
+        PageCache::singleton().remove(*m_currentItem);
     
         if (m_frame.loader().loadType() == FrameLoadType::Reload || m_frame.loader().loadType() == FrameLoadType::ReloadFromOrigin)
             saveScrollPositionAndViewStateToItem(m_currentItem.get());
index cb394ea..ea16158 100644 (file)
@@ -453,7 +453,7 @@ DOMWindow::~DOMWindow()
 
 #if ENABLE(GAMEPAD)
     if (m_gamepadEventListenerCount)
-        GamepadManager::shared().unregisterDOMWindow(this);
+        GamepadManager::singleton().unregisterDOMWindow(this);
 #endif
 }
 
@@ -519,7 +519,7 @@ void DOMWindow::willDetachDocumentFromFrame()
 void DOMWindow::incrementGamepadEventListenerCount()
 {
     if (++m_gamepadEventListenerCount == 1)
-        GamepadManager::shared().registerDOMWindow(this);
+        GamepadManager::singleton().registerDOMWindow(this);
 }
 
 void DOMWindow::decrementGamepadEventListenerCount()
@@ -527,7 +527,7 @@ void DOMWindow::decrementGamepadEventListenerCount()
     ASSERT(m_gamepadEventListenerCount);
 
     if (!--m_gamepadEventListenerCount)
-        GamepadManager::shared().unregisterDOMWindow(this);
+        GamepadManager::singleton().unregisterDOMWindow(this);
 }
 #endif
 
index b4ab6ca..ce1148b 100644 (file)
@@ -210,7 +210,7 @@ void RegionOverlay::recomputeRegion()
         m_overlay->setNeedsDisplay();
 }
 
-DebugPageOverlays& DebugPageOverlays::shared()
+DebugPageOverlays& DebugPageOverlays::singleton()
 {
     if (!sharedDebugOverlays)
         sharedDebugOverlays = new DebugPageOverlays;
@@ -296,7 +296,7 @@ void DebugPageOverlays::settingsChanged(MainFrame& frame)
     if (!activeOverlayRegions && !hasOverlays(frame))
         return;
 
-    DebugPageOverlays::shared().updateOverlayRegionVisibility(frame, activeOverlayRegions);
+    DebugPageOverlays::singleton().updateOverlayRegionVisibility(frame, activeOverlayRegions);
 }
 
 }
index 1f641fd..54610a2 100644 (file)
@@ -37,7 +37,7 @@ class RegionOverlay;
 
 class DebugPageOverlays {
 public:
-    static DebugPageOverlays& shared();
+    static DebugPageOverlays& singleton();
 
     enum class RegionType {
         WheelEventHandlers,
index 78cb193..988ad06 100644 (file)
@@ -989,7 +989,7 @@ void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor
     }
 
     if (isMainFrame())
-        PageCache::shared().markPagesForFullStyleRecalc(*page);
+        PageCache::singleton().markPagesForFullStyleRecalc(*page);
 }
 
 float Frame::frameScaleFactor() const
index 7d97aef..27c04b5 100644 (file)
@@ -839,9 +839,9 @@ void Page::setDeviceScaleFactor(float scaleFactor)
     setNeedsRecalcStyleInAllFrames();
 
     mainFrame().deviceOrPageScaleFactorChanged();
-    PageCache::shared().markPagesForDeviceScaleChanged(*this);
+    PageCache::singleton().markPagesForDeviceScaleChanged(*this);
 
-    PageCache::shared().markPagesForFullStyleRecalc(*this);
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
     GraphicsContext::updateDocumentMarkerResources();
 
     mainFrame().pageOverlayController().didChangeDeviceScaleFactor();
@@ -921,7 +921,7 @@ void Page::setPagination(const Pagination& pagination)
     m_pagination = pagination;
 
     setNeedsRecalcStyleInAllFrames();
-    PageCache::shared().markPagesForFullStyleRecalc(*this);
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
 }
 
 unsigned Page::pageCount() const
@@ -1661,7 +1661,7 @@ void Page::setVisitedLinkStore(Ref<VisitedLinkStore>&& visitedLinkStore)
     m_visitedLinkStore->addPage(*this);
 
     invalidateStylesForAllLinks();
-    PageCache::shared().markPagesForFullStyleRecalc(*this);
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
 }
 
 SessionID Page::sessionID() const
index dac26f2..a08a929 100644 (file)
@@ -111,7 +111,7 @@ void PageGroup::captionPreferencesChanged()
 {
     for (auto it = m_pages.begin(), end = m_pages.end(); it != end; ++it)
         (*it)->captionPreferencesChanged();
-    PageCache::shared().markPagesForCaptionPreferencesChanged();
+    PageCache::singleton().markPagesForCaptionPreferencesChanged();
 }
 
 CaptionUserPreferences* PageGroup::captionPreferences()
index f7bdc4c..53d2f95 100644 (file)
@@ -512,7 +512,7 @@ void Settings::setUsesPageCache(bool usesPageCache)
         return;
 
     if (!m_usesPageCache)
-        PageCache::shared().pruneToSizeNow(0, PruningReason::None);
+        PageCache::singleton().pruneToSizeNow(0, PruningReason::None);
 }
 
 void Settings::setFontRenderingMode(FontRenderingMode mode)
index 9c8e2d1..3117f8f 100644 (file)
@@ -40,22 +40,21 @@ ScrollingThread::ScrollingThread()
 
 bool ScrollingThread::isCurrentThread()
 {
-    if (!shared().m_threadIdentifier)
-        return false;
-
-    return currentThread() == shared().m_threadIdentifier;
+    auto threadIdentifier = ScrollingThread::singleton().m_threadIdentifier;
+    return threadIdentifier && currentThread() == threadIdentifier;
 }
 
 void ScrollingThread::dispatch(std::function<void ()> function)
 {
-    shared().createThreadIfNeeded();
+    auto& scrollingThread = ScrollingThread::singleton();
+    scrollingThread.createThreadIfNeeded();
 
     {
-        std::lock_guard<std::mutex> lock(shared().m_functionsMutex);
-        shared().m_functions.append(function);
+        std::lock_guard<std::mutex> lock(singleton().m_functionsMutex);
+        scrollingThread.m_functions.append(function);
     }
 
-    shared().wakeUpRunLoop();
+    scrollingThread.wakeUpRunLoop();
 }
 
 void ScrollingThread::dispatchBarrier(std::function<void ()> function)
@@ -65,7 +64,7 @@ void ScrollingThread::dispatchBarrier(std::function<void ()> function)
     });
 }
 
-ScrollingThread& ScrollingThread::shared()
+ScrollingThread& ScrollingThread::singleton()
 {
     static NeverDestroyed<ScrollingThread> scrollingThread;
 
index 7f1368e..262cdf1 100644 (file)
@@ -57,7 +57,7 @@ private:
 
     ScrollingThread();
 
-    static ScrollingThread& shared();
+    static ScrollingThread& singleton();
 
     void createThreadIfNeeded();
     static void threadCallback(void* scrollingThread);
index 0504a68..b0f4927 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 
 static GamepadProvider* sharedProvider = nullptr;
 
-GamepadProvider& GamepadProvider::shared()
+GamepadProvider& GamepadProvider::singleton()
 {
     if (!sharedProvider) {
         static NeverDestroyed<GamepadProvider> defaultProvider;
index 24a9c7e..8d1c531 100644 (file)
@@ -39,7 +39,7 @@ class GamepadProvider {
 public:
     virtual ~GamepadProvider() { }
 
-    WEBCORE_EXPORT static GamepadProvider& shared();
+    WEBCORE_EXPORT static GamepadProvider& singleton();
     WEBCORE_EXPORT static void setSharedProvider(GamepadProvider&);
 
     virtual void startMonitoringGamepads(GamepadProviderClient*);
index b502deb..e524696 100644 (file)
@@ -102,7 +102,7 @@ void MemoryPressureHandler::releaseCriticalMemory()
         ReliefLogger log("Empty the PageCache");
         // Right now, the only reason we call release critical memory while not under memory pressure is if the process is about to be suspended.
         PruningReason pruningReason = memoryPressureHandler().isUnderMemoryPressure() ? PruningReason::MemoryPressure : PruningReason::ProcessSuspended;
-        PageCache::shared().pruneToSizeNow(0, pruningReason);
+        PageCache::singleton().pruneToSizeNow(0, pruningReason);
     }
 
     {
index 4fbd999..064800d 100644 (file)
@@ -127,7 +127,7 @@ public:
         m_purgeTimer.startOneShot(scratchBufferPurgeInterval);
     }
     
-    static ScratchBuffer& shared();
+    static ScratchBuffer& singleton();
 
 private:
     void timerFired()
@@ -159,7 +159,7 @@ private:
 #endif
 };
 
-ScratchBuffer& ScratchBuffer::shared()
+ScratchBuffer& ScratchBuffer::singleton()
 {
     DEPRECATED_DEFINE_STATIC_LOCAL(ScratchBuffer, scratchBuffer, ());
     return scratchBuffer;
@@ -567,7 +567,7 @@ void ShadowBlur::drawInsetShadow(GraphicsContext* graphicsContext, const FloatRe
 
 void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext* graphicsContext, const FloatRoundedRect& shadowedRect, const IntRect& layerRect)
 {
-    m_layerImage = ScratchBuffer::shared().getScratchBuffer(layerRect.size());
+    m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerRect.size());
     if (!m_layerImage)
         return;
 
@@ -575,7 +575,7 @@ void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext* graphicsContext, c
     bufferRelativeShadowedRect.move(m_layerContextTranslation);
 
     // Only redraw in the scratch buffer if its cached contents don't match our needs
-    bool redrawNeeded = ScratchBuffer::shared().setCachedShadowValues(m_blurRadius, Color::black, ColorSpaceDeviceRGB, bufferRelativeShadowedRect, shadowedRect.radii(), m_layerSize);
+    bool redrawNeeded = ScratchBuffer::singleton().setCachedShadowValues(m_blurRadius, Color::black, ColorSpaceDeviceRGB, bufferRelativeShadowedRect, shadowedRect.radii(), m_layerSize);
     if (redrawNeeded) {
         GraphicsContext* shadowContext = m_layerImage->context();
         GraphicsContextStateSaver stateSaver(*shadowContext);
@@ -597,12 +597,12 @@ void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext* graphicsContext, c
     
     drawShadowBuffer(graphicsContext);
     m_layerImage = 0;
-    ScratchBuffer::shared().scheduleScratchBufferPurge();
+    ScratchBuffer::singleton().scheduleScratchBufferPurge();
 }
 
 void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext* graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect, const IntRect& layerRect)
 {
-    m_layerImage = ScratchBuffer::shared().getScratchBuffer(layerRect.size());
+    m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerRect.size());
     if (!m_layerImage)
         return;
 
@@ -613,7 +613,7 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext* graphicsContext,
     bufferRelativeHoleRect.move(m_layerContextTranslation);
 
     // Only redraw in the scratch buffer if its cached contents don't match our needs
-    bool redrawNeeded = ScratchBuffer::shared().setCachedInsetShadowValues(m_blurRadius, Color::black, ColorSpaceDeviceRGB, bufferRelativeRect, bufferRelativeHoleRect, holeRect.radii());
+    bool redrawNeeded = ScratchBuffer::singleton().setCachedInsetShadowValues(m_blurRadius, Color::black, ColorSpaceDeviceRGB, bufferRelativeRect, bufferRelativeHoleRect, holeRect.radii());
     if (redrawNeeded) {
         GraphicsContext* shadowContext = m_layerImage->context();
         GraphicsContextStateSaver stateSaver(*shadowContext);
@@ -638,7 +638,7 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext* graphicsContext,
     
     drawShadowBuffer(graphicsContext);
     m_layerImage = 0;
-    ScratchBuffer::shared().scheduleScratchBufferPurge();
+    ScratchBuffer::singleton().scheduleScratchBufferPurge();
 }
 
 /*
@@ -675,7 +675,7 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext* graphicsContext,
 
 void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect, const IntSize& templateSize, const IntSize& edgeSize)
 {
-    m_layerImage = ScratchBuffer::shared().getScratchBuffer(templateSize);
+    m_layerImage = ScratchBuffer::singleton().getScratchBuffer(templateSize);
     if (!m_layerImage)
         return;
 
@@ -684,7 +684,7 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, con
     FloatRect templateHole = FloatRect(edgeSize.width(), edgeSize.height(), templateSize.width() - 2 * edgeSize.width(), templateSize.height() - 2 * edgeSize.height());
 
     // Only redraw in the scratch buffer if its cached contents don't match our needs
-    bool redrawNeeded = ScratchBuffer::shared().setCachedInsetShadowValues(m_blurRadius, m_color, m_colorSpace, templateBounds, templateHole, holeRect.radii());
+    bool redrawNeeded = ScratchBuffer::singleton().setCachedInsetShadowValues(m_blurRadius, m_color, m_colorSpace, templateBounds, templateHole, holeRect.radii());
     if (redrawNeeded) {
         // Draw shadow into a new ImageBuffer.
         GraphicsContext* shadowContext = m_layerImage->context();
@@ -735,19 +735,20 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, con
     drawLayerPieces(graphicsContext, destHoleBounds, holeRect.radii(), edgeSize, templateSize, InnerShadow);
 
     m_layerImage = 0;
-    ScratchBuffer::shared().scheduleScratchBufferPurge();
+    ScratchBuffer::singleton().scheduleScratchBufferPurge();
 }
 
 void ShadowBlur::drawRectShadowWithTiling(GraphicsContext* graphicsContext, const FloatRoundedRect& shadowedRect, const IntSize& templateSize, const IntSize& edgeSize)
 {
-    m_layerImage = ScratchBuffer::shared().getScratchBuffer(templateSize);
+    auto& scratchBuffer = ScratchBuffer::singleton();
+    m_layerImage = scratchBuffer.getScratchBuffer(templateSize);
     if (!m_layerImage)
         return;
 
     FloatRect templateShadow = FloatRect(edgeSize.width(), edgeSize.height(), templateSize.width() - 2 * edgeSize.width(), templateSize.height() - 2 * edgeSize.height());
 
     // Only redraw in the scratch buffer if its cached contents don't match our needs
-    bool redrawNeeded = ScratchBuffer::shared().setCachedShadowValues(m_blurRadius, m_color, m_colorSpace, templateShadow, shadowedRect.radii(), m_layerSize);
+    bool redrawNeeded = scratchBuffer.setCachedShadowValues(m_blurRadius, m_color, m_colorSpace, templateShadow, shadowedRect.radii(), m_layerSize);
     if (redrawNeeded) {
         // Draw shadow into the ImageBuffer.
         GraphicsContext* shadowContext = m_layerImage->context();
@@ -780,7 +781,7 @@ void ShadowBlur::drawRectShadowWithTiling(GraphicsContext* graphicsContext, cons
     drawLayerPieces(graphicsContext, shadowBounds, shadowedRect.radii(), edgeSize, templateSize, OuterShadow);
 
     m_layerImage = 0;
-    ScratchBuffer::shared().scheduleScratchBufferPurge();
+    ScratchBuffer::singleton().scheduleScratchBufferPurge();
 }
 
 void ShadowBlur::drawLayerPieces(GraphicsContext* graphicsContext, const FloatRect& shadowBounds, const FloatRoundedRect::Radii& radii, const IntSize& bufferPadding, const IntSize& templateSize, ShadowDirection direction)
@@ -891,12 +892,13 @@ GraphicsContext* ShadowBlur::beginShadowLayer(GraphicsContext *context, const Fl
     IntRect layerRect = calculateLayerBoundingRect(context, layerArea, context->clipBounds());
 
     if (layerRect.isEmpty())
-        return 0;
+        return nullptr;
 
     // We reset the scratch buffer values here, because the buffer will no longer contain
     // data from any previous rectangle or inset shadows drawn via the tiling path.
-    ScratchBuffer::shared().setCachedShadowValues(FloatSize(), Color::black, ColorSpaceDeviceRGB, IntRect(), FloatRoundedRect::Radii(), m_layerSize);
-    m_layerImage = ScratchBuffer::shared().getScratchBuffer(layerRect.size());
+    auto& scratchBuffer = ScratchBuffer::singleton();
+    scratchBuffer.setCachedShadowValues(FloatSize(), Color::black, ColorSpaceDeviceRGB, IntRect(), FloatRoundedRect::Radii(), m_layerSize);
+    m_layerImage = scratchBuffer.getScratchBuffer(layerRect.size());
 
     GraphicsContext* shadowContext = m_layerImage->context();
     shadowContext->save();
@@ -919,7 +921,7 @@ void ShadowBlur::endShadowLayer(GraphicsContext* context)
     context->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, FloatRect(roundedIntPoint(m_layerOrigin), m_layerSize), FloatRect(FloatPoint(), m_layerSize), context->compositeOperation());
 
     m_layerImage = 0;
-    ScratchBuffer::shared().scheduleScratchBufferPurge();
+    ScratchBuffer::singleton().scheduleScratchBufferPurge();
 }
 
 } // namespace WebCore
index b7559b0..c7e831d 100644 (file)
@@ -220,14 +220,14 @@ void CACFLayerTreeHost::layerTreeDidChange()
     // The layer tree is changing as a result of someone modifying a PlatformCALayer that doesn't
     // have a corresponding GraphicsLayer. Schedule a flush since we won't schedule one through the
     // normal GraphicsLayer mechanisms.
-    LayerChangesFlusher::shared().flushPendingLayerChangesSoon(this);
+    LayerChangesFlusher::singleton().flushPendingLayerChangesSoon(this);
 }
 
 void CACFLayerTreeHost::destroyRenderer()
 {
     m_rootLayer = 0;
     m_rootChildLayer = 0;
-    LayerChangesFlusher::shared().cancelPendingFlush(this);
+    LayerChangesFlusher::singleton().cancelPendingFlush(this);
 }
 
 static void getDirtyRects(HWND window, Vector<CGRect>& outRects)
@@ -270,7 +270,7 @@ void CACFLayerTreeHost::paint()
 void CACFLayerTreeHost::flushPendingGraphicsLayerChangesSoon()
 {
     m_shouldFlushPendingGraphicsLayerChanges = true;
-    LayerChangesFlusher::shared().flushPendingLayerChangesSoon(this);
+    LayerChangesFlusher::singleton().flushPendingLayerChangesSoon(this);
 }
 
 void CACFLayerTreeHost::setShouldInvertColors(bool)
index 4b036ca..3918755 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-LayerChangesFlusher& LayerChangesFlusher::shared()
+LayerChangesFlusher& LayerChangesFlusher::singleton()
 {
     DEPRECATED_DEFINE_STATIC_LOCAL(LayerChangesFlusher, flusher, ());
     return flusher;
@@ -74,7 +74,7 @@ LRESULT LayerChangesFlusher::hookCallback(int code, WPARAM wParam, LPARAM lParam
     // crash for debugging purposes if an exception is hit. 
     ExceptionRegistration registrationStruct; // Note: must be stack allocated.
     StructuredExceptionHandlerSuppressor supressor(registrationStruct);
-    return shared().hookFired(code, wParam, lParam);
+    return singleton().hookFired(code, wParam, lParam);
 }
 
 LRESULT LayerChangesFlusher::hookFired(int code, WPARAM wParam, LPARAM lParam)
index fcb31e7..28e66b9 100644 (file)
@@ -37,7 +37,7 @@ class AbstractCACFLayerTreeHost;
 class LayerChangesFlusher {
     WTF_MAKE_NONCOPYABLE(LayerChangesFlusher);
 public:
-    static LayerChangesFlusher& shared();
+    static LayerChangesFlusher& singleton();
 
     void flushPendingLayerChangesSoon(AbstractCACFLayerTreeHost*);
     void cancelPendingFlush(AbstractCACFLayerTreeHost*);
index e7036c1..d16b953 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-FloatingPointEnvironment& FloatingPointEnvironment::shared()
+FloatingPointEnvironment& FloatingPointEnvironment::singleton()
 {
     static NeverDestroyed<FloatingPointEnvironment> floatingPointEnvironment;
     return floatingPointEnvironment;
index 03f4d3f..6511bf0 100644 (file)
@@ -40,7 +40,7 @@ public:
     WEBCORE_EXPORT void saveMainThreadEnvironment();
     void propagateMainThreadEnvironment();
 
-    WEBCORE_EXPORT static FloatingPointEnvironment& shared();
+    WEBCORE_EXPORT static FloatingPointEnvironment& singleton();
 
 private:
 
index 4b09d1f..d9d1396 100644 (file)
@@ -642,7 +642,7 @@ NO_RETURN
 #endif
 void *RunWebThread(void *arg)
 {
-    FloatingPointEnvironment::shared().propagateMainThreadEnvironment();
+    FloatingPointEnvironment::singleton().propagateMainThreadEnvironment();
 
     UNUSED_PARAM(arg);
     // WTF::initializeMainThread() needs to be called before JSC::initializeThreading() since the
@@ -757,7 +757,7 @@ static void StartWebThread()
     ASSERT_WITH_MESSAGE(result == 0, "startup lock failed with code:%d", result);
 
     // Propagate the mainThread's fenv to workers & the web thread.
-    FloatingPointEnvironment::shared().saveMainThreadEnvironment();
+    FloatingPointEnvironment::singleton().saveMainThreadEnvironment();
 
     pthread_create(&webThread, &tattr, RunWebThread, NULL);
     pthread_attr_destroy(&tattr);
index 24f1b08..697a49c 100644 (file)
@@ -73,7 +73,7 @@ static void deviceValuesChangedCallback(void* context, IOReturn result, void*, I
     listener->valuesChanged(value);
 }
 
-HIDGamepadProvider& HIDGamepadProvider::shared()
+HIDGamepadProvider& HIDGamepadProvider::singleton()
 {
     static NeverDestroyed<HIDGamepadProvider> sharedListener;
     return sharedListener;
index 80e30ee..5a068df 100644 (file)
@@ -46,7 +46,7 @@ class HIDGamepadProvider : public GamepadProvider {
     WTF_MAKE_NONCOPYABLE(HIDGamepadProvider);
     friend class NeverDestroyed<HIDGamepadProvider>;
 public:
-    WEBCORE_EXPORT static HIDGamepadProvider& shared();
+    WEBCORE_EXPORT static HIDGamepadProvider& singleton();
 
     virtual void startMonitoringGamepads(GamepadProviderClient*);
     virtual void stopMonitoringGamepads(GamepadProviderClient*);
index 389138c..cc5a5cb 100644 (file)
@@ -45,7 +45,7 @@ static MediaStreamCenter*& mediaStreamCenterOverride()
     return override;
 }
 
-MediaStreamCenter& MediaStreamCenter::shared()
+MediaStreamCenter& MediaStreamCenter::singleton()
 {
     MediaStreamCenter* override = mediaStreamCenterOverride();
     if (override)
index 7d540b9..e697f02 100644 (file)
@@ -49,7 +49,7 @@ class MediaStreamCenter {
 public:
     virtual ~MediaStreamCenter();
 
-    static MediaStreamCenter& shared();
+    static MediaStreamCenter& singleton();
     static void setSharedStreamCenter(MediaStreamCenter*);
 
     virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints) = 0;
index 8efe415..a3893c0 100644 (file)
@@ -45,7 +45,7 @@ class CaptureDevice;
 
 class AVCaptureDeviceManager {
 public:
-    static AVCaptureDeviceManager& shared();
+    static AVCaptureDeviceManager& singleton();
     static bool isAvailable();
 
     Vector<RefPtr<TrackSourceInfo>> getSourcesInfo(const String&);
index 9afd9ed..b0b26f6 100644 (file)
@@ -117,7 +117,7 @@ static Vector<CaptureDevice>& captureDeviceList()
     if (firstTime && !captureDeviceList.size()) {
         firstTime = false;
         refreshCaptureDeviceList();
-        AVCaptureDeviceManager::shared().registerForDeviceNotifications();
+        AVCaptureDeviceManager::singleton().registerForDeviceNotifications();
     }
 
     return captureDeviceList;
@@ -174,7 +174,7 @@ bool AVCaptureDeviceManager::isAvailable()
     return AVFoundationLibrary();
 }
 
-AVCaptureDeviceManager& AVCaptureDeviceManager::shared()
+AVCaptureDeviceManager& AVCaptureDeviceManager::singleton()
 {
     DEPRECATED_DEFINE_STATIC_LOCAL(AVCaptureDeviceManager, manager, ());
     return manager;
index 8d8d90d..534e47e 100644 (file)
@@ -65,7 +65,7 @@ void MediaStreamCenterMac::validateRequestConstraints(PassRefPtr<MediaStreamCrea
 
     if (audioConstraints) {
         String invalidConstraint;
-        AVCaptureDeviceManager::shared().verifyConstraintsForMediaType(MediaStreamSource::Audio, audioConstraints.get(), invalidConstraint);
+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(MediaStreamSource::Audio, audioConstraints.get(), invalidConstraint);
         if (!invalidConstraint.isEmpty()) {
             client->constraintsInvalid(invalidConstraint);
             return;
@@ -74,7 +74,7 @@ void MediaStreamCenterMac::validateRequestConstraints(PassRefPtr<MediaStreamCrea
 
     if (videoConstraints) {
         String invalidConstraint;
-        AVCaptureDeviceManager::shared().verifyConstraintsForMediaType(MediaStreamSource::Video, videoConstraints.get(), invalidConstraint);
+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(MediaStreamSource::Video, videoConstraints.get(), invalidConstraint);
         if (!invalidConstraint.isEmpty()) {
             client->constraintsInvalid(invalidConstraint);
             return;
@@ -95,13 +95,13 @@ void MediaStreamCenterMac::createMediaStream(PassRefPtr<MediaStreamCreationClien
     
     if (audioConstraints) {
         String invalidConstraint;
-        AVCaptureDeviceManager::shared().verifyConstraintsForMediaType(MediaStreamSource::Audio, audioConstraints.get(), invalidConstraint);
+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(MediaStreamSource::Audio, audioConstraints.get(), invalidConstraint);
         if (!invalidConstraint.isEmpty()) {
             client->failedToCreateStreamWithConstraintsError(invalidConstraint);
             return;
         }
         
-        RefPtr<MediaStreamSource> audioSource = AVCaptureDeviceManager::shared().bestSourceForTypeAndConstraints(MediaStreamSource::Audio, audioConstraints.get());
+        RefPtr<MediaStreamSource> audioSource = AVCaptureDeviceManager::singleton().bestSourceForTypeAndConstraints(MediaStreamSource::Audio, audioConstraints.get());
         ASSERT(audioSource);
         
         audioSources.append(audioSource.release());
@@ -109,13 +109,13 @@ void MediaStreamCenterMac::createMediaStream(PassRefPtr<MediaStreamCreationClien
     
     if (videoConstraints) {
         String invalidConstraint;
-        AVCaptureDeviceManager::shared().verifyConstraintsForMediaType(MediaStreamSource::Video, videoConstraints.get(), invalidConstraint);
+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(MediaStreamSource::Video, videoConstraints.get(), invalidConstraint);
         if (!invalidConstraint.isEmpty()) {
             client->failedToCreateStreamWithConstraintsError(invalidConstraint);
             return;
         }
         
-        RefPtr<MediaStreamSource> videoSource = AVCaptureDeviceManager::shared().bestSourceForTypeAndConstraints(MediaStreamSource::Video, videoConstraints.get());
+        RefPtr<MediaStreamSource> videoSource = AVCaptureDeviceManager::singleton().bestSourceForTypeAndConstraints(MediaStreamSource::Video, videoConstraints.get());
         ASSERT(videoSource);
         
         videoSources.append(videoSource.release());
@@ -128,7 +128,7 @@ bool MediaStreamCenterMac::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrac
 {
     RefPtr<MediaStreamTrackSourcesRequestClient> requestClient = prpClient;
 
-    Vector<RefPtr<TrackSourceInfo>> sources = AVCaptureDeviceManager::shared().getSourcesInfo(requestClient->requestOrigin());
+    Vector<RefPtr<TrackSourceInfo>> sources = AVCaptureDeviceManager::singleton().getSourcesInfo(requestClient->requestOrigin());
 
     requestClient->didCompleteRequest(sources);
     return true;
index 85ea667..3706b5c 100644 (file)
@@ -50,7 +50,7 @@ static const int gMaxRequestsToQueue = 64;
 // If there were queued names that couldn't be sent simultaneously, check the state of resolvers after this delay.
 static const double gRetryResolvingInSeconds = 0.1;
 
-DNSResolveQueue& DNSResolveQueue::shared()
+DNSResolveQueue& DNSResolveQueue::singleton()
 {
     static NeverDestroyed<DNSResolveQueue> queue;
 
index cd9ba0f..27f00d8 100644 (file)
@@ -39,7 +39,7 @@ class DNSResolveQueue {
     friend NeverDestroyed<DNSResolveQueue>;
 
 public:
-    static DNSResolveQueue& shared();
+    static DNSResolveQueue& singleton();
 
     void add(const String& hostname);
     void decrementRequestCount()
index bd40572..e6fea6d 100644 (file)
@@ -77,7 +77,7 @@ bool DNSResolveQueue::platformProxyIsEnabledInSystemPreferences()
 
 static void clientCallback(CFHostRef theHost, CFHostInfoType, const CFStreamError*, void*)
 {
-    DNSResolveQueue::shared().decrementRequestCount(); // It's ok to call shared() from a secondary thread, the static variable has already been initialized by now.
+    DNSResolveQueue::singleton().decrementRequestCount(); // It's ok to call singleton() from a secondary thread, the static variable has already been initialized by now.
     CFRelease(theHost);
 }
 
@@ -109,7 +109,7 @@ void prefetchDNS(const String& hostname)
     ASSERT(isMainThread());
     if (hostname.isEmpty())
         return;
-    DNSResolveQueue::shared().add(hostname);
+    DNSResolveQueue::singleton().add(hostname);
 }
 
 }
index ca41484..a4fb24b 100644 (file)
@@ -47,7 +47,7 @@ bool DNSResolveQueue::platformProxyIsEnabledInSystemPreferences()
 
 static void resolvedCallback(SoupAddress*, guint, void*)
 {
-    DNSResolveQueue::shared().decrementRequestCount();
+    DNSResolveQueue::singleton().decrementRequestCount();
 }
 
 void DNSResolveQueue::platformResolve(const String& hostname)
@@ -63,7 +63,7 @@ void prefetchDNS(const String& hostname)
     if (hostname.isEmpty())
         return;
 
-    DNSResolveQueue::shared().add(hostname);
+    DNSResolveQueue::singleton().add(hostname);
 }
 
 }
index b3d1aa8..87de756 100644 (file)
@@ -304,7 +304,7 @@ void Internals::resetToConsistentState(Page* page)
     AXObjectCache::disableAccessibility();
 #endif
 
-    MockPageOverlayClient::shared().uninstallAllOverlays();
+    MockPageOverlayClient::singleton().uninstallAllOverlays();
 }
 
 Internals::Internals(Document* document)
@@ -2431,7 +2431,7 @@ void Internals::installMockPageOverlay(const String& overlayType, ExceptionCode&
         return;
     }
 
-    MockPageOverlayClient::shared().installOverlay(document->frame()->mainFrame(), overlayType == "view" ? PageOverlay::OverlayType::View : PageOverlay::OverlayType::Document);
+    MockPageOverlayClient::singleton().installOverlay(document->frame()->mainFrame(), overlayType == "view" ? PageOverlay::OverlayType::View : PageOverlay::OverlayType::Document);
 }
 
 String Internals::pageOverlayLayerTreeAsText(ExceptionCode& ec) const
@@ -2444,7 +2444,7 @@ String Internals::pageOverlayLayerTreeAsText(ExceptionCode& ec) const
 
     document->updateLayout();
 
-    return MockPageOverlayClient::shared().layerTreeAsText(document->frame()->mainFrame());
+    return MockPageOverlayClient::singleton().layerTreeAsText(document->frame()->mainFrame());
 }
 
 void Internals::setPageMuted(bool muted)
index be09c3d..61f19bf 100644 (file)
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-MockPageOverlayClient& MockPageOverlayClient::shared()
+MockPageOverlayClient& MockPageOverlayClient::singleton()
 {
     static NeverDestroyed<MockPageOverlayClient> sharedClient;
     return sharedClient.get();
index 7d463f2..1dd297b 100644 (file)
@@ -36,7 +36,7 @@ class MainFrame;
 class MockPageOverlayClient final : public PageOverlay::Client {
     friend class NeverDestroyed<MockPageOverlayClient>;
 public:
-    static MockPageOverlayClient& shared();
+    static MockPageOverlayClient& singleton();
 
     explicit MockPageOverlayClient();
 
index 0fbeb1d..3c2dca5 100644 (file)
@@ -141,7 +141,7 @@ void WorkerThread::workerThread()
 {
     // Propagate the mainThread's fenv to workers.
 #if PLATFORM(IOS)
-    FloatingPointEnvironment::shared().propagateMainThreadEnvironment();
+    FloatingPointEnvironment::singleton().propagateMainThreadEnvironment();
 #endif
 
     {
index 31e2626..f90a570 100644 (file)
@@ -1,3 +1,18 @@
+2015-01-30  Chris Dumez  <cdumez@apple.com>
+
+        Rename shared() static member functions to singleton() for singleton classes.
+        https://bugs.webkit.org/show_bug.cgi?id=141088
+
+        Reviewed by Ryosuke Niwa and Benjamin Poulain.
+
+        Rename shared() static member functions to singleton() for singleton
+        classes as per the recent coding style change.
+
+        * Storage/WebDatabaseProvider.cpp:
+        (WebDatabaseProvider::singleton):
+        (WebDatabaseProvider::shared): Deleted.
+        * Storage/WebDatabaseProvider.h:
+
 2015-01-29  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Build fix after r179368.
index 6be829a..d150eca 100644 (file)
@@ -28,7 +28,7 @@
 #include <WebCore/IDBFactoryBackendInterface.h>
 #include <wtf/NeverDestroyed.h>
 
-WebDatabaseProvider& WebDatabaseProvider::shared()
+WebDatabaseProvider& WebDatabaseProvider::singleton()
 {
     static WebDatabaseProvider& databaseProvider = adoptRef(*new WebDatabaseProvider).leakRef();
 
index 32dc27a..ca21180 100644 (file)
@@ -32,7 +32,7 @@
 class WebDatabaseProvider final : public WebCore::DatabaseProvider {
     friend class NeverDestroyed<WebDatabaseProvider>;
 public:
-    static WebDatabaseProvider& shared();
+    static WebDatabaseProvider& singleton();
     virtual ~WebDatabaseProvider();
 
 private:
index 1ae5434..13e9125 100644 (file)
@@ -1,3 +1,13 @@
+2015-01-30  Chris Dumez  <cdumez@apple.com>
+
+        Rename shared() static member functions to singleton() for singleton classes.
+        https://bugs.webkit.org/show_bug.cgi?id=141088
+
+        Reviewed by Ryosuke Niwa and Benjamin Poulain.
+
+        Rename shared() static member functions to singleton() for singleton
+        classes as per the recent coding style change.
+
 2015-01-29  Beth Dakin  <bdakin@apple.com>
 
         Remove more Mountain Lion code from WebKit
index 6b45002..ebfbd4d 100644 (file)
@@ -355,7 +355,7 @@ static bool bumperCarBackForwardHackNeeded()
 
 - (NSUInteger)pageCacheSize
 {
-    return [kit(core(self)->page()) usesPageCache] ? PageCache::shared().maxSize() : 0;
+    return [kit(core(self)->page()) usesPageCache] ? PageCache::singleton().maxSize() : 0;
 }
 
 - (int)backListCount
index baee3d0..4431a90 100644 (file)
     WebCore::cacheStorage().empty();
 
     // Empty the Cross-Origin Preflight cache
-    WebCore::CrossOriginPreflightResultCache::shared().empty();
+    WebCore::CrossOriginPreflightResultCache::singleton().empty();
 }
 
 #if PLATFORM(IOS)
index 563ec8e..e8dcb24 100644 (file)
@@ -224,12 +224,12 @@ using namespace WebCore;
 
 + (int)cachedPageCount
 {
-    return PageCache::shared().pageCount();
+    return PageCache::singleton().pageCount();
 }
 
 + (int)cachedFrameCount
 {
-    return PageCache::shared().frameCount();
+    return PageCache::singleton().frameCount();
 }
 
 // Deprecated
index 1486d92..fcb220a 100644 (file)
@@ -42,7 +42,7 @@ class NetscapePluginHostProxy;
 
 class NetscapePluginHostManager {
 public:
-    static NetscapePluginHostManager& shared();
+    static NetscapePluginHostManager& singleton();
     
     PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(const String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled, bool hostLayersInWindowServer);
 
index 1f9facb..40ecb20 100644 (file)
@@ -49,7 +49,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-NetscapePluginHostManager& NetscapePluginHostManager::shared()
+NetscapePluginHostManager& NetscapePluginHostManager::singleton()
 {
     DEPRECATED_DEFINE_STATIC_LOCAL(NetscapePluginHostManager, pluginHostManager, ());
     
index 5705cfb..9cd655c 100644 (file)
@@ -146,7 +146,7 @@ void NetscapePluginHostProxy::pluginHostDied()
     for (PluginInstanceMap::const_iterator it = instances.begin(); it != end; ++it)
         it->value->pluginHostDied();
     
-    NetscapePluginHostManager::shared().pluginHostDied(this);
+    NetscapePluginHostManager::singleton().pluginHostDied(this);
     
     // The plug-in crashed while its menu bar was hidden. Make sure to show it.
     if (!m_menuBarIsVisible)
index e4297fa..7600583 100644 (file)
@@ -130,7 +130,7 @@ extern "C" {
     acceleratedCompositingEnabled = [[[self webView] preferences] acceleratedCompositingEnabled];
     _hostsLayersInWindowServer = [self windowHostsLayersInWindowServer];
 
-    _proxy = NetscapePluginHostManager::shared().instantiatePlugin([_pluginPackage.get() path], [_pluginPackage.get() pluginHostArchitecture], [_pluginPackage.get() bundleIdentifier], self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(),
+    _proxy = NetscapePluginHostManager::singleton().instantiatePlugin([_pluginPackage.get() path], [_pluginPackage.get() pluginHostArchitecture], [_pluginPackage.get() bundleIdentifier], self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(),
                                                                    _mode == NP_FULL, _isPrivateBrowsingEnabled, acceleratedCompositingEnabled, _hostsLayersInWindowServer);
     if (!_proxy) 
         return NO;
index 9e34582..1906ef3 100644 (file)
@@ -221,7 +221,7 @@ using namespace WebCore;
 
 - (void)createPropertyListFile
 {
-    NetscapePluginHostManager::shared().createPropertyListFile(path, pluginHostArchitecture, [self bundleIdentifier]);
+    NetscapePluginHostManager::singleton().createPropertyListFile(path, pluginHostArchitecture, [self bundleIdentifier]);
 }
 
 #endif
index c50bc2a..83d4865 100644 (file)
@@ -297,7 +297,7 @@ Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest&, const
 
 #if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
     if (newWebView)
-        WebKit::NetscapePluginHostManager::shared().didCreateWindow();
+        WebKit::NetscapePluginHostManager::singleton().didCreateWindow();
 #endif
     
     return core(newWebView);
index 8447164..e1f37db 100644 (file)
@@ -842,7 +842,7 @@ Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction&)
     
 #if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
     if (newWebView)
-        WebKit::NetscapePluginHostManager::shared().didCreateWindow();
+        WebKit::NetscapePluginHostManager::singleton().didCreateWindow();
 #endif
         
     return core([newWebView mainFrame]);
index 4f2e221..332f6eb 100644 (file)
@@ -74,7 +74,7 @@ void WebVisitedLinkStore::removeAllVisitedLinks()
 {
     for (auto& visitedLinkStore : visitedLinkStores())
         visitedLinkStore->removeVisitedLinkHashes();
-    PageCache::shared().markPagesForVisitedLinkStyleRecalc();
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 void WebVisitedLinkStore::addVisitedLink(NSString *urlString)
@@ -103,7 +103,7 @@ void WebVisitedLinkStore::removeVisitedLink(NSString *urlString)
     m_visitedLinkHashes.remove(linkHash);
 
     invalidateStylesForLink(linkHash);
-    PageCache::shared().markPagesForVisitedLinkStyleRecalc();
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 bool WebVisitedLinkStore::isLinkVisited(Page& page, LinkHash linkHash, const URL& baseURL, const AtomicString& attributeURL)
@@ -152,7 +152,7 @@ void WebVisitedLinkStore::addVisitedLinkHash(LinkHash linkHash)
     m_visitedLinkHashes.add(linkHash);
 
     invalidateStylesForLink(linkHash);
-    PageCache::shared().markPagesForVisitedLinkStyleRecalc();
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 void WebVisitedLinkStore::removeVisitedLinkHashes()
index 0c05f2c..74ad55a 100644 (file)
@@ -849,7 +849,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     if (initialized)
         return;
 
-    GamepadProvider::shared().setSharedProvider(HIDGamepadProvider::shared());
+    GamepadProvider::singleton().setSharedProvider(HIDGamepadProvider::singleton());
     initialized = true;
 }
 #endif
@@ -957,7 +957,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     pageConfiguration.alternativeTextClient = new WebAlternativeTextClient(self);
     pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(self);
-    pageConfiguration.databaseProvider = &WebDatabaseProvider::shared();
+    pageConfiguration.databaseProvider = &WebDatabaseProvider::singleton();
     pageConfiguration.storageNamespaceProvider = &_private->group->storageNamespaceProvider();
     pageConfiguration.userContentController = &_private->group->userContentController();
     pageConfiguration.visitedLinkStore = &_private->group->visitedLinkStore();
@@ -1190,7 +1190,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     pageConfiguration.inspectorClient = new WebInspectorClient(self);
     pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(self);
-    pageConfiguration.databaseProvider = &WebDatabaseProvider::shared();
+    pageConfiguration.databaseProvider = &WebDatabaseProvider::singleton();
     pageConfiguration.storageNamespaceProvider = &_private->group->storageNamespaceProvider();
     pageConfiguration.userContentController = &_private->group->userContentController();
     pageConfiguration.visitedLinkStore = &_private->group->visitedLinkStore();
@@ -1868,12 +1868,12 @@ static bool fastDocumentTeardownEnabled()
 #if ENABLE(REMOTE_INSPECTOR)
 + (void)_enableRemoteInspector
 {
-    RemoteInspector::shared().start();
+    RemoteInspector::singleton().start();
 }
 
 + (void)_disableRemoteInspector
 {
-    RemoteInspector::shared().stop();
+    RemoteInspector::singleton().stop();
 }
 
 + (void)_disableAutoStartRemoteInspector
@@ -1883,12 +1883,12 @@ static bool fastDocumentTeardownEnabled()
 
 + (BOOL)_isRemoteInspectorEnabled
 {
-    return RemoteInspector::shared().enabled();
+    return RemoteInspector::singleton().enabled();
 }
 
 + (BOOL)_hasRemoteInspectorSession
 {
-    return RemoteInspector::shared().hasActiveDebugSession();
+    return RemoteInspector::singleton().hasActiveDebugSession();
 }
 
 - (BOOL)allowsRemoteInspection
@@ -1926,7 +1926,7 @@ static bool fastDocumentTeardownEnabled()
 - (void)_setHostApplicationProcessIdentifier:(pid_t)pid auditToken:(audit_token_t)auditToken
 {
     RetainPtr<CFDataRef> auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&auditToken, sizeof(auditToken)));
-    RemoteInspector::shared().setParentProcessInformation(pid, auditData);
+    RemoteInspector::singleton().setParentProcessInformation(pid, auditData);
 }
 #endif // PLATFORM(IOS)
 #endif // ENABLE(REMOTE_INSPECTOR)
@@ -7915,9 +7915,11 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num)
 
     memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
     memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
-    PageCache::shared().setMaxSize(pageCacheSize);
+
+    auto& pageCache = PageCache::singleton();
+    pageCache.setMaxSize(pageCacheSize);
 #if PLATFORM(IOS)
-    PageCache::shared().setShouldClearBackingStores(true);
+    pageCache.setShouldClearBackingStores(true);
     nsurlCacheMemoryCapacity = std::max(nsurlCacheMemoryCapacity, [nsurlCache memoryCapacity]);
     CFURLCacheRef cfCache;
     if ([nsurlCache respondsToSelector:@selector(_CFURLCache)] && (cfCache = [nsurlCache _CFURLCache]))
index b46c928..ce59fec 100644 (file)
@@ -1,3 +1,13 @@
+2015-01-30  Chris Dumez  <cdumez@apple.com>
+
+        Rename shared() static member functions to singleton() for singleton classes.
+        https://bugs.webkit.org/show_bug.cgi?id=141088
+
+        Reviewed by Ryosuke Niwa and Benjamin Poulain.
+
+        Rename shared() static member functions to singleton() for singleton
+        classes as per the recent coding style change.
+
 2015-01-29  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Build fix after r179368.
index 7c2c0cf..da2726b 100644 (file)
@@ -215,7 +215,7 @@ HRESULT STDMETHODCALLTYPE WebCache::empty( void)
     WebCore::cacheStorage().empty();
 
     // Empty the Cross-Origin Preflight cache
-    WebCore::CrossOriginPreflightResultCache::shared().empty();
+    WebCore::CrossOriginPreflightResultCache::singleton().empty();
 
     return S_OK;
 }
index b43071c..1680265 100644 (file)
@@ -327,7 +327,7 @@ HRESULT WebCoreStatistics::cachedPageCount(INT* count)
     if (!count)
         return E_POINTER;
 
-    *count = PageCache::shared().pageCount();
+    *count = PageCache::singleton().pageCount();
     return S_OK;
 }
 
@@ -336,6 +336,6 @@ HRESULT WebCoreStatistics::cachedFrameCount(INT* count)
     if (!count)
         return E_POINTER;
 
-    *count = PageCache::shared().frameCount();
+    *count = PageCache::singleton().frameCount();
     return S_OK;
 }
index 49c0376..c2b19f1 100644 (file)
@@ -34,7 +34,7 @@ using namespace WebCore;
 
 static bool s_shouldTrackVisitedLinks;
 
-WebVisitedLinkStore& WebVisitedLinkStore::shared()
+WebVisitedLinkStore& WebVisitedLinkStore::singleton()
 {
     static WebVisitedLinkStore& visitedLinkStore = *adoptRef(new WebVisitedLinkStore).leakRef();
     
@@ -62,8 +62,8 @@ void WebVisitedLinkStore::setShouldTrackVisitedLinks(bool shouldTrackVisitedLink
 
 void WebVisitedLinkStore::removeAllVisitedLinks()
 {
-    shared().removeVisitedLinkHashes();
-    PageCache::shared().markPagesForVisitedLinkStyleRecalc();
+    WebVisitedLinkStore::singleton().removeVisitedLinkHashes();
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 void WebVisitedLinkStore::addVisitedLink(const String& urlString)
@@ -116,7 +116,7 @@ void WebVisitedLinkStore::addVisitedLinkHash(LinkHash linkHash)
     m_visitedLinkHashes.add(linkHash);
 
     invalidateStylesForLink(linkHash);
-    PageCache::shared().markPagesForVisitedLinkStyleRecalc();
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 void WebVisitedLinkStore::removeVisitedLinkHashes()
index 7e7a074..64a980f 100644 (file)
@@ -32,7 +32,7 @@
 
 class WebVisitedLinkStore final : public WebCore::VisitedLinkStore {
 public:
-    static WebVisitedLinkStore& shared();
+    static WebVisitedLinkStore& singleton();
     WebVisitedLinkStore();
     virtual ~WebVisitedLinkStore();
 
index f4d5e7f..99d353c 100644 (file)
@@ -675,7 +675,7 @@ void WebView::setCacheModel(WebCacheModel cacheModel)
 
     memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
     memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
-    PageCache::shared().setMaxSize(pageCacheSize);
+    PageCache::singleton().setMaxSize(pageCacheSize);
 
 #if USE(CFNETWORK)
     // Don't shrink a big disk cache, since that would cause churn.
@@ -2805,10 +2805,10 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
     configuration.dragClient = new WebDragClient(this);
     configuration.inspectorClient = m_inspectorClient;
     configuration.loaderClientForMainFrame = new WebFrameLoaderClient;
-    configuration.databaseProvider = &WebDatabaseProvider::shared();
+    configuration.databaseProvider = &WebDatabaseProvider::singleton();
     configuration.storageNamespaceProvider = WebStorageNamespaceProvider::create(localStorageDatabasePath(m_preferences.get()));
     configuration.progressTrackerClient = static_cast<WebFrameLoaderClient*>(configuration.loaderClientForMainFrame);
-    configuration.visitedLinkStore = &WebVisitedLinkStore::shared();
+    configuration.visitedLinkStore = &WebVisitedLinkStore::singleton();
 
     m_page = new Page(configuration);
     provideGeolocationTo(m_page, new WebGeolocationClient(this));
@@ -6464,7 +6464,7 @@ HRESULT WebView::historyDelegate(IWebHistoryDelegate** historyDelegate)
 
 HRESULT WebView::addVisitedLinks(BSTR* visitedURLs, unsigned visitedURLCount)
 {
-    auto& visitedLinkStore = WebVisitedLinkStore::shared();
+    auto& visitedLinkStore = WebVisitedLinkStore::singleton();
     PageGroup& group = core(this)->group();
     
     for (unsigned i = 0; i < visitedURLCount; ++i) {
index 80875af..aa3cdb9 100644 (file)
@@ -1,3 +1,13 @@
+2015-01-30  Chris Dumez  <cdumez@apple.com>
+
+        Rename shared() static member functions to singleton() for singleton classes.
+        https://bugs.webkit.org/show_bug.cgi?id=141088
+
+        Reviewed by Ryosuke Niwa and Benjamin Poulain.
+
+        Rename shared() static member functions to singleton() for singleton
+        classes as per the recent coding style change.
+
 2015-01-30  Alexey Proskuryakov  <ap@apple.com>
 
         Build fix.
index 85a9000..9e59ebe 100644 (file)
@@ -47,7 +47,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-DatabaseProcess& DatabaseProcess::shared()
+DatabaseProcess& DatabaseProcess::singleton()
 {
     static NeverDestroyed<DatabaseProcess> databaseProcess;
     return databaseProcess;
index b2b24ee..6eaeedf 100644 (file)
@@ -48,7 +48,7 @@ class DatabaseProcess : public ChildProcess, public WebOriginDataManagerSuppleme
     WTF_MAKE_NONCOPYABLE(DatabaseProcess);
     friend class NeverDestroyed<DatabaseProcess>;
 public:
-    static DatabaseProcess& shared();
+    static DatabaseProcess& singleton();
     ~DatabaseProcess();
 
     const String& indexedDatabaseDirectory() const { return m_indexedDatabaseDirectory; }
index 8bd06b3..6035880 100644 (file)
@@ -71,7 +71,7 @@ void DatabaseProcessIDBConnection::disconnectedFromWebProcess()
 
 void DatabaseProcessIDBConnection::establishConnection(const String& databaseName, const SecurityOriginData& openingOrigin, const SecurityOriginData& mainFrameOrigin)
 {
-    m_uniqueIDBDatabase = DatabaseProcess::shared().getOrCreateUniqueIDBDatabase(UniqueIDBDatabaseIdentifier(databaseName, openingOrigin, mainFrameOrigin));
+    m_uniqueIDBDatabase = DatabaseProcess::singleton().getOrCreateUniqueIDBDatabase(UniqueIDBDatabaseIdentifier(databaseName, openingOrigin, mainFrameOrigin));
     m_uniqueIDBDatabase->registerConnection(*this);
 }
 
index b301225..15c7f11 100644 (file)
@@ -69,7 +69,7 @@ UniqueIDBDatabase::UniqueIDBDatabase(const UniqueIDBDatabaseIdentifier& identifi
     // Each unique Indexed Database exists in a directory named for the database, which exists in a directory representing its opening origin.
     m_databaseRelativeDirectory = pathByAppendingComponent(databaseFilenameIdentifier(identifier.openingOrigin()), filenameForDatabaseName());
 
-    DatabaseProcess::shared().ensureIndexedDatabaseRelativePathExists(m_databaseRelativeDirectory);
+    DatabaseProcess::singleton().ensureIndexedDatabaseRelativePathExists(m_databaseRelativeDirectory);
 }
 
 UniqueIDBDatabase::~UniqueIDBDatabase()
@@ -118,7 +118,7 @@ void UniqueIDBDatabase::unregisterConnection(DatabaseProcessIDBConnection& conne
 
     if (m_connections.isEmpty() && m_pendingTransactionRollbacks.isEmpty()) {
         shutdown(UniqueIDBDatabaseShutdownType::NormalShutdown);
-        DatabaseProcess::shared().removeUniqueIDBDatabase(*this);
+        DatabaseProcess::singleton().removeUniqueIDBDatabase(*this);
     }
 }
 
@@ -1125,7 +1125,7 @@ void UniqueIDBDatabase::finalizeRollback(const WebKit::IDBIdentifier& transactio
         resetTransaction(transactionId, [this, transactionId](bool) {
             if (m_acceptingNewRequests && m_connections.isEmpty() && m_pendingTransactionRollbacks.isEmpty()) {
                 shutdown(UniqueIDBDatabaseShutdownType::NormalShutdown);
-                DatabaseProcess::shared().removeUniqueIDBDatabase(*this);
+                DatabaseProcess::singleton().removeUniqueIDBDatabase(*this);
             }
         });
     });
@@ -1134,7 +1134,7 @@ void UniqueIDBDatabase::finalizeRollback(const WebKit::IDBIdentifier& transactio
 String UniqueIDBDatabase::absoluteDatabaseDirectory() const
 {
     ASSERT(RunLoop::isMain());
-    return DatabaseProcess::shared().absoluteIndexedDatabasePathFromDatabaseRelativePath(m_databaseRelativeDirectory);
+    return DatabaseProcess::singleton().absoluteIndexedDatabasePathFromDatabaseRelativePath(m_databaseRelativeDirectory);
 }
 
 void UniqueIDBDatabase::postMainThreadTask(std::unique_ptr<AsyncTask> task, DatabaseTaskType taskType)
@@ -1189,7 +1189,7 @@ void UniqueIDBDatabase::postDatabaseTask(std::unique_ptr<AsyncTask> task, Databa
     m_databaseTasks.append(WTF::move(task));
 
     RefPtr<UniqueIDBDatabase> database(this);
-    DatabaseProcess::shared().queue().dispatch([database] {
+    DatabaseProcess::singleton().queue().dispatch([database] {
         database->performNextDatabaseTask();
     });
 }
index c60188c..ea520a9 100644 (file)
@@ -39,7 +39,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-NetworkBlobRegistry& NetworkBlobRegistry::shared()
+NetworkBlobRegistry& NetworkBlobRegistry::singleton()
 {
     ASSERT(RunLoop::isMain());
     static NeverDestroyed<NetworkBlobRegistry> registry;
index e5db63e..0030e0c 100644 (file)
@@ -46,7 +46,7 @@ class NetworkBlobRegistry {
 WTF_MAKE_NONCOPYABLE(NetworkBlobRegistry);
 public:
     NetworkBlobRegistry();
-    static NetworkBlobRegistry& shared();
+    static NetworkBlobRegistry& singleton();
 
     void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, PassRefPtr<SandboxExtension>, const String& contentType);
     void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType);
index 46deabe..70b6afd 100644 (file)
@@ -106,8 +106,8 @@ void NetworkConnectionToWebProcess::didClose(IPC::Connection&)
         loader->abort();
     ASSERT(m_networkResourceLoaders.isEmpty());
 
-    NetworkBlobRegistry::shared().connectionToWebProcessDidClose(this);
-    NetworkProcess::shared().removeNetworkConnectionToWebProcess(this);
+    NetworkBlobRegistry::singleton().connectionToWebProcessDidClose(this);
+    NetworkProcess::singleton().removeNetworkConnectionToWebProcess(this);
 }
 
 void NetworkConnectionToWebProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference, IPC::StringReference)
@@ -118,14 +118,14 @@ void NetworkConnectionToWebProcess::scheduleResourceLoad(const NetworkResourceLo
 {
     RefPtr<NetworkResourceLoader> loader = NetworkResourceLoader::create(loadParameters, this);
     m_networkResourceLoaders.add(loadParameters.identifier, loader);
-    NetworkProcess::shared().networkResourceLoadScheduler().scheduleLoader(loader.get());
+    NetworkProcess::singleton().networkResourceLoadScheduler().scheduleLoader(loader.get());
 }
 
 void NetworkConnectionToWebProcess::performSynchronousLoad(const NetworkResourceLoadParameters& loadParameters, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> reply)
 {
     RefPtr<NetworkResourceLoader> loader = NetworkResourceLoader::create(loadParameters, this, reply);
     m_networkResourceLoaders.add(loadParameters.identifier, loader);
-    NetworkProcess::shared().networkResourceLoadScheduler().scheduleLoader(loader.get());
+    NetworkProcess::singleton().networkResourceLoadScheduler().scheduleLoader(loader.get());
 }
 
 void NetworkConnectionToWebProcess::removeLoadIdentifier(ResourceLoadIdentifier identifier)
@@ -176,18 +176,19 @@ static NetworkStorageSession& storageSession(SessionID sessionID)
 void NetworkConnectionToWebProcess::startDownload(SessionID, uint64_t downloadID, const ResourceRequest& request)
 {
     // FIXME: Do something with the session ID.
-    NetworkProcess::shared().downloadManager().startDownload(downloadID, request);
+    NetworkProcess::singleton().downloadManager().startDownload(downloadID, request);
 }
 
 void NetworkConnectionToWebProcess::convertMainResourceLoadToDownload(uint64_t mainResourceLoadIdentifier, uint64_t downloadID, const ResourceRequest& request, const ResourceResponse& response)
 {
+    auto& networkProcess = NetworkProcess::singleton();
     if (!mainResourceLoadIdentifier) {
-        NetworkProcess::shared().downloadManager().startDownload(downloadID, request);
+        networkProcess.downloadManager().startDownload(downloadID, request);
         return;
     }
 
     NetworkResourceLoader* loader = m_networkResourceLoaders.get(mainResourceLoadIdentifier);
-    NetworkProcess::shared().downloadManager().convertHandleToDownload(downloadID, loader->handle(), request, response);
+    networkProcess.downloadManager().convertHandleToDownload(downloadID, loader->handle(), request, response);
 
     // Unblock the URL connection operation queue.
     loader->handle()->continueDidReceiveResponse();
@@ -229,32 +230,32 @@ void NetworkConnectionToWebProcess::registerFileBlobURL(const URL& url, const St
 {
     RefPtr<SandboxExtension> extension = SandboxExtension::create(extensionHandle);
 
-    NetworkBlobRegistry::shared().registerFileBlobURL(this, url, path, extension.release(), contentType);
+    NetworkBlobRegistry::singleton().registerFileBlobURL(this, url, path, extension.release(), contentType);
 }
 
 void NetworkConnectionToWebProcess::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
 {
-    NetworkBlobRegistry::shared().registerBlobURL(this, url, WTF::move(blobParts), contentType);
+    NetworkBlobRegistry::singleton().registerBlobURL(this, url, WTF::move(blobParts), contentType);
 }
 
 void NetworkConnectionToWebProcess::registerBlobURLFromURL(const URL& url, const URL& srcURL)
 {
-    NetworkBlobRegistry::shared().registerBlobURL(this, url, srcURL);
+    NetworkBlobRegistry::singleton().registerBlobURL(this, url, srcURL);
 }
 
 void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end)
 {
-    NetworkBlobRegistry::shared().registerBlobURLForSlice(this, url, srcURL, start, end);
+    NetworkBlobRegistry::singleton().registerBlobURLForSlice(this, url, srcURL, start, end);
 }
 
 void NetworkConnectionToWebProcess::unregisterBlobURL(const URL& url)
 {
-    NetworkBlobRegistry::shared().unregisterBlobURL(this, url);
+    NetworkBlobRegistry::singleton().unregisterBlobURL(this, url);
 }
 
 void NetworkConnectionToWebProcess::blobSize(const URL& url, uint64_t& resultSize)
 {
-    resultSize = NetworkBlobRegistry::shared().blobSize(this, url);
+    resultSize = NetworkBlobRegistry::singleton().blobSize(this, url);
 }
 
 } // namespace WebKit
index 909af0e..69a6383 100644 (file)
@@ -60,7 +60,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-NetworkProcess& NetworkProcess::shared()
+NetworkProcess& NetworkProcess::singleton()
 {
     static NeverDestroyed<NetworkProcess> networkProcess;
     return networkProcess;
@@ -191,7 +191,7 @@ void NetworkProcess::initializeConnection(IPC::Connection* connection)
     ChildProcess::initializeConnection(connection);
 
 #if ENABLE(SEC_ITEM_SHIM)
-    SecItemShim::shared().initializeConnection(connection);
+    SecItemShim::singleton().initializeConnection(connection);
 #endif
 
     NetworkProcessSupplementMap::const_iterator it = m_supplements.begin();
@@ -288,14 +288,15 @@ void NetworkProcess::setCanHandleHTTPSServerTrustEvaluation(bool value)
 
 void NetworkProcess::getNetworkProcessStatistics(uint64_t callbackID)
 {
-    NetworkResourceLoadScheduler& scheduler = NetworkProcess::shared().networkResourceLoadScheduler();
+    NetworkResourceLoadScheduler& scheduler = NetworkProcess::singleton().networkResourceLoadScheduler();
 
     StatisticsData data;
 
+    auto& networkProcess = NetworkProcess::singleton();
     data.statisticsNumbers.set("LoadsPendingCount", scheduler.loadsPendingCount());
     data.statisticsNumbers.set("LoadsActiveCount", scheduler.loadsActiveCount());
-    data.statisticsNumbers.set("DownloadsActiveCount", shared().downloadManager().activeDownloadCount());
-    data.statisticsNumbers.set("OutstandingAuthenticationChallengesCount", shared().authenticationManager().outstandingAuthenticationChallengeCount());
+    data.statisticsNumbers.set("DownloadsActiveCount", networkProcess.downloadManager().activeDownloadCount());
+    data.statisticsNumbers.set("OutstandingAuthenticationChallengesCount", networkProcess.authenticationManager().outstandingAuthenticationChallengeCount());
 
     parentProcessConnection()->send(Messages::WebProcessPool::DidGetStatistics(data, callbackID), 0);
 }
index d57f751..ad1e291 100644 (file)
@@ -53,7 +53,7 @@ class NetworkProcess : public ChildProcess, private DownloadManager::Client {
     friend class NeverDestroyed<NetworkProcess>;
     friend class NeverDestroyed<DownloadManager>;
 public:
-    static NetworkProcess& shared();
+    static NetworkProcess& singleton();
 
     template <typename T>
     T* supplement()
index dac75af..cf7a470 100644 (file)
@@ -100,13 +100,13 @@ NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters
     if (originalRequest().httpBody()) {
         for (const FormDataElement& element : originalRequest().httpBody()->elements()) {
             if (element.m_type == FormDataElement::Type::EncodedBlob)
-                m_fileReferences.appendVector(NetworkBlobRegistry::shared().filesInBlob(connection, element.m_url));
+                m_fileReferences.appendVector(NetworkBlobRegistry::singleton().filesInBlob(connection, element.m_url));
         }
     }
 
     if (originalRequest().url().protocolIs("blob")) {
         ASSERT(!m_parameters.resourceSandboxExtension);
-        m_fileReferences.appendVector(NetworkBlobRegistry::shared().filesInBlob(connection, originalRequest().url()));
+        m_fileReferences.appendVector(NetworkBlobRegistry::singleton().filesInBlob(connection, originalRequest().url()));
     }
 
     if (synchronousReply)
@@ -135,13 +135,13 @@ void NetworkResourceLoader::start()
     m_currentRequest = originalRequest();
 
 #if ENABLE(NETWORK_CACHE)
-    if (!NetworkCache::shared().isEnabled() || sessionID().isEphemeral()) {
+    if (!NetworkCache::singleton().isEnabled() || sessionID().isEphemeral()) {
         startNetworkLoad();
         return;
     }
 
     RefPtr<NetworkResourceLoader> loader(this);
-    NetworkCache::shared().retrieve(originalRequest(), [loader](std::unique_ptr<NetworkCache::Entry> entry) {
+    NetworkCache::singleton().retrieve(originalRequest(), [loader](std::unique_ptr<NetworkCache::Entry> entry) {
         if (loader->hasOneRef()) {
             // The loader has been aborted and is only held alive by this lambda.
             return;
@@ -175,7 +175,7 @@ void NetworkResourceLoader::startNetworkLoad()
         m_bufferedData = WebCore::SharedBuffer::create();
 
 #if ENABLE(NETWORK_CACHE)
-    if (NetworkCache::shared().isEnabled())
+    if (NetworkCache::singleton().isEnabled())
         m_bufferedDataForCache = WebCore::SharedBuffer::create();
 #endif
 
@@ -204,7 +204,7 @@ void NetworkResourceLoader::cleanup()
 
     invalidateSandboxExtensions();
 
-    NetworkProcess::shared().networkResourceLoadScheduler().removeLoader(this);
+    NetworkProcess::singleton().networkResourceLoadScheduler().removeLoader(this);
 
     m_handle = nullptr;
 
@@ -257,7 +257,7 @@ void NetworkResourceLoader::didReceiveResponseAsync(ResourceHandle* handle, cons
     if (m_cacheEntryForValidation) {
         bool validationSucceeded = m_response.httpStatusCode() == 304; // 304 Not Modified
         if (validationSucceeded)
-            NetworkCache::shared().update(originalRequest(), *m_cacheEntryForValidation, m_response);
+            NetworkCache::singleton().update(originalRequest(), *m_cacheEntryForValidation, m_response);
         if (!validationSucceeded || isConditionalRequest(originalRequest()))
             m_cacheEntryForValidation = nullptr;
     }
@@ -318,7 +318,7 @@ void NetworkResourceLoader::didFinishLoading(ResourceHandle* handle, double fini
     ASSERT_UNUSED(handle, handle == m_handle);
 
 #if ENABLE(NETWORK_CACHE)
-    if (NetworkCache::shared().isEnabled()) {
+    if (NetworkCache::singleton().isEnabled()) {
         if (m_cacheEntryForValidation) {
             // 304 Not Modified
             ASSERT(m_response.httpStatusCode() == 304);
@@ -337,7 +337,7 @@ void NetworkResourceLoader::didFinishLoading(ResourceHandle* handle, double fini
 
         bool isPrivate = sessionID().isEphemeral();
         if (hasCacheableRedirect && !isPrivate)
-            NetworkCache::shared().store(originalRequest(), m_response, m_bufferedDataForCache.release());
+            NetworkCache::singleton().store(originalRequest(), m_response, m_bufferedDataForCache.release());
     }
 #endif
 
@@ -474,7 +474,7 @@ void NetworkResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle* ha
         return;
     }
 
-    NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge);
+    NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge);
 }
 
 void NetworkResourceLoader::didCancelAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge&)
@@ -631,7 +631,7 @@ void NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync(ResourceH
 
     // Handle server trust evaluation at platform-level if requested, for performance reasons.
     if (protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
-        && !NetworkProcess::shared().canHandleHTTPSServerTrustEvaluation()) {
+        && !NetworkProcess::singleton().canHandleHTTPSServerTrustEvaluation()) {
         continueCanAuthenticateAgainstProtectionSpace(false);
         return;
     }
index 272020c..c1dacc1 100644 (file)
@@ -43,7 +43,7 @@
 
 namespace WebKit {
 
-NetworkCache& NetworkCache::shared()
+NetworkCache& NetworkCache::singleton()
 {
     static NeverDestroyed<NetworkCache> instance;
     return instance;
index 57da552..583ca01 100644 (file)
@@ -44,7 +44,7 @@ namespace WebKit {
 class NetworkCache {
     WTF_MAKE_NONCOPYABLE(NetworkCache);
 public:
-    static NetworkCache& shared();
+    static NetworkCache& singleton();
 
     NetworkCache();
 
index 23f1d78..7604409 100644 (file)
@@ -64,7 +64,7 @@ void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessC
     if (!m_diskCacheDirectory.isNull()) {
         SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
 #if ENABLE(NETWORK_CACHE)
-        if (parameters.shouldEnableNetworkCache && NetworkCache::shared().initialize(m_diskCacheDirectory)) {
+        if (parameters.shouldEnableNetworkCache && NetworkCache::singleton().initialize(m_diskCacheDirectory)) {
             RetainPtr<NSURLCache> urlCache(adoptNS([[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]));
             [NSURLCache setSharedURLCache:urlCache.get()];
             return;
@@ -134,8 +134,9 @@ void NetworkProcess::platformSetCacheModel(CacheModel cacheModel)
         pageCacheCapacity, urlCacheMemoryCapacity, urlCacheDiskCapacity);
 
 #if ENABLE(NETWORK_CACHE)
-    if (NetworkCache::shared().isEnabled()) {
-        NetworkCache::shared().setMaximumSize(urlCacheDiskCapacity);
+    auto& networkCache = NetworkCache::singleton();
+    if (networkCache.isEnabled()) {
+        networkCache.setMaximumSize(urlCacheDiskCapacity);
         return;
     }
 #endif
@@ -148,7 +149,7 @@ void NetworkProcess::platformSetCacheModel(CacheModel cacheModel)
 void NetworkProcess::clearDiskCache(std::chrono::system_clock::time_point modifiedSince, std::function<void ()> completionHandler)
 {
 #if ENABLE(NETWORK_CACHE)
-    NetworkCache::shared().clear();
+    NetworkCache::singleton().clear();
 #endif
 
     if (!m_clearCacheDispatchGroup)
index b299a36..1d7e052 100644 (file)
@@ -82,14 +82,14 @@ void NetworkProcess::clearCacheForAllOrigins(uint32_t cachesToClear)
     if (resourceCachesToClear == InMemoryResourceCachesOnly)
         return;
 #if ENABLE(NETWORK_CACHE)
-    NetworkCache::shared().clear();
+    NetworkCache::singleton().clear();
 #endif
 }
 
 void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters& parameters)
 {
 #if ENABLE(SEC_ITEM_SHIM)
-    SecItemShim::shared().initialize(this);
+    SecItemShim::singleton().initialize(this);
 #endif
     platformInitializeNetworkProcessCocoa(parameters);
 }
index 71d063b..fac11a4 100644 (file)
@@ -103,7 +103,7 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati
     platformInitializeNetworkProcessCocoa(parameters);
 
 #if ENABLE(SEC_ITEM_SHIM)
-    SecItemShim::shared().initialize(this);
+    SecItemShim::singleton().initialize(this);
 #endif
 
     if (!parameters.httpProxy.isNull() || !parameters.httpsProxy.isNull())
index af54b81..b4d41a5 100644 (file)
@@ -67,7 +67,7 @@ RetainPtr<CFDataRef> RemoteNetworkingContext::sourceApplicationAuditData() const
 {
 #if PLATFORM(IOS)
     audit_token_t auditToken;
-    if (!NetworkProcess::shared().parentProcessConnection()->getAuditToken(auditToken))
+    if (!NetworkProcess::singleton().parentProcessConnection()->getAuditToken(auditToken))
         return nullptr;
     return adoptCF(CFDataCreate(0, (const UInt8*)&auditToken, sizeof(auditToken)));
 #else
index 9db81c1..d9a8f60 100644 (file)
@@ -109,7 +109,7 @@ bool PluginControllerProxy::initialize(const PluginCreationParameters& creationP
     ASSERT(!m_isInitializing);
     m_isInitializing = true; // Cannot use TemporaryChange here, because this object can be deleted before the function returns.
 
-    m_plugin = NetscapePlugin::create(PluginProcess::shared().netscapePluginModule());
+    m_plugin = NetscapePlugin::create(PluginProcess::singleton().netscapePluginModule());
     if (!m_plugin) {
         // This will delete the plug-in controller proxy object.
         m_connection->removePluginControllerProxy(this, 0);
index 57a66a0..410700e 100644 (file)
@@ -48,7 +48,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PluginProcess& PluginProcess::shared()
+PluginProcess& PluginProcess::singleton()
 {
     static NeverDestroyed<PluginProcess> pluginProcess;
     return pluginProcess;
@@ -70,8 +70,9 @@ PluginProcess::~PluginProcess()
 void PluginProcess::lowMemoryHandler(bool critical)
 {
     UNUSED_PARAM(critical);
-    if (shared().shouldTerminate())
-        shared().terminate();
+    auto& pluginProcess = PluginProcess::singleton();
+    if (pluginProcess.shouldTerminate())
+        pluginProcess.terminate();
 }
 
 void PluginProcess::initializeProcess(const ChildProcessInitializationParameters& parameters)
index 3568d09..009dd75 100644 (file)
@@ -50,7 +50,7 @@ class PluginProcess : public ChildProcess, private WebCore::AudioHardwareListene
     WTF_MAKE_NONCOPYABLE(PluginProcess);
     friend class NeverDestroyed<PluginProcess>;
 public:
-    static PluginProcess& shared();
+    static PluginProcess& singleton();
 
     void removeWebProcessConnection(WebProcessConnection*);
 
index 3a74c78..0fe35d0 100644 (file)
@@ -106,12 +106,12 @@ void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pl
     m_connection = nullptr;
 
     // This will cause us to be deleted.    
-    PluginProcess::shared().removeWebProcessConnection(this);
+    PluginProcess::singleton().removeWebProcessConnection(this);
 }
 
 void WebProcessConnection::setGlobalException(const String& exceptionString)
 {
-    IPC::Connection* connection = ConnectionStack::shared().current();
+    IPC::Connection* connection = ConnectionStack::singleton().current();
     if (!connection)
         return;
 
@@ -120,7 +120,7 @@ void WebProcessConnection::setGlobalException(const String& exceptionString)
 
 void WebProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder)
 {
-    ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), &connection);
+    ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::singleton(), &connection);
 
     if (decoder.messageReceiverName() == Messages::WebProcessConnection::messageReceiverName()) {
         didReceiveWebProcessConnectionMessage(connection, decoder);
@@ -142,7 +142,7 @@ void WebProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::M
 
 void WebProcessConnection::didReceiveSyncMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder, std::unique_ptr<IPC::MessageEncoder>& replyEncoder)
 {
-    ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), &connection);
+    ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::singleton(), &connection);
 
     uint64_t destinationID = decoder.destinationID();
 
@@ -183,7 +183,7 @@ void WebProcessConnection::destroyPlugin(uint64_t pluginInstanceID, bool asynchr
     reply->send();
 
     // Ensure we don't clamp any timers during destruction
-    ActivityAssertion activityAssertion(PluginProcess::shared().connectionActivity());
+    ActivityAssertion activityAssertion(PluginProcess::singleton().connectionActivity());
 
     PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(pluginInstanceID);
     
@@ -232,7 +232,7 @@ void WebProcessConnection::createPluginInternal(const PluginCreationParameters&
 void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> reply)
 {
     // Ensure we don't clamp any timers during initialization
-    ActivityAssertion activityAssertion(PluginProcess::shared().connectionActivity());
+    ActivityAssertion activityAssertion(PluginProcess::singleton().connectionActivity());
 
     PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(creationParameters.pluginInstanceID);
 
index fc58776..b015929 100644 (file)
@@ -52,12 +52,12 @@ void PluginControllerProxy::setComplexTextInputState(PluginComplexTextInputState
 
 const MachSendRight& PluginControllerProxy::compositingRenderServerPort()
 {
-    return PluginProcess::shared().compositingRenderServerPort();
+    return PluginProcess::singleton().compositingRenderServerPort();
 }
 
 void PluginControllerProxy::openPluginPreferencePane()
 {
-    PluginProcess::shared().parentProcessConnection()->send(Messages::PluginProcessProxy::OpenPluginPreferencePane(), 0);
+    PluginProcess::singleton().parentProcessConnection()->send(Messages::PluginProcessProxy::OpenPluginPreferencePane(), 0);
 }
 
 void PluginControllerProxy::platformInitialize(const PluginCreationParameters& creationParameters)
@@ -130,7 +130,7 @@ void PluginControllerProxy::updateLayerHostingContext(LayerHostingMode layerHost
 
     switch (layerHostingMode) {
         case LayerHostingMode::InProcess:
-            m_layerHostingContext = LayerHostingContext::createForPort(PluginProcess::shared().compositingRenderServerPort());
+            m_layerHostingContext = LayerHostingContext::createForPort(PluginProcess::singleton().compositingRenderServerPort());
             break;
 #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
         case LayerHostingMode::OutOfProcess:
index e8f4eb0..042d417 100644 (file)
@@ -114,7 +114,7 @@ template<typename T> void FullscreenWindowTracker::windowShown(T window)
     
     // If this is the first full screen window to be shown, notify the UI process.
     if (windowSetWasEmpty)
-        PluginProcess::shared().setFullscreenWindowIsShowing(true);
+        PluginProcess::singleton().setFullscreenWindowIsShowing(true);
 }
 
 template<typename T> void FullscreenWindowTracker::windowHidden(T window)
@@ -128,7 +128,7 @@ template<typename T> void FullscreenWindowTracker::windowHidden(T window)
 
     // If this was the last full screen window that was visible, notify the UI process.
     if (m_windows.isEmpty())
-        PluginProcess::shared().setFullscreenWindowIsShowing(false);
+        PluginProcess::singleton().setFullscreenWindowIsShowing(false);
 }
 
 static FullscreenWindowTracker& fullscreenWindowTracker()
@@ -195,7 +195,7 @@ static void carbonWindowHidden(WindowRef window)
 static bool openCFURLRef(CFURLRef url, int32_t& status, CFURLRef* launchedURL)
 {
     String launchedURLString;
-    if (!PluginProcess::shared().openURL(URL(url).string(), status, launchedURLString))
+    if (!PluginProcess::singleton().openURL(URL(url).string(), status, launchedURLString))
         return false;
 
     if (!launchedURLString.isNull() && launchedURL)
@@ -207,7 +207,7 @@ static bool openCFURLRef(CFURLRef url, int32_t& status, CFURLRef* launchedURL)
 
 static void setModal(bool modalWindowIsShowing)
 {
-    PluginProcess::shared().setModalWindowIsShowing(modalWindowIsShowing);
+    PluginProcess::singleton().setModalWindowIsShowing(modalWindowIsShowing);
 }
 
 static unsigned modalCount = 0;
@@ -275,7 +275,7 @@ static void replacedNSConcreteTask_launch(NSTask *self, SEL _cmd)
     for (NSString *argument in self.arguments)
         arguments.uncheckedAppend(argument);
 
-    if (PluginProcess::shared().launchProcess(launchPath, arguments))
+    if (PluginProcess::singleton().launchProcess(launchPath, arguments))
         return;
 
     NSConcreteTask_launch(self, _cmd);
@@ -295,7 +295,7 @@ static NSRunningApplication *replacedNSWorkspace_launchApplicationAtURL_options_
         }
     }
 
-    if (PluginProcess::shared().launchApplicationAtURL(URL(url).string(), arguments)) {
+    if (PluginProcess::singleton().launchApplicationAtURL(URL(url).string(), arguments)) {
         if (error)
             *error = nil;
         return nil;
@@ -308,7 +308,7 @@ static BOOL (*NSWorkspace_openFile)(NSWorkspace *, SEL, NSString *);
 
 static BOOL replacedNSWorkspace_openFile(NSWorkspace *self, SEL _cmd, NSString *fullPath)
 {
-    if (PluginProcess::shared().openFile(fullPath))
+    if (PluginProcess::singleton().openFile(fullPath))
         return true;
 
     return NSWorkspace_openFile(self, _cmd, fullPath);
index 565adf5..fb5397d 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebKit {
 
-ConnectionStack& ConnectionStack::shared()
+ConnectionStack& ConnectionStack::singleton()
 {
     static NeverDestroyed<ConnectionStack> connectionStack;
     return connectionStack;
index bd753a0..c532638 100644 (file)
@@ -36,7 +36,7 @@ namespace WebKit {
 
 class ConnectionStack {
 public:
-    static ConnectionStack& shared();
+    static ConnectionStack& singleton();
 
     IPC::Connection* current()
     {
index dbf0a1f..1d4ce3f 100644 (file)
@@ -87,7 +87,7 @@ int ChildProcessMain(int argc, char** argv)
         if (!delegate.getExtraInitializationData(parameters.extraInitializationData))
             return EXIT_FAILURE;
 
-        ChildProcessType::shared().initialize(parameters);
+        ChildProcessType::singleton().initialize(parameters);
     }
 
     delegate.startRunLoop();
index 09986bd..fbb32a3 100644 (file)
@@ -98,7 +98,7 @@ void XPCServiceInitializer(OSObjectPtr<xpc_connection_t> connection, xpc_object_
     voucher_replace_default_voucher();
 #endif
 
-    XPCServiceType::shared().initialize(parameters);
+    XPCServiceType::singleton().initialize(parameters);
 }
 
 } // namespace WebKit
index 8248877..2fa43fd 100644 (file)
@@ -39,7 +39,7 @@ namespace WebKit {
 
 static const char separator = '\t';
 
-WebMemorySampler* WebMemorySampler::shared()
+WebMemorySampler* WebMemorySampler::singleton()
 {
     static WebMemorySampler* sharedMemorySampler;
     if (!sharedMemorySampler)
index ec24410..66f62a2 100644 (file)
@@ -71,7 +71,7 @@ struct WebMemoryStatistics {
 class WebMemorySampler {
     WTF_MAKE_NONCOPYABLE(WebMemorySampler);
 public:
-    static WebMemorySampler* shared();
+    static WebMemorySampler* singleton();
     void start(const double interval = 0);
     void start(const SandboxExtension::Handle&, const String&, const double interval = 0);
     void stop();
index aecc041..efc7b3b 100644 (file)
@@ -66,7 +66,7 @@ void ChildProcess::setApplicationIsDaemon()
 
 void ChildProcess::platformInitialize()
 {
-    FloatingPointEnvironment& floatingPointEnvironment = FloatingPointEnvironment::shared(); 
+    FloatingPointEnvironment& floatingPointEnvironment = FloatingPointEnvironment::singleton(); 
     floatingPointEnvironment.enableDenormalSupport(); 
     floatingPointEnvironment.saveMainThreadEnvironment(); 
     [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
index 58e73f9..1158aee 100644 (file)
@@ -140,7 +140,7 @@ static void SIGSYSHandler(int signal, siginfo_t* info, void* data)
     if (!ucontext)
         CRASH();
 
-    SeccompBrokerClient* client = &SeccompBrokerClient::shared();
+    SeccompBrokerClient* client = &SeccompBrokerClient::singleton();
 
     if (client->handleIfOpeningOnlineCPUCount(&ucontext->uc_mcontext))
         return;
index a151954..ab34224 100644 (file)
@@ -37,7 +37,7 @@ class CookieStorageShim {
     WTF_MAKE_NONCOPYABLE(CookieStorageShim);
     friend class NeverDestroyed<CookieStorageShim>;
 public:
-    static CookieStorageShim& shared();
+    static CookieStorageShim& singleton();
 
     void initialize();
 
index 17b8c72..070a841 100644 (file)
@@ -61,7 +61,7 @@ static CFDictionaryRef webKitCookieStorageCopyRequestHeaderFieldsForURL(CFHTTPCo
 {
     String cookies;
     URL firstPartyForCookiesURL;
-    if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(SessionID::defaultSessionID(), firstPartyForCookiesURL, inRequestURL), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(cookies), 0))
+    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(SessionID::defaultSessionID(), firstPartyForCookiesURL, inRequestURL), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(cookies), 0))
         return 0;
 
     if (cookies.isNull())
@@ -73,7 +73,7 @@ static CFDictionaryRef webKitCookieStorageCopyRequestHeaderFieldsForURL(CFHTTPCo
     return CFDictionaryCreate(0, cookieKeys, cookieValues, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
 }
 
-CookieStorageShim& CookieStorageShim::shared()
+CookieStorageShim& CookieStorageShim::singleton()
 {
     static NeverDestroyed<CookieStorageShim> storage;
     return storage;
index 6c661b1..4029d23 100644 (file)
@@ -72,7 +72,7 @@ static BlockingResponseMap<SecItemResponseData>& responseMap()
 
 static ChildProcess* sharedProcess;
 
-SecItemShim& SecItemShim::shared()
+SecItemShim& SecItemShim::singleton()
 {
     static SecItemShim* shim;
     static dispatch_once_t once;
index 97c4788..cb36425 100644 (file)
@@ -38,7 +38,7 @@ class SecItemResponseData;
 class SecItemShim : public IPC::Connection::WorkQueueMessageReceiver {
 WTF_MAKE_NONCOPYABLE(SecItemShim);
 public:
-    static SecItemShim& shared();
+    static SecItemShim& singleton();
 
     void initialize(ChildProcess*);
     void initializeConnection(IPC::Connection*);
index cf2cb01..7b90294 100644 (file)
@@ -57,7 +57,7 @@ int ChildProcessMain(int argc, char** argv)
     if (!childMain.parseCommandLine(argc, argv))
         return EXIT_FAILURE;
 
-    ChildProcessType::shared().initialize(childMain.initializationParameters());
+    ChildProcessType::singleton().initialize(childMain.initializationParameters());
     RunLoop::run();
     childMain.platformFinalize();
 
index 2da94df..3279dd7 100644 (file)
@@ -36,25 +36,25 @@ void WKTextCheckerSetClient(const WKTextCheckerClientBase* wkClient)
 {
     if (wkClient && wkClient->version)
         return;
-    WebTextChecker::shared()->setClient(wkClient);
+    WebTextChecker::singleton()->setClient(wkClient);
 }
 
 void WKTextCheckerContinuousSpellCheckingEnabledStateChanged(bool enabled)
 {
-    WebTextChecker::shared()->continuousSpellCheckingEnabledStateChanged(enabled);
+    WebTextChecker::singleton()->continuousSpellCheckingEnabledStateChanged(enabled);
 }
 
 void WKTextCheckerGrammarCheckingEnabledStateChanged(bool enabled)
 {
-    WebTextChecker::shared()->grammarCheckingEnabledStateChanged(enabled);
+    WebTextChecker::singleton()->grammarCheckingEnabledStateChanged(enabled);
 }
 
 void WKTextCheckerCheckSpelling(WKPageRef page, bool startBeforeSelection)
 {
-    WebTextChecker::shared()->checkSpelling(toImpl(page), startBeforeSelection);
+    WebTextChecker::singleton()->checkSpelling(toImpl(page), startBeforeSelection);
 }
 
 void WKTextCheckerChangeSpellingToWord(WKPageRef page, WKStringRef word)
 {
-    WebTextChecker::shared()->changeSpellingToWord(toImpl(page), toWTFString(word));
+    WebTextChecker::singleton()->changeSpellingToWord(toImpl(page), toWTFString(word));
 }
index 0a9f1f5..89dde3f 100644 (file)
@@ -62,7 +62,7 @@ EwkMain::EwkMain()
 {
 }
 
-EwkMain& EwkMain::shared()
+EwkMain& EwkMain::singleton()
 {
     static EwkMain instance;
     return instance;
@@ -209,10 +209,10 @@ using namespace WebKit;
 
 int ewk_init()
 {
-    return EwkMain::shared().initialize();
+    return EwkMain::singleton().initialize();
 }
 
 int ewk_shutdown()
 {
-    return EwkMain::shared().finalize();
+    return EwkMain::singleton().finalize();
 }
index 38023c6..1d4ce1f 100644 (file)
@@ -32,7 +32,7 @@ enum class EFLModuleInitFailure;
 
 class EwkMain {
 public:
-    static EwkMain& shared();
+    static EwkMain& singleton();
     ~EwkMain();
     int initialize();
     int finalize();
index cbf1c04..bf8fa18 100644 (file)
@@ -80,7 +80,7 @@ Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class* api)
 
 Evas_Object* EWKViewCreate(WKContextRef context, WKPageGroupRef pageGroup, Evas* canvas, Evas_Smart* smart)
 {
-    if (!EwkMain::shared().isInitialized()) {
+    if (!EwkMain::singleton().isInitialized()) {
         EINA_LOG_CRIT("EWebKit has not been initialized. You must call ewk_init() before creating view.");
         return nullptr;
     }
index a7d8481..91653dc 100644 (file)
@@ -122,7 +122,7 @@ void WebProcessPool::updateProcessSuppressionState()
     if (!m_processSuppressionDisabledForPageCounter.value())
         m_pluginProcessManagerProcessSuppressionDisabledToken = nullptr;
     else if (!m_pluginProcessManagerProcessSuppressionDisabledToken)
-        m_pluginProcessManagerProcessSuppressionDisabledToken = PluginProcessManager::shared().processSuppressionDisabledToken();
+        m_pluginProcessManagerProcessSuppressionDisabledToken = PluginProcessManager::singleton().processSuppressionDisabledToken();
 #endif
 }
 
@@ -140,7 +140,7 @@ void WebProcessPool::platformInitialize()
     registerNotificationObservers();
 
 #if PLATFORM(IOS)
-    WebKit::WebMemoryPressureHandler::shared();
+    WebKit::WebMemoryPressureHandler::singleton();
 #endif
 }
 
index 5dff546..6638774 100644 (file)
@@ -51,7 +51,7 @@ static unsigned pageIdFromRequestPath(const String& path)
     return number;
 }
 
-WebInspectorServer& WebInspectorServer::shared()
+WebInspectorServer& WebInspectorServer::singleton()
 {
     static WebInspectorServer& server = *new WebInspectorServer;
     return server;
index 19675b2..13299b1 100644 (file)
@@ -41,7 +41,7 @@ class WebInspectorProxy;
 class WebInspectorServer : public WebSocketServer, public WebSocketServerClient {
 public:
     typedef HashMap<unsigned, WebInspectorProxy*> ClientMap;
-    static WebInspectorServer& shared();
+    static WebInspectorServer& singleton();
 
     // Page registry to manage known pages.
     int registerPage(WebInspectorProxy* client);
index 54b3be2..d5f33fc 100644 (file)
@@ -85,7 +85,7 @@ void NetworkProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launc
 void NetworkProcessProxy::connectionWillOpen(IPC::Connection& connection)
 {
 #if ENABLE(SEC_ITEM_SHIM)
-    SecItemShimProxy::shared().initializeConnection(connection);
+    SecItemShimProxy::singleton().initializeConnection(connection);
 #else
     UNUSED_PARAM(connection);
 #endif
index ab9b92d..cb61d36 100644 (file)
@@ -35,7 +35,7 @@
 
 namespace WebKit {
 
-PluginProcessManager& PluginProcessManager::shared()
+PluginProcessManager& PluginProcessManager::singleton()
 {
     static NeverDestroyed<PluginProcessManager> pluginProcessManager;
     return pluginProcessManager;
index df32527..f2911c3 100644 (file)
@@ -55,7 +55,7 @@ class PluginProcessManager {
     WTF_MAKE_NONCOPYABLE(PluginProcessManager);
     friend class NeverDestroyed<PluginProcessManager>;
 public:
-    static PluginProcessManager& shared();
+    static PluginProcessManager& singleton();
 
     uint64_t pluginProcessToken(const PluginModuleInfo&, PluginProcessType, PluginProcessSandboxPolicy);
 
index 0f3d941..3a5f001 100644 (file)
@@ -229,7 +229,7 @@ void PluginProcessProxy::didFinishLaunching(ProcessLauncher*, IPC::Connection::I
     m_numPendingConnectionRequests = 0;
 
 #if PLATFORM(COCOA)
-    if (!PluginProcessManager::shared().processSuppressionDisabled())
+    if (!PluginProcessManager::singleton().processSuppressionDisabled())
         setProcessSuppressionEnabled(true);
 #endif
 }
index 3498ed5..e180603 100644 (file)
@@ -56,7 +56,7 @@ public:
             return;
         }
 
-        PluginProcessManager::shared().getSitesWithData(m_plugins.last(), m_webPluginSiteDataManager, m_callbackID);
+        PluginProcessManager::singleton().getSitesWithData(m_plugins.last(), m_webPluginSiteDataManager, m_callbackID);
         m_plugins.removeLast();
     }
 
@@ -94,7 +94,7 @@ public:
             return;
         }
 
-        PluginProcessManager::shared().clearSiteData(m_plugins.last(), m_webPluginSiteDataManager, m_sites, m_flags, m_maxAgeInSeconds, m_callbackID);
+        PluginProcessManager::singleton().clearSiteData(m_plugins.last(), m_webPluginSiteDataManager, m_sites, m_flags, m_maxAgeInSeconds, m_callbackID);
         m_plugins.removeLast();
     }
 
index 319bd3e..7920393 100644 (file)
@@ -36,7 +36,7 @@ namespace WebKit {
 
 static const unsigned gSchemaVersion = 2;
 
-PluginInfoCache& PluginInfoCache::shared()
+PluginInfoCache& PluginInfoCache::singleton()
 {
     static NeverDestroyed<PluginInfoCache> pluginInfoCache;
     return pluginInfoCache;
index d355b90..cab1e0f 100644 (file)
@@ -40,7 +40,7 @@ class PluginInfoCache {
     WTF_MAKE_NONCOPYABLE(PluginInfoCache);
     friend class NeverDestroyed<PluginInfoCache>;
 public:
-    static PluginInfoCache& shared();
+    static PluginInfoCache& singleton();
 
     bool getPluginInfo(const String& pluginPath, PluginModuleInfo&);
     void updatePluginInfo(const String& pluginPath, const PluginModuleInfo&);
index 5f5409f..3c66871 100644 (file)
@@ -102,11 +102,11 @@ Vector<String> PluginInfoStore::individualPluginPaths()
 bool PluginInfoStore::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
 {
 #if PLATFORM(GTK)
-    if (PluginInfoCache::shared().getPluginInfo(pluginPath, plugin))
+    if (PluginInfoCache::singleton().getPluginInfo(pluginPath, plugin))
         return true;
 
     if (NetscapePluginModule::getPluginInfo(pluginPath, plugin)) {
-        PluginInfoCache::shared().updatePluginInfo(pluginPath, plugin);
+        PluginInfoCache::singleton().updatePluginInfo(pluginPath, plugin);
         return true;
     }
     return false;
index 73eb356..bfd7ad5 100644 (file)
@@ -59,7 +59,7 @@ const unsigned WebInspectorProxy::initialWindowHeight = 650;
 
 class WebInspectorPageGroups {
 public:
-    static WebInspectorPageGroups& shared()
+    static WebInspectorPageGroups& singleton()
     {
         static NeverDestroyed<WebInspectorPageGroups> instance;
         return instance;
@@ -145,7 +145,7 @@ WebInspectorProxy::WebInspectorProxy(WebPageProxy* page)
     , m_remoteInspectionPageId(0)
 #endif
 {
-    m_level = WebInspectorPageGroups::shared().inspectorLevel(m_page->pageGroup());
+    m_level = WebInspectorPageGroups::singleton().inspectorLevel(m_page->pageGroup());
     m_page->process().addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_page->pageID(), *this);
 }
 
@@ -155,14 +155,14 @@ WebInspectorProxy::~WebInspectorProxy()
 
 WebPageGroup* WebInspectorProxy::inspectorPageGroup() const
 {
-    return WebInspectorPageGroups::shared().inspectorPageGroupForLevel(m_level);
+    return WebInspectorPageGroups::singleton().inspectorPageGroupForLevel(m_level);
 }
 
 void WebInspectorProxy::invalidate()
 {
 #if ENABLE(INSPECTOR_SERVER)
     if (m_remoteInspectionPageId)
-        WebInspectorServer::shared().unregisterPage(m_remoteInspectionPageId);
+        WebInspectorServer::singleton().unregisterPage(m_remoteInspectionPageId);
 #endif
 
     m_page->process().removeMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_page->pageID());
@@ -357,7 +357,7 @@ void WebInspectorProxy::togglePageProfiling()
 
 bool WebInspectorProxy::isInspectorPage(WebPageProxy& page)
 {
-    return WebInspectorPageGroups::shared().isInspectorPageGroup(page.pageGroup());
+    return WebInspectorPageGroups::singleton().isInspectorPageGroup(page.pageGroup());
 }
 
 WebProcessPool& WebInspectorProxy::inspectorProcessPool()
@@ -430,7 +430,7 @@ static void decidePolicyForNavigationAction(WKPageRef, WKFrameRef frameRef, WKFr
 void WebInspectorProxy::enableRemoteInspection()
 {
     if (!m_remoteInspectionPageId)
-        m_remoteInspectionPageId = WebInspectorServer::shared().registerPage(this);
+        m_remoteInspectionPageId = WebInspectorServer::singleton().registerPage(this);
 }
 
 void WebInspectorProxy::remoteFrontendConnected()
@@ -640,7 +640,7 @@ bool WebInspectorProxy::shouldOpenAttached()
 void WebInspectorProxy::sendMessageToRemoteFrontend(const String& message)
 {
     ASSERT(m_remoteInspectionPageId);
-    WebInspectorServer::shared().sendMessageOverConnection(m_remoteInspectionPageId, message);
+    WebInspectorServer::singleton().sendMessageOverConnection(m_remoteInspectionPageId, message);
 }
 #endif
 
index c010fde..a341319 100644 (file)
@@ -175,7 +175,7 @@ public:
         RefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> reply;
     };
 
-    static ExceededDatabaseQuotaRecords& shared();
+    static ExceededDatabaseQuotaRecords& singleton();
 
     std::unique_ptr<Record> createRecord(uint64_t frameID, String originIdentifier,
         String databaseName, String displayName, uint64_t currentQuota,
@@ -194,7 +194,7 @@ private:
     std::unique_ptr<Record> m_currentRecord;
 };
 
-ExceededDatabaseQuotaRecords& ExceededDatabaseQuotaRecords::shared()
+ExceededDatabaseQuotaRecords& ExceededDatabaseQuotaRecords::singleton()
 {
     static NeverDestroyed<ExceededDatabaseQuotaRecords> records;
     return records;
@@ -984,7 +984,7 @@ void WebPageProxy::recordNavigationSnapshot(WebBackForwardListItem& item)
         return;
 
 #if PLATFORM(COCOA)
-    ViewSnapshotStore::shared().recordSnapshot(*this, item);
+    ViewSnapshotStore::singleton().recordSnapshot(*this, item);
 #else
     UNUSED_PARAM(item);
 #endif
@@ -1753,7 +1753,7 @@ void WebPageProxy::findPlugin(const String& mimeType, uint32_t processType, cons
         return;
     }
 
-    pluginProcessToken = PluginProcessManager::shared().pluginProcessToken(plugin, static_cast<PluginProcessType>(processType), pluginProcessSandboxPolicy);
+    pluginProcessToken = PluginProcessManager::singleton().pluginProcessToken(plugin, static_cast<PluginProcessType>(processType), pluginProcessSandboxPolicy);
 }
 
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
@@ -4761,7 +4761,7 @@ void WebPageProxy::didReceiveAuthenticationChallengeProxy(uint64_t frameID, Pass
 
 void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> reply)
 {
-    ExceededDatabaseQuotaRecords& records = ExceededDatabaseQuotaRecords::shared();
+    ExceededDatabaseQuotaRecords& records = ExceededDatabaseQuotaRecords::singleton();
     std::unique_ptr<ExceededDatabaseQuotaRecords::Record> newRecord = records.createRecord(frameID,
         originIdentifier, databaseName, displayName, currentQuota, currentOriginUsage,
         currentDatabaseUsage, expectedUsage, reply);
index 38c19e1..9097cb5 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace WebKit {
 
-WebPasteboardProxy& WebPasteboardProxy::shared()
+WebPasteboardProxy& WebPasteboardProxy::singleton()
 {
     static std::once_flag onceFlag;
     static LazyNeverDestroyed<WebPasteboardProxy> proxy;
index 2e46738..494aac9 100644 (file)
@@ -46,7 +46,7 @@ class WebPasteboardProxy : public IPC::MessageReceiver {
     WTF_MAKE_NONCOPYABLE(WebPasteboardProxy);
     friend class LazyNeverDestroyed<WebPasteboardProxy>;
 public:
-    static WebPasteboardProxy& shared();
+    static WebPasteboardProxy& singleton();
 
     void addWebProcessProxy(WebProcessProxy&);
 
index 86a6e20..ba4402a 100644 (file)
@@ -675,10 +675,11 @@ WebProcessProxy& WebProcessPool::createNewWebProcess()
     parameters.memoryCacheDisabled = m_memoryCacheDisabled;
 
 #if ENABLE(SERVICE_CONTROLS)
-    parameters.hasImageServices = ServicesController::shared().hasImageServices();
-    parameters.hasSelectionServices = ServicesController::shared().hasSelectionServices();
-    parameters.hasRichContentServices = ServicesController::shared().hasRichContentServices();
-    ServicesController::shared().refreshExistingServices();
+    auto& serviceController = ServicesController::singleton();
+    parameters.hasImageServices = serviceController.hasImageServices();
+    parameters.hasSelectionServices = serviceController.hasSelectionServices();
+    parameters.hasRichContentServices = serviceController.hasRichContentServices();
+    serviceController.refreshExistingServices();
 #endif
 
     // Add any platform specific parameters
@@ -715,7 +716,7 @@ WebProcessProxy& WebProcessPool::createNewWebProcess()
 
 #if ENABLE(REMOTE_INSPECTOR)
     // Initialize remote inspector connection now that we have a sub-process that is hosting one of our web views.
-    Inspector::RemoteInspector::shared(); 
+    Inspector::RemoteInspector::singleton(); 
 #endif
 
     return process;
@@ -1105,7 +1106,7 @@ void WebProcessPool::startMemorySampler(const double interval)
     
     // For UIProcess
 #if ENABLE(MEMORY_SAMPLER)
-    WebMemorySampler::shared()->start(interval);
+    WebMemorySampler::singleton()->start(interval);
 #endif
     
     // For WebProcess
@@ -1124,7 +1125,7 @@ void WebProcessPool::stopMemorySampler()
     
     // For UIProcess
 #if ENABLE(MEMORY_SAMPLER)
-    WebMemorySampler::shared()->stop();
+    WebMemorySampler::singleton()->stop();
 #endif
 
     sendToAllProcesses(Messages::WebProcess::StopMemorySampler());
index c257a38..dd00648 100644 (file)
@@ -99,7 +99,7 @@ WebProcessProxy::WebProcessProxy(WebProcessPool& processPool)
     , m_numberOfTimesSuddenTerminationWasDisabled(0)
     , m_throttler(std::make_unique<ProcessThrottler>(this))
 {
-    WebPasteboardProxy::shared().addWebProcessProxy(*this);
+    WebPasteboardProxy::singleton().addWebProcessProxy(*this);
 
     connect();
 }
@@ -126,7 +126,7 @@ void WebProcessProxy::connectionWillOpen(IPC::Connection& connection)
     ASSERT(this->connection() == &connection);
 
 #if ENABLE(SEC_ITEM_SHIM)
-    SecItemShimProxy::shared().initializeConnection(connection);
+    SecItemShimProxy::singleton().initializeConnection(connection);
 #endif
 
     for (auto& page : m_pageMap.values())
@@ -384,7 +384,7 @@ void WebProcessProxy::getPlugins(bool refresh, Vector<PluginInfo>& plugins, Vect
 #if ENABLE(NETSCAPE_PLUGIN_API)
 void WebProcessProxy::getPluginProcessConnection(uint64_t pluginProcessToken, PassRefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply> reply)
 {
-    PluginProcessManager::shared().getPluginProcessConnection(pluginProcessToken, reply);
+    PluginProcessManager::singleton().getPluginProcessConnection(pluginProcessToken, reply);
 }
 #endif
 
index af459a3..8a85434 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebKit {
 
-WebTextChecker* WebTextChecker::shared()
+WebTextChecker* WebTextChecker::singleton()
 {
     static WebTextChecker* textChecker = adoptRef(new WebTextChecker).leakRef();
     return textChecker;
index 359e81e..7c945c7 100644 (file)
@@ -37,7 +37,7 @@ class WebPageProxy;
 
 class WebTextChecker : public API::ObjectImpl<API::Object::Type::TextChecker> {
 public:
-    static WebTextChecker* shared();
+    static WebTextChecker* singleton();
 
     void setClient(const WKTextCheckerClientBase*);
     WebTextCheckerClient& client() { return m_client; }
index 0f1e49b..3b4e4a9 100644 (file)
 
 #include "ewk_main_private.h"
 
-#define CRITICAL(...) EINA_LOG_DOM_CRIT(EwkMain::shared().logDomainId(), __VA_ARGS__)
-#define ERR(...) EINA_LOG_DOM_ERR(EwkMain::shared().logDomainId(), __VA_ARGS__)
-#define WARN(...) EINA_LOG_DOM_WARN(EwkMain::shared().logDomainId(), __VA_ARGS__)
-#define INFO(...) EINA_LOG_DOM_INFO(EwkMain::shared().logDomainId(), __VA_ARGS__)
-#define DBG(...) EINA_LOG_DOM_DBG(EwkMain::shared().logDomainId(), __VA_ARGS__)
+#define CRITICAL(...) EINA_LOG_DOM_CRIT(EwkMain::singleton().logDomainId(), __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(EwkMain::singleton().logDomainId(), __VA_ARGS__)
+#define WARN(...) EINA_LOG_DOM_WARN(EwkMain::singleton().logDomainId(), __VA_ARGS__)
+#define INFO(...) EINA_LOG_DOM_INFO(EwkMain::singleton().logDomainId(), __VA_ARGS__)
+#define DBG(...) EINA_LOG_DOM_DBG(EwkMain::singleton().logDomainId(), __VA_ARGS__)
 
 #endif // EwkDebug_h
index b37d09a..17bd253 100644 (file)
@@ -72,7 +72,7 @@ void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellChecki
     textCheckerState.isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;
 
     // Notify the client about the setting change.
-    WebTextChecker::shared()->client().setContinuousSpellCheckingEnabled(isContinuousSpellCheckingEnabled);
+    WebTextChecker::singleton()->client().setContinuousSpellCheckingEnabled(isContinuousSpellCheckingEnabled);
 #else
     UNUSED_PARAM(isContinuousSpellCheckingEnabled);
 #endif
@@ -103,7 +103,7 @@ void TextChecker::grammarCheckingEnabledStateChanged(bool)
 int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy* page)
 {
 #if ENABLE(SPELLCHECK)
-    return WebTextChecker::shared()->client().uniqueSpellDocumentTag(page);
+    return WebTextChecker::singleton()->client().uniqueSpellDocumentTag(page);
 #else
     UNUSED_PARAM(page);
     return 0;
@@ -113,7 +113,7 @@ int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy* page)
 void TextChecker::closeSpellDocumentWithTag(int64_t tag)
 {
 #if ENABLE(SPELLCHECK)
-    WebTextChecker::shared()->client().closeSpellDocumentWithTag(tag);
+    WebTextChecker::singleton()->client().closeSpellDocumentWithTag(tag);
 #else
     UNUSED_PARAM(tag);
 #endif
@@ -194,7 +194,7 @@ Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocume
 void TextChecker::checkSpellingOfString(int64_t spellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength)
 {
 #if ENABLE(SPELLCHECK)
-    WebTextChecker::shared()->client().checkSpellingOfString(spellDocumentTag, text.toStringWithoutCopying(), misspellingLocation, misspellingLength);
+    WebTextChecker::singleton()->client().checkSpellingOfString(spellDocumentTag, text.toStringWithoutCopying(), misspellingLocation, misspellingLength);
 #else
     UNUSED_PARAM(spellDocumentTag);
     UNUSED_PARAM(text);
@@ -233,7 +233,7 @@ void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, cons
 void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& , Vector<String>& guesses)
 {
 #if ENABLE(SPELLCHECK)
-    WebTextChecker::shared()->client().guessesForWord(spellDocumentTag, word, guesses);
+    WebTextChecker::singleton()->client().guessesForWord(spellDocumentTag, word, guesses);
 #else
     UNUSED_PARAM(spellDocumentTag);
     UNUSED_PARAM(word);
@@ -244,7 +244,7 @@ void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word
 void TextChecker::learnWord(int64_t spellDocumentTag, const String& word)
 {
 #if ENABLE(SPELLCHECK)
-    WebTextChecker::shared()->client().learnWord(spellDocumentTag, word);
+    WebTextChecker::singleton()->client().learnWord(spellDocumentTag, word);
 #else
     UNUSED_PARAM(spellDocumentTag);
     UNUSED_PARAM(word);
@@ -254,7 +254,7 @@ void TextChecker::learnWord(int64_t spellDocumentTag, const String& word)
 void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word)
 {
 #if ENABLE(SPELLCHECK)
-    WebTextChecker::shared()->client().ignoreWord(spellDocumentTag, word);
+    WebTextChecker::singleton()->client().ignoreWord(spellDocumentTag, word);
 #else
     UNUSED_PARAM(spellDocumentTag);
     UNUSED_PARAM(word);
index b654726..fffb2fe 100644 (file)
@@ -70,7 +70,7 @@ static void initializeInspectorServer()
         } else
             LOG_ERROR("Couldn't parse %s, wrong format? Using 127.0.0.1:2999 instead.", serverAddress.utf8().data());
 
-        if (!WebInspectorServer::shared().listen(bindAddress, port))
+        if (!WebInspectorServer::singleton().listen(bindAddress, port))
             LOG_ERROR("Couldn't start listening on: IP address=%s, port=%d.", bindAddress.utf8().data(), port);
 
         return;
index de194ad..4ff8244 100644 (file)
@@ -43,7 +43,7 @@ const TextCheckerState& TextChecker::state()
     if (didInitializeState)
         return textCheckerState;
 
-    WebTextCheckerClient& client = WebTextChecker::shared()->client();
+    WebTextCheckerClient& client = WebTextChecker::singleton()->client();
     textCheckerState.isContinuousSpellCheckingEnabled = client.continuousSpellCheckingEnabled();
     textCheckerState.isGrammarCheckingEnabled =  client.grammarCheckingEnabled();
 
@@ -54,7 +54,7 @@ const TextCheckerState& TextChecker::state()
   
 bool TextChecker::isContinuousSpellCheckingAllowed()
 {
-    return WebTextChecker::shared()->client().continuousSpellCheckingAllowed();
+    return WebTextChecker::singleton()->client().continuousSpellCheckingAllowed();
 }
 
 void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
@@ -62,7 +62,7 @@ void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellChecki
     if (state().isContinuousSpellCheckingEnabled == isContinuousSpellCheckingEnabled)
         return;
     textCheckerState.isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;
-    WebTextChecker::shared()->client().setContinuousSpellCheckingEnabled(isContinuousSpellCheckingEnabled);
+    WebTextChecker::singleton()->client().setContinuousSpellCheckingEnabled(isContinuousSpellCheckingEnabled);
 }
 
 void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
@@ -70,7 +70,7 @@ void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
     if (state().isGrammarCheckingEnabled == isGrammarCheckingEnabled)
         return;
     textCheckerState.isGrammarCheckingEnabled = isGrammarCheckingEnabled;
-    WebTextChecker::shared()->client().setGrammarCheckingEnabled(isGrammarCheckingEnabled);
+    WebTextChecker::singleton()->client().setGrammarCheckingEnabled(isGrammarCheckingEnabled);
 }
 
 void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
@@ -85,57 +85,57 @@ void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
 
 int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy* page)
 {
-    return WebTextChecker::shared()->client().uniqueSpellDocumentTag(page);
+    return WebTextChecker::singleton()->client().uniqueSpellDocumentTag(page);
 }
 
 void TextChecker::closeSpellDocumentWithTag(int64_t tag)
 {
-    WebTextChecker::shared()->client().closeSpellDocumentWithTag(tag);
+    WebTextChecker::singleton()->client().closeSpellDocumentWithTag(tag);
 }
 
 void TextChecker::checkSpellingOfString(int64_t spellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength)
 {
-    WebTextChecker::shared()->client().checkSpellingOfString(spellDocumentTag, text.toStringWithoutCopying(), misspellingLocation, misspellingLength);
+    WebTextChecker::singleton()->client().checkSpellingOfString(spellDocumentTag, text.toStringWithoutCopying(), misspellingLocation, misspellingLength);
 }
 
 void TextChecker::checkGrammarOfString(int64_t spellDocumentTag, StringView text, Vector<WebCore::GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
 {
-    WebTextChecker::shared()->client().checkGrammarOfString(spellDocumentTag, text.toStringWithoutCopying(), grammarDetails, badGrammarLocation, badGrammarLength);
+    WebTextChecker::singleton()->client().checkGrammarOfString(spellDocumentTag, text.toStringWithoutCopying(), grammarDetails, badGrammarLocation, badGrammarLength);
 }
 
 bool TextChecker::spellingUIIsShowing()
 {
-    return WebTextChecker::shared()->client().spellingUIIsShowing();
+    return WebTextChecker::singleton()->client().spellingUIIsShowing();
 }
 
 void TextChecker::toggleSpellingUIIsShowing()
 {
-    WebTextChecker::shared()->client().toggleSpellingUIIsShowing();
+    WebTextChecker::singleton()->client().toggleSpellingUIIsShowing();
 }
 
 void TextChecker::updateSpellingUIWithMisspelledWord(int64_t spellDocumentTag, const String& misspelledWord)
 {
-    WebTextChecker::shared()->client().updateSpellingUIWithMisspelledWord(spellDocumentTag, misspelledWord);
+    WebTextChecker::singleton()->client().updateSpellingUIWithMisspelledWord(spellDocumentTag, misspelledWord);
 }
 
 void TextChecker::updateSpellingUIWithGrammarString(int64_t spellDocumentTag, const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
 {
-    WebTextChecker::shared()->client().updateSpellingUIWithGrammarString(spellDocumentTag, badGrammarPhrase, grammarDetail);
+    WebTextChecker::singleton()->client().updateSpellingUIWithGrammarString(spellDocumentTag, badGrammarPhrase, grammarDetail);
 }
 
 void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& /* context */, Vector<String>& guesses)
 {
-    WebTextChecker::shared()->client().guessesForWord(spellDocumentTag, word, guesses);
+    WebTextChecker::singleton()->client().guessesForWord(spellDocumentTag, word, guesses);
 }
 
 void TextChecker::learnWord(int64_t spellDocumentTag, const String& word)
 {
-    WebTextChecker::shared()->client().learnWord(spellDocumentTag, word);
+    WebTextChecker::singleton()->client().learnWord(spellDocumentTag, word);
 }
 
 void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word)
 {
-    WebTextChecker::shared()->client().ignoreWord(spellDocumentTag, word);
+    WebTextChecker::singleton()->client().ignoreWord(spellDocumentTag, word);
 }
 
 void TextChecker::requestCheckingOfString(PassRefPtr<TextCheckerCompletion>)
index 5ca5ee8..0f9e0c7 100644 (file)
@@ -74,7 +74,7 @@ static void initInspectorServer()
         } else
             LOG_ERROR("Couldn't parse %s, wrong format? Use 127.0.0.1:2999 instead.", serverAddress.utf8().data());
 
-        if (!WebInspectorServer::shared().listen(bindAddress, port))
+        if (!WebInspectorServer::singleton().listen(bindAddress, port))
             LOG_ERROR("Couldn't start listening on: IP address=%s, port=%d.", bindAddress.utf8().data(), port);
         return;
     }
index 7910faa..7c34c31 100644 (file)
@@ -35,7 +35,7 @@ namespace WebKit {
 class WebMemoryPressureHandler {
     friend class NeverDestroyed<WebMemoryPressureHandler>;
 public:
-    static WebMemoryPressureHandler& shared();
+    static WebMemoryPressureHandler& singleton();
 
 private:
     WebMemoryPressureHandler();
index bdd2363..1bb5d3a 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebKit {
 
-WebMemoryPressureHandler& WebMemoryPressureHandler::shared()
+WebMemoryPressureHandler& WebMemoryPressureHandler::singleton()
 {
     static NeverDestroyed<WebMemoryPressureHandler> memoryPressureHandler;
     return memoryPressureHandler;
@@ -48,7 +48,7 @@ WebMemoryPressureHandler::WebMemoryPressureHandler()
     dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_main_queue());
     dispatch_set_context(source, this);
     dispatch_source_set_event_handler(source, ^{
-        ViewSnapshotStore::shared().discardSnapshotImages();
+        ViewSnapshotStore::singleton().discardSnapshotImages();
     });
     dispatch_resume(source);
 }
index 1c88aa5..dc09699 100644 (file)
@@ -255,7 +255,7 @@ bool PageClientImpl::isViewInWindow()
 
 bool PageClientImpl::isVisuallyIdle()
 {
-    return WindowServerConnection::shared().applicationWindowModificationsHaveStopped() || !isViewVisible();
+    return WindowServerConnection::singleton().applicationWindowModificationsHaveStopped() || !isViewVisible();
 }
 
 LayerHostingMode PageClientImpl::viewLayerHostingMode()
index f3f844f..4203912 100644 (file)
@@ -37,7 +37,7 @@
 
 namespace WebKit {
 
-SecItemShimProxy& SecItemShimProxy::shared()
+SecItemShimProxy& SecItemShimProxy::singleton()
 {
     static SecItemShimProxy* proxy;
     static dispatch_once_t once;
index 3e49624..aba3d16 100644 (file)
@@ -37,7 +37,7 @@ class SecItemRequestData;
 class SecItemShimProxy : public IPC::Connection::WorkQueueMessageReceiver {
 WTF_MAKE_NONCOPYABLE(SecItemShimProxy);
 public:
-    static SecItemShimProxy& shared();
+    static SecItemShimProxy& singleton();
 
     void initializeConnection(IPC::Connection&);
 
index 8ec755d..3df7aa9 100644 (file)
@@ -38,7 +38,7 @@ class ServicesController {
     WTF_MAKE_NONCOPYABLE(ServicesController);
     friend class NeverDestroyed<ServicesController>;
 public:
-    static ServicesController& shared();
+    static ServicesController& singleton();
 
     bool hasImageServices() const { return m_hasImageServices; }
     bool hasSelectionServices() const { return m_hasSelectionServices; }
index e82c72d..2dd35c5 100644 (file)
@@ -37,7 +37,7 @@
 
 namespace WebKit {
 
-ServicesController& ServicesController::shared()
+ServicesController& ServicesController::singleton()
 {
     static NeverDestroyed<ServicesController> sharedController;
     return sharedController;
index 58093fb..3dc91f2 100644 (file)
@@ -115,7 +115,7 @@ public:
     ViewSnapshotStore();
     ~ViewSnapshotStore();
 
-    static ViewSnapshotStore& shared();
+    static ViewSnapshotStore& singleton();
 
     void recordSnapshot(WebPageProxy&, WebBackForwardListItem&);
 
index 1a8ae07..35d1f35 100644 (file)
@@ -56,7 +56,7 @@ ViewSnapshotStore::~ViewSnapshotStore()
     discardSnapshotImages();
 }
 
-ViewSnapshotStore& ViewSnapshotStore::shared()
+ViewSnapshotStore& ViewSnapshotStore::singleton()
 {
     static ViewSnapshotStore& store = *new ViewSnapshotStore;
     return store;
@@ -156,7 +156,7 @@ ViewSnapshot::ViewSnapshot(uint32_t slotID, IntSize size, size_t imageSizeInByte
     , m_size(size)
 {
     if (hasImage())
-        ViewSnapshotStore::shared().didAddImageToSnapshot(*this);
+        ViewSnapshotStore::singleton().didAddImageToSnapshot(*this);
 }
 
 ViewSnapshot::~ViewSnapshot()
@@ -178,7 +178,7 @@ void ViewSnapshot::clearImage()
     if (!hasImage())
         return;
 
-    ViewSnapshotStore::shared().willRemoveImageFromSnapshot(*this);
+    ViewSnapshotStore::singleton().willRemoveImageFromSnapshot(*this);
 
 #if USE_IOSURFACE_VIEW_SNAPSHOTS
     m_surface = nullptr;
index dc6495a..ddba8a1 100644 (file)
@@ -411,7 +411,7 @@ void WebContextMenuProxyMac::setupServicesMenu(const ContextMenuContextData& con
     // If there is no services menu, then the existing services on the system have changed, so refresh that list of services.
     // If <rdar://problem/17954709> is resolved then we can more accurately keep the list up to date without this call.
     if (!m_servicesMenu)
-        ServicesController::shared().refreshExistingServices();
+        ServicesController::singleton().refreshExistingServices();
 }
 
 void WebContextMenuProxyMac::clearServicesMenu()
index 7f02865..838a34f 100644 (file)
@@ -30,7 +30,7 @@ namespace WebKit {
 
 class WindowServerConnection {
 public:
-    static WindowServerConnection& shared();
+    static WindowServerConnection& singleton();
 
     bool applicationWindowModificationsHaveStopped() const { return m_applicationWindowModificationsHaveStopped; }
 
index 4a7efe6..819535c 100644 (file)
@@ -43,12 +43,12 @@ void WindowServerConnection::applicationWindowModificationsStopped(bool stopped)
 
 void WindowServerConnection::applicationWindowModificationsStarted(uint32_t, void*, uint32_t, void*, uint32_t)
 {
-    WindowServerConnection::shared().applicationWindowModificationsStopped(false);
+    WindowServerConnection::singleton().applicationWindowModificationsStopped(false);
 }
 
 void WindowServerConnection::applicationWindowModificationsStopped(uint32_t, void*, uint32_t, void*, uint32_t)
 {
-    WindowServerConnection::shared().applicationWindowModificationsStopped(true);
+    WindowServerConnection::singleton().applicationWindowModificationsStopped(true);
 }
 
 void WindowServerConnection::windowServerConnectionStateChanged()
@@ -59,7 +59,7 @@ void WindowServerConnection::windowServerConnectionStateChanged()
 
 #endif
 
-WindowServerConnection& WindowServerConnection::shared()
+WindowServerConnection& WindowServerConnection::singleton()
 {
     static WindowServerConnection& windowServerConnection = *new WindowServerConnection;
     return windowServerConnection;
index 41163d9..f690eb7 100644 (file)
@@ -55,7 +55,7 @@ static uint64_t generateServerConnectionIdentifier()
 PassRefPtr<WebIDBServerConnection> WebIDBServerConnection::create(const String& databaseName, const SecurityOrigin& openingOrigin, const SecurityOrigin& mainFrameOrigin)
 {
     RefPtr<WebIDBServerConnection> result = adoptRef(new WebIDBServerConnection(databaseName, openingOrigin, mainFrameOrigin));
-    WebProcess::shared().webToDatabaseProcessConnection()->registerWebIDBServerConnection(*result);
+    WebProcess::singleton().webToDatabaseProcessConnection()->registerWebIDBServerConnection(*result);
     return result.release();
 }
 
@@ -71,7 +71,7 @@ WebIDBServerConnection::WebIDBServerConnection(const String& databaseName, const
 
 WebIDBServerConnection::~WebIDBServerConnection()
 {
-    WebProcess::shared().webToDatabaseProcessConnection()->removeWebIDBServerConnection(*this);
+    WebProcess::singleton().webToDatabaseProcessConnection()->removeWebIDBServerConnection(*this);
 
     for (const auto& it : m_serverRequests)
         it.value->requestAborted();
@@ -705,7 +705,7 @@ void WebIDBServerConnection::cursorIterate(IDBCursorBackend&, const CursorIterat
 
 IPC::Connection* WebIDBServerConnection::messageSenderConnection()
 {
-    return WebProcess::shared().webToDatabaseProcessConnection()->connection();
+    return WebProcess::singleton().webToDatabaseProcessConnection()->connection();
 }
 
 } // namespace WebKit
index 4e92390..42a1576 100644 (file)
@@ -63,7 +63,7 @@ void WebToDatabaseProcessConnection::didReceiveMessage(IPC::Connection& connecti
 
 void WebToDatabaseProcessConnection::didClose(IPC::Connection& connection)
 {
-    WebProcess::shared().webToDatabaseProcessConnectionClosed(this);
+    WebProcess::singleton().webToDatabaseProcessConnectionClosed(this);
 }
 
 void WebToDatabaseProcessConnection::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName)
index 45335ed..dace573 100644 (file)
@@ -40,7 +40,7 @@ namespace WebKit {
 
 void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, PassRefPtr<BlobDataFileReference> file, const String& contentType)
 {
-    ASSERT(WebProcess::shared().usesNetworkProcess());
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
 
     SandboxExtension::Handle extensionHandle;
 
@@ -48,43 +48,43 @@ void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, PassRefPtr<
     if (!file->path().isEmpty())
         SandboxExtension::createHandle(file->path(), SandboxExtension::ReadOnly, extensionHandle);
 
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, file->path(), extensionHandle, contentType), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, file->path(), extensionHandle, contentType), 0);
 }
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
 {
-    ASSERT(WebProcess::shared().usesNetworkProcess());
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
 
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
 }
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL)
 {
-    ASSERT(WebProcess::shared().usesNetworkProcess());
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
 
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
 }
 
 void BlobRegistryProxy::unregisterBlobURL(const URL& url)
 {
-    ASSERT(WebProcess::shared().usesNetworkProcess());
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
 
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
 }
 
 void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)
 {
-    ASSERT(WebProcess::shared().usesNetworkProcess());
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
 
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
 }
 
 unsigned long long BlobRegistryProxy::blobSize(const URL& url)
 {
-    ASSERT(WebProcess::shared().usesNetworkProcess());
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
 
     uint64_t resultSize;
-    if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
+    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
         return 0;
     return resultSize;
 }
index db28277..31eeed2 100644 (file)
@@ -48,7 +48,7 @@ using namespace WebKit;
 
 + (instancetype)lookUpFrameFromHandle:(_WKFrameHandle *)handle
 {
-    WebFrame* webFrame = WebProcess::shared().webFrame(handle._frameID);
+    WebFrame* webFrame = WebProcess::singleton().webFrame(handle._frameID);
     if (!webFrame)
         return nil;
 
index 9d88fd0..0ae913b 100644 (file)
@@ -163,7 +163,7 @@ static void didInitiateLoadForResource(WKBundlePageRef page, WKBundleFrameRef fr
     message.set(String::fromUTF8("Frame"), toImpl(frame));
     message.set(String::fromUTF8("Identifier"), API::UInt64::create(identifier));
     message.set(String::fromUTF8("Request"), toImpl(request));
-    WebProcess::shared().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidInitiateLoadForResource"), API::Dictionary::create(WTF::move(message)).get());
+    WebProcess::singleton().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidInitiateLoadForResource"), API::Dictionary::create(WTF::move(message)).get());
 }
 
 static WKURLRequestRef willSendRequestForFrame(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef wkRequest, WKURLResponseRef wkRedirectResponse, const void* clientInfo)
@@ -188,7 +188,7 @@ static WKURLRequestRef willSendRequestForFrame(WKBundlePageRef page, WKBundleFra
     message.set(String::fromUTF8("Request"), newRequest.get());
     if (!redirectResourceResponse.isNull())
         message.set(String::fromUTF8("RedirectResponse"), toImpl(wkRedirectResponse));
-    WebProcess::shared().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidSendRequestForResource"), API::Dictionary::create(WTF::move(message)).get());
+    WebProcess::singleton().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidSendRequestForResource"), API::Dictionary::create(WTF::move(message)).get());
 
     return toAPI(newRequest.release().leakRef());
 }
@@ -199,7 +199,7 @@ static void didReceiveResponseForResource(WKBundlePageRef page, WKBundleFrameRef
     message.set(String::fromUTF8("Page"), toImpl(page));
     message.set(String::fromUTF8("Identifier"), API::UInt64::create(identifier));
     message.set(String::fromUTF8("Response"), toImpl(response));
-    WebProcess::shared().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidReceiveResponseForResource"), API::Dictionary::create(WTF::move(message)).get());
+    WebProcess::singleton().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidReceiveResponseForResource"), API::Dictionary::create(WTF::move(message)).get());
 }
 
 static void didReceiveContentLengthForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, uint64_t length, const void*)
@@ -208,7 +208,7 @@ static void didReceiveContentLengthForResource(WKBundlePageRef page, WKBundleFra
     message.set(String::fromUTF8("Page"), toImpl(page));
     message.set(String::fromUTF8("Identifier"), API::UInt64::create(identifier));
     message.set(String::fromUTF8("ContentLength"), API::UInt64::create(length));
-    WebProcess::shared().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidReceiveContentLengthForResource"), API::Dictionary::create(WTF::move(message)).get());
+    WebProcess::singleton().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidReceiveContentLengthForResource"), API::Dictionary::create(WTF::move(message)).get());
 }
 
 static void didFinishLoadForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, const void*)
@@ -216,7 +216,7 @@ static void didFinishLoadForResource(WKBundlePageRef page, WKBundleFrameRef, uin
     API::Dictionary::MapType message;
     message.set(String::fromUTF8("Page"), toImpl(page));
     message.set(String::fromUTF8("Identifier"), API::UInt64::create(identifier));
-    WebProcess::shared().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidFinishLoadForResource"), API::Dictionary::create(WTF::move(message)).get());
+    WebProcess::singleton().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidFinishLoadForResource"), API::Dictionary::create(WTF::move(message)).get());
 }
 
 static void didFailLoadForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKErrorRef error, const void*)
@@ -225,7 +225,7 @@ static void didFailLoadForResource(WKBundlePageRef page, WKBundleFrameRef, uint6
     message.set(String::fromUTF8("Page"), toImpl(page));
     message.set(String::fromUTF8("Identifier"), API::UInt64::create(identifier));
     message.set(String::fromUTF8("Error"), toImpl(error));
-    WebProcess::shared().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidFailLoadForResource"), API::Dictionary::create(WTF::move(message)).get());
+    WebProcess::singleton().injectedBundle()->postMessage(String::fromUTF8("WebPage.DidFailLoadForResource"), API::Dictionary::create(WTF::move(message)).get());
 }
 
 class PageContextMenuClient final : public API::InjectedBundle::PageContextMenuClient {
@@ -478,7 +478,7 @@ void webkitWebPageDidReceiveMessage(WebKitWebPage* page, const String& messageNa
         messageReply.set("Page", webPage);
         messageReply.set("CallbackID", API::UInt64::create(callbackID));
         messageReply.set("Snapshot", snapshotImage);
-        WebProcess::shared().injectedBundle()->postMessage("WebPage.DidGetSnapshot", API::Dictionary::create(WTF::move(messageReply)).get());
+        WebProcess::singleton().injectedBundle()->postMessage("WebPage.DidGetSnapshot", API::Dictionary::create(WTF::move(messageReply)).get());
     } else
         ASSERT_NOT_REACHED();
 }
index 2fb8f95..b0a2745 100644 (file)
@@ -402,7 +402,7 @@ static void setUpResourceLoadClient(WKWebProcessPlugInBrowserContextController *
 
 + (instancetype)lookUpBrowsingContextFromHandle:(WKBrowsingContextHandle *)handle
 {
-    WebPage* webPage = WebProcess::shared().webPage(handle.pageID);
+    WebPage* webPage = WebProcess::singleton().webPage(handle.pageID);
     if (!webPage)
         return nil;
 
@@ -413,7 +413,7 @@ static void setUpResourceLoadClient(WKWebProcessPlugInBrowserContextController *
 {
     if (!_remoteObjectRegistry) {
         _remoteObjectRegistry = adoptNS([[_WKRemoteObjectRegistry alloc] _initWithMessageSender:*_page]);
-        WebProcess::shared().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
+        WebProcess::singleton().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
     }
 
     return _remoteObjectRegistry.get();
index ff0afd9..417093a 100644 (file)
@@ -116,32 +116,34 @@ void InjectedBundle::initializeClient(const WKBundleClientBase* client)
 
 void InjectedBundle::postMessage(const String& messageName, API::Object* messageBody)
 {
-    WebProcess::shared().parentProcessConnection()->send(Messages::WebProcessPool::HandleMessage(messageName, UserData(WebProcess::shared().transformObjectsToHandles(messageBody))), 0);
+    auto& webProcess = WebProcess::singleton();
+    webProcess.parentProcessConnection()->send(Messages::WebProcessPool::HandleMessage(messageName, UserData(webProcess.transformObjectsToHandles(messageBody))), 0);
 }
 
 void InjectedBundle::postSynchronousMessage(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData)
 {
     UserData returnUserData;
 
-    if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebProcessPool::HandleSynchronousMessage(messageName, UserData(WebProcess::shared().transformObjectsToHandles(messageBody))), Messages::WebProcessPool::HandleSynchronousMessage::Reply(returnUserData), 0))
+    auto& webProcess = WebProcess::singleton();
+    if (!webProcess.parentProcessConnection()->sendSync(Messages::WebProcessPool::HandleSynchronousMessage(messageName, UserData(webProcess.transformObjectsToHandles(messageBody))), Messages::WebProcessPool::HandleSynchronousMessage::Reply(returnUserData), 0))
         returnData = nullptr;
     else
-        returnData = WebProcess::shared().transformHandlesToObjects(returnUserData.object());
+        returnData = webProcess.transformHandlesToObjects(returnUserData.object());
 }
 
 WebConnection* InjectedBundle::webConnectionToUIProcess() const
 {
-    return WebProcess::shared().webConnectionToUIProcess();
+    return WebProcess::singleton().webConnectionToUIProcess();
 }
 
 void InjectedBundle::setAlwaysAcceptCookies(bool accept)
 {
-    WebProcess::shared().supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(accept ? HTTPCookieAcceptPolicyAlways : HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain);
+    WebProcess::singleton().supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(accept ? HTTPCookieAcceptPolicyAlways : HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain);
 }
 
 void InjectedBundle::setCacheModel(uint32_t cacheModel)
 {
-    WebProcess::shared().setCacheModel(cacheModel);
+    WebProcess::singleton().setCacheModel(cacheModel);
 }
 
 void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* pageGroup, const String& preference, bool enabled)
@@ -342,19 +344,19 @@ void InjectedBundle::setAsynchronousSpellCheckingEnabled(WebPageGroupProxy* page
 
 void InjectedBundle::clearAllDatabases()
 {
-    WebProcess::shared().supplement<WebDatabaseManager>()->deleteAllDatabases();
+    WebProcess::singleton().supplement<WebDatabaseManager>()->deleteAllDatabases();
 }
 
 void InjectedBundle::setDatabaseQuota(uint64_t quota)
 {
     // Historically, we've used the following (somewhat non-sensical) string
     // for the databaseIdentifier of local files.
-    WebProcess::shared().supplement<WebDatabaseManager>()->setQuotaForOrigin("file__0", quota);
+    WebProcess::singleton().supplement<WebDatabaseManager>()->setQuotaForOrigin("file__0", quota);
 }
 
 void InjectedBundle::clearApplicationCache()
 {
-    WebProcess::shared().supplement<WebApplicationCacheManager>()->deleteAllEntries();
+    WebProcess::singleton().supplement<WebApplicationCacheManager>()->deleteAllEntries();
 }
 
 void InjectedBundle::clearApplicationCacheForOrigin(const String& originString)
@@ -365,7 +367,7 @@ void InjectedBundle::clearApplicationCacheForOrigin(const String& originString)
 
 void InjectedBundle::setAppCacheMaximumSize(uint64_t size)
 {
-    WebProcess::shared().supplement<WebApplicationCacheManager>()->setAppCacheMaximumSize(size);
+    WebProcess::singleton().supplement<WebApplicationCacheManager>()->setAppCacheMaximumSize(size);
 }
 
 uint64_t InjectedBundle::appCacheUsageForOrigin(const String& originString)
@@ -586,7 +588,7 @@ uint64_t InjectedBundle::webNotificationID(JSContextRef jsContext, JSValueRef js
     WebCore::Notification* notification = JSNotification::toWrapped(toJS(toJS(jsContext), jsNotification));
     if (!notification)
         return 0;
-    return WebProcess::shared().supplement<WebNotificationManager>()->notificationIDForTesting(notification);
+    return WebProcess::singleton().supplement<WebNotificationManager>()->notificationIDForTesting(notification);
 #else
     UNUSED_PARAM(jsContext);
     UNUSED_PARAM(jsNotification);
index a94c79c..8370cc4 100644 (file)
@@ -56,7 +56,7 @@ NetworkProcessConnection::~NetworkProcessConnection()
 void NetworkProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder)
 {
     if (decoder.messageReceiverName() == Messages::WebResourceLoader::messageReceiverName()) {
-        if (WebResourceLoader* webResourceLoader = WebProcess::shared().webResourceLoadScheduler().webResourceLoaderForIdentifier(decoder.destinationID()))
+        if (WebResourceLoader* webResourceLoader = WebProcess::singleton().webResourceLoadScheduler().webResourceLoaderForIdentifier(decoder.destinationID()))
             webResourceLoader->didReceiveWebResourceLoaderMessage(connection, decoder);
         
         return;
@@ -73,7 +73,7 @@ void NetworkProcessConnection::didReceiveSyncMessage(IPC::Connection&, IPC::Mess
 void NetworkProcessConnection::didClose(IPC::Connection&)
 {
     // The NetworkProcess probably crashed.
-    WebProcess::shared().networkProcessConnectionClosed(this);
+    WebProcess::singleton().networkProcessConnectionClosed(this);
 }
 
 void NetworkProcessConnection::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference, IPC::StringReference)
index 434790a..80245fb 100644 (file)
@@ -180,7 +180,7 @@ void WebResourceLoadScheduler::scheduleLoad(ResourceLoader* resourceLoader, Cach
 
     ASSERT((loadParameters.webPageID && loadParameters.webFrameID) || loadParameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials);
 
-    if (!WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ScheduleResourceLoad(loadParameters), 0)) {
+    if (!WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ScheduleResourceLoad(loadParameters), 0)) {
         // We probably failed to schedule this load with the NetworkProcess because it had crashed.
         // This load will never succeed so we will schedule it to fail asynchronously.
         scheduleInternallyFailedLoad(resourceLoader);
@@ -226,7 +226,7 @@ void WebResourceLoadScheduler::remove(ResourceLoader* resourceLoader)
     if (!loader)
         return;
 
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RemoveLoadIdentifier(identifier), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RemoveLoadIdentifier(identifier), 0);
 
     // It's possible that this WebResourceLoader might be just about to message back to the NetworkProcess (e.g. ContinueWillSendRequest)
     // but there's no point in doing so anymore.
@@ -236,7 +236,7 @@ void WebResourceLoadScheduler::remove(ResourceLoader* resourceLoader)
 void WebResourceLoadScheduler::setDefersLoading(ResourceLoader* resourceLoader, bool defers)
 {
     ResourceLoadIdentifier identifier = resourceLoader->identifier();
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
 }
 
 void WebResourceLoadScheduler::crossOriginRedirectReceived(ResourceLoader*, const URL&)
@@ -254,7 +254,7 @@ void WebResourceLoadScheduler::servePendingRequests(ResourceLoadPriority minimum
     if (m_suspendPendingRequestsCount)
         return;
 
-    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ServePendingRequests(minimumPriority), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ServePendingRequests(minimumPriority), 0);
 }
 
 void WebResourceLoadScheduler::suspendPendingRequests()
@@ -270,7 +270,7 @@ void WebResourceLoadScheduler::resumePendingRequests()
 
 void WebResourceLoadScheduler::setSerialLoadingEnabled(bool enabled)
 {
-    WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::SetSerialLoadingEnabled(enabled), Messages::NetworkConnectionToWebProcess::SetSerialLoadingEnabled::Reply(), 0);
+    WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::SetSerialLoadingEnabled(enabled), Messages::NetworkConnectionToWebProcess::SetSerialLoadingEnabled::Reply(), 0);
 }
 
 void WebResourceLoadScheduler::networkProcessCrashed()
index 6d668d5..89d178b 100644 (file)
@@ -61,7 +61,7 @@ WebResourceLoader::~WebResourceLoader()
 
 IPC::Connection* WebResourceLoader::messageSenderConnection()
 {
-    return WebProcess::shared().networkConnection()->connection();
+    return WebProcess::singleton().networkConnection()->connection();
 }
 
 uint64_t WebResourceLoader::messageSenderDestinationID()
index 6098a17..3a99dd8 100644 (file)
@@ -126,7 +126,7 @@ NotificationClient::Permission NotificationPermissionRequestManager::permissionL
     if (!m_page->corePage()->settings().notificationsEnabled())
         return NotificationClient::PermissionDenied;
     
-    return WebProcess::shared().supplement<WebNotificationManager>()->policyForOrigin(securityOrigin);
+    return WebProcess::singleton().supplement<WebNotificationManager>()->policyForOrigin(securityOrigin);
 #else
     UNUSED_PARAM(securityOrigin);
     return NotificationClient::PermissionDenied;
@@ -136,7 +136,7 @@ NotificationClient::Permission NotificationPermissionRequestManager::permissionL
 void NotificationPermissionRequestManager::setPermissionLevelForTesting(const String& originString, bool allowed)
 {
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-    WebProcess::shared().supplement<WebNotificationManager>()->didUpdateNotificationDecision(originString, allowed);
+    WebProcess::singleton().supplement<WebNotificationManager>()->didUpdateNotificationDecision(originString, allowed);
 #else
     UNUSED_PARAM(originString);
     UNUSED_PARAM(allowed);
@@ -146,7 +146,7 @@ void NotificationPermissionRequestManager::setPermissionLevelForTesting(const St
 void NotificationPermissionRequestManager::removeAllPermissionsForTesting()
 {
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-    WebProcess::shared().supplement<WebNotificationManager>()->removeAllPermissionsForTesting();
+    WebProcess::singleton().supplement<WebNotificationManager>()->removeAllPermissionsForTesting();
 #endif
 }
 
@@ -162,7 +162,7 @@ void NotificationPermissionRequestManager::didReceiveNotificationPermissionDecis
 
     m_originToIDMap.remove(origin);
 
-    WebProcess::shared().supplement<WebNotificationManager>()->didUpdateNotificationDecision(origin->toString(), allowed);
+    WebProcess::singleton().supplement<WebNotificationManager>()->didUpdateNotificationDecision(origin->toString(), allowed);
 
 #if ENABLE(LEGACY_NOTIFICATIONS)
     RefPtr<WebCore::VoidCallback> voidCallback = m_idToVoidCallbackMap.take(requestID);
index 80f4436..04efbf7 100644 (file)
@@ -1662,7 +1662,8 @@ void PDFPlugin::writeItemsToPasteboard(NSString *pasteboardName, NSArray *items,
         pasteboardTypes.append(type);
 
     uint64_t newChangeCount;
-    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::SetPasteboardTypes(pasteboardName, pasteboardTypes),
+    auto& webProcess = WebProcess::singleton();
+    webProcess.parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::SetPasteboardTypes(pasteboardName, pasteboardTypes),
         Messages::WebPasteboardProxy::SetPasteboardTypes::Reply(newChangeCount), 0);
 
     for (NSUInteger i = 0, count = items.count; i < count; ++i) {
@@ -1677,7 +1678,7 @@ void PDFPlugin::writeItemsToPasteboard(NSString *pasteboardName, NSArray *items,
 
         if ([type isEqualToString:NSStringPboardType] || [type isEqualToString:NSPasteboardTypeString]) {
             RetainPtr<NSString> plainTextString = adoptNS([[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
-            WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::SetPasteboardStringForType(pasteboardName, type, plainTextString.get()), Messages::WebPasteboardProxy::SetPasteboardStringForType::Reply(newChangeCount), 0);
+            webProcess.parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::SetPasteboardStringForType(pasteboardName, type, plainTextString.get()), Messages::WebPasteboardProxy::SetPasteboardStringForType::Reply(newChangeCount), 0);
         } else {
             RefPtr<SharedBuffer> buffer = SharedBuffer::wrapNSData(data);
 
@@ -1688,7 +1689,7 @@ void PDFPlugin::writeItemsToPasteboard(NSString *pasteboardName, NSArray *items,
             RefPtr<SharedMemory> sharedMemory = SharedMemory::create(buffer->size());
             memcpy(sharedMemory->data(), buffer->data(), buffer->size());
             sharedMemory->createHandle(handle, SharedMemory::ReadOnly);
-            WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::SetPasteboardBufferForType(pasteboardName, type, handle, buffer->size()), Messages::WebPasteboardProxy::SetPasteboardBufferForType::Reply(newChangeCount), 0);
+            webProcess.parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::SetPasteboardBufferForType(pasteboardName, type, handle, buffer->size()), Messages::WebPasteboardProxy::SetPasteboardBufferForType::Reply(newChangeCount), 0);
         }
     }
 }
index d8bb990..c354b22 100644 (file)
@@ -70,7 +70,7 @@ PluginProcessConnection* PluginProcessConnectionManager::getPluginProcessConnect
 
     IPC::Attachment encodedConnectionIdentifier;
     bool supportsAsynchronousInitialization;
-    if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetPluginProcessConnection(pluginProcessToken),
+    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetPluginProcessConnection(pluginProcessToken),
                                                      Messages::WebProcessProxy::GetPluginProcessConnection::Reply(encodedConnectionIdentifier, supportsAsynchronousInitialization), 0))
         return 0;
 
index 095dcbd..dd7f929 100644 (file)
@@ -86,7 +86,7 @@ void PluginProxy::pluginProcessCrashed()
 bool PluginProxy::initialize(const Parameters& parameters)
 {
     ASSERT(!m_connection);
-    m_connection = WebProcess::shared().pluginProcessConnectionManager().getPluginProcessConnection(m_pluginProcessToken);
+    m_connection = WebProcess::singleton().pluginProcessConnectionManager().getPluginProcessConnection(m_pluginProcessToken);
     
     if (!m_connection)
         return false;
index 107607a..1864233 100644 (file)
@@ -1532,7 +1532,7 @@ void PluginView::setComplexTextInputState(PluginComplexTextInputState pluginComp
 
 const MachSendRight& PluginView::compositingRenderServerPort()
 {
-    return WebProcess::shared().compositingRenderServerPort();
+    return WebProcess::singleton().compositingRenderServerPort();
 }
 
 void PluginView::openPluginPreferencePane()
@@ -1814,7 +1814,7 @@ void PluginView::pluginDidReceiveUserInteraction()
     String pluginOrigin = plugInImageElement.loadedUrl().host();
     String mimeType = plugInImageElement.loadedMimeType();
 
-    WebProcess::shared().plugInDidReceiveUserInteraction(pageOrigin, pluginOrigin, mimeType, plugInImageElement.document().page()->sessionID());
+    WebProcess::singleton().plugInDidReceiveUserInteraction(pageOrigin, pluginOrigin, mimeType, plugInImageElement.document().page()->sessionID());
 }
 
 bool PluginView::shouldCreateTransientPaintingSnapshot() const
index 3a3c596..a680881 100644 (file)
@@ -54,12 +54,12 @@ RemoteScrollingCoordinator::RemoteScrollingCoordinator(WebPage* page)
     : AsyncScrollingCoordinator(page->corePage())
     , m_webPage(page)
 {
-    WebProcess::shared().addMessageReceiver(Messages::RemoteScrollingCoordinator::messageReceiverName(), m_webPage->pageID(), *this);
+    WebProcess::singleton().addMessageReceiver(Messages::RemoteScrollingCoordinator::messageReceiverName(), m_webPage->pageID(), *this);
 }
 
 RemoteScrollingCoordinator::~RemoteScrollingCoordinator()
 {
-    WebProcess::shared().removeMessageReceiver(Messages::RemoteScrollingCoordinator::messageReceiverName(), m_webPage->pageID());
+    WebProcess::singleton().removeMessageReceiver(Messages::RemoteScrollingCoordinator::messageReceiverName(), m_webPage->pageID());
 }
 
 void RemoteScrollingCoordinator::scheduleTreeStateCommit()
index 76b09ae..e218516 100644 (file)
@@ -71,24 +71,24 @@ StorageAreaMap::StorageAreaMap(StorageNamespaceImpl* storageNamespace, PassRefPt
     switch (m_storageType) {
     case WebCore::LocalStorage:
         if (SecurityOrigin* topLevelOrigin = storageNamespace->topLevelOrigin())
-            WebProcess::shared().parentProcessConnection()->send(Messages::StorageManager::CreateTransientLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(topLevelOrigin), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
+            WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateTransientLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(topLevelOrigin), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
         else
-            WebProcess::shared().parentProcessConnection()->send(Messages::StorageManager::CreateLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
+            WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
 
         break;
 
     case WebCore::SessionStorage:
-        WebProcess::shared().parentProcessConnection()->send(Messages::StorageManager::CreateSessionStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
+        WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateSessionStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
         break;
     }
 
-    WebProcess::shared().addMessageReceiver(Messages::StorageAreaMap::messageReceiverName(), m_storageMapID, *this);
+    WebProcess::singleton().addMessageReceiver(Messages::StorageAreaMap::messageReceiverName(), m_storageMapID, *this);
 }
 
 StorageAreaMap::~StorageAreaMap()
 {
-    WebProcess::shared().parentProcessConnection()->send(Messages::StorageManager::DestroyStorageMap(m_storageMapID), 0);
-    WebProcess::shared().removeMessageReceiver(Messages::StorageAreaMap::messageReceiverName(), m_storageMapID);
+    WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::DestroyStorageMap(m_storageMapID), 0);
+    WebProcess::singleton().removeMessageReceiver(Messages::StorageAreaMap::messageReceiverName(), m_storageMapID);
 }
 
 unsigned StorageAreaMap::length()
@@ -129,7 +129,7 @@ void StorageAreaMap::setItem(Frame* sourceFrame, StorageAreaImpl* sourceArea, co
 
     m_pendingValueChanges.add(key);
 
-    WebProcess::shared().parentProcessConnection()->send(Messages::StorageManager::SetItem(m_storageMapID, sourceArea->storageAreaID(), m_currentSeed, key, value, sourceFrame->document()->url()), 0);
+    WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::SetItem(m_storageMapID, sourceArea->storageAreaID(), m_currentSeed, key, value, sourceFrame->document()->url()), 0);
 }
 
 void StorageAreaMap::removeItem(WebCore::Frame* sourceFrame, StorageAreaImpl* sourceArea, const String& key)
@@ -145,7 +145,7 @@ void StorageAreaMap::removeItem(WebCore::Frame* sourceFrame, StorageAreaImpl* so
 
     m_pendingValueChanges.add(key);
 
-    WebProcess::shared().parentProcessConnection()->send(Messages::StorageManager::RemoveItem(m_storageMapID, sourceArea->storageAreaID(), m_currentSeed, key, sourceFrame->document()->url()), 0);
+    WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::RemoveItem(m_storageMapID, sourceArea->storageAreaID(), m_currentSeed, key, sourceFrame->document()->url()), 0);
 }
 
 void StorageAreaMap::clear(WebCore::Frame* sourceFrame, StorageAreaImpl* sourceArea)
@@ -154,7 +154,7 @@ void StorageAreaMap::clear(WebCore::Frame* sourceFrame, StorageAreaImpl* sourceA
 
     m_hasPendingClear = true;
     m_storageMap = StorageMap::create(m_quotaInBytes);
-    WebProcess::shared().parentProcessConnection()->send(Messages::StorageManager::Clear(m_storageMapID, sourceArea->storageAreaID(), m_currentSeed, sourceFrame->document()->url()), 0);
+    WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::Clear(m_storageMapID, sourceArea->storageAreaID(), m_currentSeed, sourceFrame->document()->url()), 0);
 }
 
 bool StorageAreaMap::contains(const String& key)
@@ -183,7 +183,7 @@ void StorageAreaMap::loadValuesIfNeeded()
     // FIXME: This should use a special sendSync flag to indicate that we don't want to process incoming messages while waiting for a reply.
     // (This flag does not yet exist). Since loadValuesIfNeeded() ends up being called from within JavaScript code, processing incoming synchronous messages
     // could lead to weird reentrency bugs otherwise.
-    WebProcess::shared().parentProcessConnection()->sendSync(Messages::StorageManager::GetValues(m_storageMapID, m_currentSeed), Messages::StorageManager::GetValues::Reply(values), 0);
+    WebProcess::singleton().parentProcessConnection()->sendSync(Messages::StorageManager::GetValues(m_storageMapID, m_currentSeed), Messages::StorageManager::GetValues::Reply(values), 0);
 
     m_storageMap = StorageMap::create(m_quotaInBytes);
     m_storageMap->importItems(values);
@@ -316,7 +316,7 @@ void StorageAreaMap::dispatchSessionStorageEvent(uint64_t sourceStorageAreaID, c
 
     // Namespace IDs for session storage namespaces are equivalent to web page IDs
     // so we can get the right page here.
-    WebPage* webPage = WebProcess::shared().webPage(m_storageNamespaceID);
+    WebPage* webPage = WebProcess::singleton().webPage(m_storageNamespaceID);
     if (!webPage)
         return;
 
@@ -350,7 +350,7 @@ void StorageAreaMap::dispatchLocalStorageEvent(uint64_t sourceStorageAreaID, con
 
     Vector<RefPtr<Frame>> frames;
 
-    PageGroup& pageGroup = *WebProcess::shared().webPageGroup(m_storageNamespaceID)->corePageGroup();
+    PageGroup& pageGroup = *WebProcess::singleton().webPageGroup(m_storageNamespaceID)->corePageGroup();
     const HashSet<Page*>& pages = pageGroup.pages();
     for (HashSet<Page*>::const_iterator it = pages.begin(), end = pages.end(); it != end; ++it) {
         for (Frame* frame = &(*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
index 4fcf86e..2360333 100644 (file)
@@ -70,14 +70,14 @@ WebUserContentController::WebUserContentController(uint64_t identifier)
     : m_identifier(identifier)
     , m_userContentController(*UserContentController::create())
 {
-    WebProcess::shared().addMessageReceiver(Messages::WebUserContentController::messageReceiverName(), m_identifier, *this);
+    WebProcess::singleton().addMessageReceiver(Messages::WebUserContentController::messageReceiverName(), m_identifier, *this);
 }
 
 WebUserContentController::~WebUserContentController()
 {
     ASSERT(userContentControllers().contains(m_identifier));
 
-    WebProcess::shared().removeMessageReceiver(Messages::WebUserContentController::messageReceiverName(), m_identifier);
+    WebProcess::singleton().removeMessageReceiver(Messages::WebUserContentController::messageReceiverName(), m_identifier);
 
     userContentControllers().remove(m_identifier);
 }
@@ -133,7 +133,7 @@ public:
         if (!webPage)
             return;
 
-        WebProcess::shared().parentProcessConnection()->send(Messages::WebUserContentControllerProxy::DidPostMessage(webPage->pageID(), webFrame->frameID(), m_identifier, IPC::DataReference(value->data())), m_controller->identifier());
+        WebProcess::singleton().parentProcessConnection()->send(Messages::WebUserContentControllerProxy::DidPostMessage(webPage->pageID(), webFrame->frameID(), m_identifier, IPC::DataReference(value->data())), m_controller->identifier());
     }
 
     WebCore::UserMessageHandlerDescriptor& descriptor() { return *m_descriptor; }
index 1d136e4..aa7d4fb 100644 (file)
@@ -38,17 +38,17 @@ namespace WebKit {
 
 void WebBatteryClient::startUpdating()
 {
-    WebProcess::shared().supplement<WebBatteryManager>()->registerWebPage(m_page);
+    WebProcess::singleton().supplement<WebBatteryManager>()->registerWebPage(m_page);
 }
 
 void WebBatteryClient::stopUpdating()
 {
-    WebProcess::shared().supplement<WebBatteryManager>()->unregisterWebPage(m_page);
+    WebProcess::singleton().supplement<WebBatteryManager>()->unregisterWebPage(m_page);
 }
 
 void WebBatteryClient::batteryControllerDestroyed()
 {
-    WebProcess::shared().supplement<WebBatteryManager>()->unregisterWebPage(m_page);
+    WebProcess::singleton().supplement<WebBatteryManager>()->unregisterWebPage(m_page);
     delete this;
 }
 
index ea5a398..f2a01be 100644 (file)
@@ -135,7 +135,7 @@ FloatRect WebChromeClient::windowRect()
 
     FloatRect newWindowFrame;
 
-    if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetWindowFrame(), Messages::WebPageProxy::GetWindowFrame::Reply(newWindowFrame), m_page->pageID()))
+    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetWindowFrame(), Messages::WebPageProxy::GetWindowFrame::Reply(newWindowFrame), m_page->pageID()))
         return FloatRect();
 
     return newWindowFrame;
@@ -192,7 +192,7 @@ void WebChromeClient::focusedFrameChanged(Frame* frame)
 {
     WebFrame* webFrame = frame ? WebFrame::fromCoreFrame(*frame) : nullptr;
 
-    WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::FocusedFrameChanged(webFrame ? webFrame->frameID() : 0), m_page->pageID());
+    WebProcess::singleton().parentProcessConnection()->send(Messages::WebPageProxy::FocusedFrameChanged(webFrame ? webFrame->frameID() : 0), m_page->pageID());
 }
 
 Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction)
@@ -213,14 +213,15 @@ Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& reques
 
     uint64_t newPageID = 0;
     WebPageCreationParameters parameters;
-    if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::CreateNewPage(webFrame->frameID(), request.resourceRequest(), windowFeatures, navigationActionData), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page->pageID()))
-        return 0;
+    auto& webProcess = WebProcess::singleton();
+    if (!webProcess.parentProcessConnection()->sendSync(Messages::WebPageProxy::CreateNewPage(webFrame->frameID(), request.resourceRequest(), windowFeatures, navigationActionData), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page->pageID()))
+        return nullptr;
 
     if (!newPageID)
-        return 0;
+        return nullptr;
 
-    WebProcess::shared().createWebPage(newPageID, parameters);
-    return WebProcess::shared().webPage(newPageID)->corePage();
+    webProcess.createWebPage(newPageID, parameters);
+    return webProcess.webPage(newPageID)->corePage();
 }
 
 void WebChromeClient::show()
@@ -250,7 +251,7 @@ bool WebChromeClient::toolbarsVisible()
         return toolbarsVisibility == API::InjectedBundle::PageUIClient::UIElementVisibility::Visible;
     
     bool toolbarsAreVisible = true;
-    if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetToolbarsAreVisible(), Messages::WebPageProxy::GetToolbarsAreVisible::Reply(toolbarsAreVisible), m_page->pageID()))
+    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetToolbarsAreVisible(), Messages::WebPageProxy::GetToolbarsAreVisible::Reply(toolbarsAreVisible), m_page->pageID()))
         return true;
 
     return toolbarsAreVisible;
@@ -268,7 +269,7 @@ bool WebChromeClient::statusbarVisible()
         return statusbarVisibility == API::InjectedBundle::PageUIClient::UIElementVisibility::Visible;
 
     bool statusBarIsVisible = true;
-    if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetStatusBarIsVisible(), Messages::WebPageProxy::GetStatusBarIsVisible::Reply(statusBarIsVisible), m_page->pageID()))
+    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetStatusBarIsVisible(), Messages::WebPageProxy::GetStatusBarIsVisible::Reply(statusBarIsVisible), m_page->pageID()))
         return true;
 
     return statusBarIsVisible;
@@ -297,7 +298,7 @@ bool WebChromeClient::menubarVisible()
         return menubarVisibility == API::InjectedBundle::PageUIClient::UIElementVisibility::Visible;
     
     bool menuBarIsVisible = true;
-    if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetMenuBarIsVisible(), Messages::WebPageProxy::GetMenuBarIsVisible::Reply(menuBarIsVisible), m_page->pageID()))
+    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetMenuBarIsVisible(), Messages::WebPageProxy::GetMenuBarIsVisible::Reply(menuBarIsVisible), m_page->pageID()))
         return true;
 
     return menuBarIsVisible;
@@ -331,7 +332,7 @@ bool WebChromeClient::runBeforeUnloadConfirmPanel(const String& message, Frame*
     if (WebPage::synchronousMessagesShouldSpinRunLoop())
         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
     
-    if (!WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags))
+    if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags))
         return false;
 
     return shouldClose;
@@ -367,7 +368,7 @@ void WebChromeClient::runJavaScriptAlert(Frame* frame, const String& alertText)
     unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
     if (WebPage::synchronousMessagesShouldSpinRunLoop())
         syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
-    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
+    WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScr