Rename shared() static member functions to singleton() for singleton classes as per the recent coding style change.
Created attachment 245724 [details] Patch
Created attachment 245725 [details] Patch
Created attachment 245727 [details] Patch
Comment on attachment 245725 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245725&action=review Massive clean up, I like it :) Make sure to fix iOS before landing! > Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp:-176 > - algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::HMAC); If is is used everywhere, may I suggest moving CryptoAlgorithmRegistry::shared() out of the branches? > Source/WebCore/loader/FrameLoader.cpp:1765 > + PageCache::singleton().pruneToSizeNow(PageCache::singleton().maxSize() / 2, PruningReason::MemoryPressure); Let's put the singleton in a temp variable instead of querying it twice. > Source/WebCore/page/scrolling/ScrollingThread.cpp:43 > + if (!singleton().m_threadIdentifier) Let's use a local variable for the value. Personally, I would still scope this call: ScrollingThread::singleton(). > Source/WebCore/page/scrolling/ScrollingThread.cpp:51 > + singleton().createThreadIfNeeded(); ditto > Source/WebCore/platform/graphics/ShadowBlur.cpp:743 > - m_layerImage = ScratchBuffer::shared().getScratchBuffer(templateSize); > + m_layerImage = ScratchBuffer::singleton().getScratchBuffer(templateSize); Local variable? > Source/WebCore/platform/graphics/ShadowBlur.cpp:899 > + ScratchBuffer::singleton().setCachedShadowValues(FloatSize(), Color::black, ColorSpaceDeviceRGB, IntRect(), FloatRoundedRect::Radii(), m_layerSize); > + m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerRect.size()); Local variable? > Source/WebKit/mac/WebView/WebView.mm:7918 > - PageCache::shared().setMaxSize(pageCacheSize); > + PageCache::singleton().setMaxSize(pageCacheSize); Local variable? > Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp:65 > + singleton().removeVisitedLinkHashes(); I would scope. > Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp:185 > - NetworkProcess::shared().downloadManager().startDownload(downloadID, request); > + NetworkProcess::singleton().downloadManager().startDownload(downloadID, request); Local variable? > Source/WebKit2/NetworkProcess/NetworkProcess.cpp:298 > + data.statisticsNumbers.set("DownloadsActiveCount", singleton().downloadManager().activeDownloadCount()); > + data.statisticsNumbers.set("OutstandingAuthenticationChallengesCount", singleton().authenticationManager().outstandingAuthenticationChallengeCount()); Scope? Local variable? > Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm:138 > + if (NetworkCache::singleton().isEnabled()) { > + NetworkCache::singleton().setMaximumSize(urlCacheDiskCapacity); Local variable? > Source/WebKit2/PluginProcess/PluginProcess.cpp:74 > + if (singleton().shouldTerminate()) > + singleton().terminate(); Scope? Local variable? > Source/WebKit2/UIProcess/WebProcessPool.cpp:678 > + parameters.hasImageServices = ServicesController::singleton().hasImageServices(); Local variable? > Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp:126 > + if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebProcessPool::HandleSynchronousMessage(messageName, UserData(WebProcess::singleton().transformObjectsToHandles(messageBody))), Messages::WebProcessPool::HandleSynchronousMessage::Reply(returnUserData), 0)) Local variable? > Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm:1665 > + WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::SetPasteboardTypes(pasteboardName, pasteboardTypes), Local variable? > Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:216 > + if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::CreateNewPage(webFrame->frameID(), request.resourceRequest(), windowFeatures, navigationActionData), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page->pageID())) Local variable? > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:113 > + if (WebProcess::singleton().usesNetworkProcess()) { Local variable? > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:127 > + if (WebProcess::singleton().usesNetworkProcess()) { Local variable? > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:139 > + if (WebProcess::singleton().usesNetworkProcess()) { Local variable? > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:153 > + if (WebProcess::singleton().usesNetworkProcess()) { Local variable? > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:167 > + if (WebProcess::singleton().usesNetworkProcess()) { Local variable? > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:180 > + if (WebProcess::singleton().usesNetworkProcess()) { Local variable? > Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:196 > + if (WebProcess::singleton().usesNetworkProcess()) Local variable? > Source/WebKit2/WebProcess/WebPage/WebFrame.cpp:254 > + if (WebProcess::singleton().usesNetworkProcess()) { Local variable? > Source/WebKit2/WebProcess/WebPage/WebFrame.cpp:273 > + if (WebProcess::singleton().usesNetworkProcess()) { Local variable? > Source/WebKit2/WebProcess/WebPage/WebInspectorUI.cpp:132 > + WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorProxy::Detach(), m_inspectedPageIdentifier); Local variable? > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:477 > + WebProcess::singleton().addMessageReceiver(Messages::WebPage::messageReceiverName(), m_pageID, *this); Local variable? > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:561 > + WebProcess::singleton().removeMessageReceiver(Messages::WebPage::messageReceiverName(), m_pageID); Local variable? > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1619 > + InjectedBundle* injectedBundle = WebProcess::singleton().injectedBundle(); Local variable? > Tools/DumpRenderTree/WorkQueue.cpp:44 > static WorkQueue* sharedInstance = new WorkQueue; > return sharedInstance; Odd > Tools/DumpRenderTree/mac/DumpRenderTree.mm:1873 > + WorkQueue::singleton()->clear(); Local variable? > Tools/DumpRenderTree/mac/FrameLoadDelegate.mm:162 > + WorkQueue::singleton()->setFrozen(true); // first complete load freezes the queue for the rest of this test Local variable? > Tools/DumpRenderTree/win/DumpRenderTree.cpp:1110 > + WorkQueue::singleton()->clear(); Local variable? > Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp:211 > + WKBundlePageRef page = InjectedBundle::singleton().page()->page(); Local variable? > Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp:460 > + WKBundlePageSetPageZoomFactor(InjectedBundle::singleton().page()->page(), 1); Local variable? > Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp:469 > + WKBundlePageSetPageZoomFactor(InjectedBundle::singleton().page()->page(), 1); Local variable? > Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp:478 > + WKBundlePageSetTextZoomFactor(InjectedBundle::singleton().page()->page(), 1); Local variable? > Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp:487 > + WKBundlePageSetTextZoomFactor(InjectedBundle::singleton().page()->page(), 1); Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:655 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:677 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:688 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:699 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:710 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:852 > + switch (InjectedBundle::singleton().testRunner()->whatToDump()) { Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:873 > + if (InjectedBundle::singleton().testRunner()->shouldDumpAllFrameScrollPositions()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:919 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:941 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:975 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:995 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1014 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1023 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFrameLoadCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1029 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFrameLoadCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1035 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFrameLoadCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1062 > + if (InjectedBundle::singleton().isTestRunning() Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1118 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1160 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1174 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1191 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1231 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1350 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1377 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1392 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1404 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1427 > + if (InjectedBundle::singleton().testRunner()->shouldDumpApplicationCacheDelegateCallbacks()) { Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1452 > + if (InjectedBundle::singleton().testRunner()->shouldDumpDatabaseCallbacks()) { Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1543 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1558 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1573 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1598 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1623 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1638 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1650 > + if (InjectedBundle::singleton().testRunner()->shouldDumpEditingCallbacks()) { Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1668 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1685 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1699 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1713 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1727 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1742 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFullScreenCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1749 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFullScreenCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1760 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFullScreenCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1771 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFullScreenCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1777 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFullScreenCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1783 > + if (InjectedBundle::singleton().testRunner()->shouldDumpFullScreenCallbacks()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1895 > + if (frame != InjectedBundle::singleton().topLoadingFrame()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:151 > + InjectedBundle::singleton().outputText("FAIL: Timed out waiting for notifyDone to be called\n\n"); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:157 > + if (!InjectedBundle::singleton().isTestRunning()) Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:175 > + WKBundleAddUserScript(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:185 > + WKBundleAddUserStyleSheet(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:289 > + WKRetainPtr<WKArrayRef> origins(AdoptWK, WKBundleCopyOriginsWithApplicationCache(InjectedBundle::singleton().bundle())); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:361 > + WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::singleton().page()->page()); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:377 > + WKRetainPtr<WKDataRef> audioData(AdoptWK, WKBundleCreateWKDataFromUInt8Array(InjectedBundle::singleton().bundle(), context, data)); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:582 > + WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().pageGroup(), toWK(preference).get(), toBool(value)); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:601 > + WKBundleSetUserStyleSheetLocation(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().pageGroup(), location); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:614 > + WKBundleSetSpatialNavigationEnabled(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().pageGroup(), enabled); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:619 > + WKBundleSetTabKeyCyclesThroughElements(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().page()->page(), enabled); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:639 > + WKBundleSetAsynchronousSpellCheckingEnabled(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().pageGroup(), enabled); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:645 > + WKBundleSetWebNotificationPermission(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().page()->page(), originWK.get(), true); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:651 > + WKBundleSetWebNotificationPermission(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().page()->page(), originWK.get(), false); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:656 > + WKBundleRemoveAllWebNotificationPermissions(InjectedBundle::singleton().bundle(), InjectedBundle::singleton().page()->page()); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:661 > + WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::singleton().page()->page()); Local variable? > Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:739 > + WKRetainPtr<WKURLRef> baseURLWK(AdoptWK, WKBundleFrameCopyURL(WKBundlePageGetMainFrame(InjectedBundle::singleton().page()->page()))); Local variable? > Tools/WebKitTestRunner/TestController.cpp:677 > + WKContextPostMessageToInjectedBundle(TestController::singleton().context(), messageName.get(), resetMessageBody.get()); Local variable? > Tools/WebKitTestRunner/TestInvocation.cpp:132 > + TestController::singleton().configureViewForTest(*this); Local variable? > Tools/WebKitTestRunner/TestInvocation.cpp:248 > + WKPageForceRepaint(TestController::singleton().mainWebView()->page(), this, TestInvocation::forceRepaintDoneCallback); Local variable? > Tools/WebKitTestRunner/TestInvocation.cpp:353 > + TestController::singleton().mainWebView()->addChromeInputField(); Local variable? > Tools/WebKitTestRunner/TestInvocation.cpp:360 > + TestController::singleton().mainWebView()->removeChromeInputField(); Local variable? > Tools/WebKitTestRunner/TestInvocation.cpp:367 > + TestController::singleton().mainWebView()->makeWebViewFirstResponder(); Local variable? > Tools/WebKitTestRunner/TestInvocation.cpp:376 > + WKPageSetCustomBackingScaleFactor(TestController::singleton().mainWebView()->page(), backingScaleFactor); Local variable? > Tools/WebKitTestRunner/TestInvocation.cpp:499 > + if (TestController::singleton().workQueueManager().processWorkQueue()) { Local variable? > Tools/WebKitTestRunner/mac/WebKitTestRunnerEvent.mm:39 > + WKPoint location = TestController::singleton().eventSenderProxy()->position(); Local variable?
Thanks, I'll fix the mac build and take into consideration Ben's comments before landing.
Created attachment 245731 [details] Patch
Committed r179409: <http://trac.webkit.org/changeset/179409>