Changeset 161045 in webkit
- Timestamp:
- Dec 23, 2013 7:28:01 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r161035 r161045 1 2013-12-22 Sam Weinig <sam@webkit.org> 2 3 [WK2] Replace usage of DEFINE_STATIC_LOCAL with NeverDestroyed 4 https://bugs.webkit.org/show_bug.cgi?id=126144 5 6 Reviewed by Anders Carlsson. 7 8 * DatabaseProcess/DatabaseProcess.cpp: 9 (WebKit::DatabaseProcess::shared): 10 * DatabaseProcess/DatabaseProcess.h: 11 * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: 12 (WebKit::NetworkBlobRegistry::shared): 13 * NetworkProcess/NetworkProcess.cpp: 14 (WebKit::NetworkProcess::shared): 15 (WebKit::NetworkProcess::downloadManager): 16 * NetworkProcess/NetworkProcess.h: 17 * NetworkProcess/NetworkProcessPlatformStrategies.cpp: 18 (WebKit::NetworkProcessPlatformStrategies::initialize): 19 * NetworkProcess/mac/RemoteNetworkingContext.mm: 20 (WebKit::privateBrowsingStorageSessionIdentifierBase): 21 * Platform/CoreIPC/Connection.cpp: 22 (CoreIPC::Connection::SyncMessageState::syncMessageStateMap): 23 (CoreIPC::Connection::SyncMessageState::syncMessageStateMapMutex): 24 * PluginProcess/PluginProcess.cpp: 25 (WebKit::PluginProcess::shared): 26 * PluginProcess/PluginProcess.h: 27 * PluginProcess/mac/PluginProcessMac.mm: 28 (WebKit::fullscreenWindowTracker): 29 * Shared/ConnectionStack.cpp: 30 (WebKit::ConnectionStack::shared): 31 * Shared/Plugins/Netscape/NetscapePluginModule.cpp: 32 (WebKit::initializedNetscapePluginModules): 33 * Shared/WebContextMenuItem.cpp: 34 (WebKit::WebContextMenuItem::separatorItem): 35 * Shared/WebPreferencesStore.cpp: 36 (WebKit::boolTestRunnerOverridesMap): 37 * Shared/mac/CookieStorageShim.cpp: 38 (WebKit::CookieStorageShim::shared): 39 * Shared/mac/CookieStorageShim.h: 40 (WebKit::CookieStorageShim::CookieStorageShim): 41 * UIProcess/Plugins/PluginProcessManager.cpp: 42 (WebKit::PluginProcessManager::shared): 43 * UIProcess/Plugins/PluginProcessManager.h: 44 * UIProcess/WebContext.cpp: 45 (WebKit::contexts): 46 * UIProcess/WebDatabaseManagerProxy.cpp: 47 (WebKit::WebDatabaseManagerProxy::originKey): 48 (WebKit::WebDatabaseManagerProxy::originQuotaKey): 49 (WebKit::WebDatabaseManagerProxy::originUsageKey): 50 (WebKit::WebDatabaseManagerProxy::databaseDetailsKey): 51 (WebKit::WebDatabaseManagerProxy::databaseDetailsNameKey): 52 (WebKit::WebDatabaseManagerProxy::databaseDetailsDisplayNameKey): 53 (WebKit::WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey): 54 (WebKit::WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey): 55 * UIProcess/WebInspectorProxy.cpp: 56 (WebKit::WebInspectorPageGroups::shared): 57 * UIProcess/WebPageGroup.cpp: 58 (WebKit::webPageGroupMap): 59 * UIProcess/WebPageProxy.cpp: 60 (WebKit::ExceededDatabaseQuotaRecords::shared): 61 (WebKit::WebPageProxy::executeEditCommand): 62 * UIProcess/WebProcessProxy.cpp: 63 (WebKit::globalPageMap): 64 * UIProcess/cf/WebBackForwardListCF.cpp: 65 (WebKit::SessionHistoryCurrentVersion): 66 (WebKit::createEmptySessionHistoryDictionary): 67 (WebKit::WebBackForwardList::createCFDictionaryRepresentation): 68 (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation): 69 (WebKit::WebBackForwardList::restoreFromV0CFDictionaryRepresentation): 70 (WebKit::WebBackForwardList::restoreFromV1CFDictionaryRepresentation): 71 (WebKit::extractBackForwardListEntriesFromArray): 72 * UIProcess/cf/WebPageProxyCF.cpp: 73 (WebKit::WebPageProxy::sessionStateData): 74 (WebKit::WebPageProxy::restoreFromSessionStateData): 75 * UIProcess/mac/WebPageProxyMac.mm: 76 (WebKit::WebPageProxy::standardUserAgent): 77 * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp: 78 (WebKit::sharedDatabaseBackendMap): 79 * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: 80 (WebKit::generateServerConnectionIdentifier): 81 * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm: 82 (WebKit::WKDOMNodeCache): 83 (WebKit::WKDOMRangeCache): 84 * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: 85 (WebKit::domHandleCache): 86 * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: 87 (WebKit::domHandleCache): 88 * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp: 89 (WebKit::allExtensions): 90 * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: 91 (WebKit::allWorlds): 92 * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: 93 (WebKit::globalExceptionString): 94 * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: 95 (WebKit::windowMap): 96 * WebProcess/Storage/StorageNamespaceImpl.cpp: 97 (WebKit::localStorageNamespaceMap): 98 * WebProcess/WebCoreSupport/WebEditorClient.cpp: 99 (WebKit::WebEditorClient::didBeginEditing): 100 (WebKit::WebEditorClient::respondToChangedContents): 101 (WebKit::WebEditorClient::respondToChangedSelection): 102 (WebKit::WebEditorClient::didEndEditing): 103 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 104 (WebKit::WebFrameLoaderClient::shouldFallBack): 105 * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: 106 (WebKit::WebPlatformStrategies::initialize): 107 * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 108 * WebProcess/WebPage/WebBackForwardListProxy.cpp: 109 (WebKit::idToHistoryItemMap): 110 (WebKit::historyItemToIDMap): 111 * WebProcess/WebProcess.cpp: 112 (WebKit::WebProcess::downloadManager): 113 * WebProcess/WebProcess.h: 114 * config.h: 115 1 116 2013-12-23 Tim Horton <timothy_horton@apple.com> 2 117 -
trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
r160517 r161045 43 43 DatabaseProcess& DatabaseProcess::shared() 44 44 { 45 DEFINE_STATIC_LOCAL(DatabaseProcess, databaseProcess, ());45 static NeverDestroyed<DatabaseProcess> databaseProcess; 46 46 return databaseProcess; 47 47 } -
trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h
r160555 r161045 31 31 #include "ChildProcess.h" 32 32 #include "UniqueIDBDatabaseIdentifier.h" 33 #include <wtf/NeverDestroyed.h> 33 34 34 35 class WorkQueue; … … 44 45 class DatabaseProcess : public ChildProcess { 45 46 WTF_MAKE_NONCOPYABLE(DatabaseProcess); 47 friend NeverDestroyed<DatabaseProcess>; 46 48 public: 47 49 static DatabaseProcess& shared(); -
trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
r156688 r161045 32 32 #include <WebCore/BlobRegistryImpl.h> 33 33 #include <wtf/MainThread.h> 34 #include <wtf/NeverDestroyed.h> 34 35 35 36 using namespace WebCore; … … 40 41 { 41 42 ASSERT(isMainThread()); 42 DEFINE_STATIC_LOCAL(NetworkBlobRegistry, registry, ());43 static NeverDestroyed<NetworkBlobRegistry> registry; 43 44 return registry; 44 45 } -
trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp
r160308 r161045 58 58 NetworkProcess& NetworkProcess::shared() 59 59 { 60 DEFINE_STATIC_LOCAL(NetworkProcess, networkProcess, ());60 static NeverDestroyed<NetworkProcess> networkProcess; 61 61 return networkProcess; 62 62 } … … 89 89 DownloadManager& NetworkProcess::downloadManager() 90 90 { 91 DEFINE_STATIC_LOCAL(DownloadManager, downloadManager, (this));91 static NeverDestroyed<DownloadManager> downloadManager(this); 92 92 return downloadManager; 93 93 } -
trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h
r160487 r161045 35 35 #include "NetworkResourceLoadScheduler.h" 36 36 #include <wtf/Forward.h> 37 #include <wtf/NeverDestroyed.h> 37 38 38 39 namespace WebCore { … … 48 49 class NetworkProcess : public ChildProcess, private DownloadManager::Client { 49 50 WTF_MAKE_NONCOPYABLE(NetworkProcess); 51 friend NeverDestroyed<NetworkProcess>; 52 friend NeverDestroyed<DownloadManager>; 50 53 public: 51 54 static NetworkProcess& shared(); -
trunk/Source/WebKit2/NetworkProcess/NetworkProcessPlatformStrategies.cpp
r157700 r161045 28 28 29 29 #include <WebCore/BlobRegistryImpl.h> 30 #include <wtf/NeverDestroyed.h> 30 31 31 32 using namespace WebCore; … … 35 36 void NetworkProcessPlatformStrategies::initialize() 36 37 { 37 DEFINE_STATIC_LOCAL(NetworkProcessPlatformStrategies, platformStrategies, ());38 setPlatformStrategies(&platformStrategies );38 static NeverDestroyed<NetworkProcessPlatformStrategies> platformStrategies; 39 setPlatformStrategies(&platformStrategies.get()); 39 40 } 40 41 -
trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm
r157337 r161045 95 95 { 96 96 ASSERT(isMainThread()); 97 DEFINE_STATIC_LOCAL(String, base, ());97 static NeverDestroyed<String> base; 98 98 return base; 99 99 } -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp
r161007 r161045 29 29 #include <wtf/CurrentTime.h> 30 30 #include <wtf/HashSet.h> 31 #include <wtf/NeverDestroyed.h> 31 32 #include <wtf/RunLoop.h> 32 33 #include <wtf/text/WTFString.h> … … 64 65 static SyncMessageStateMap& syncMessageStateMap() 65 66 { 66 DEFINE_STATIC_LOCAL(SyncMessageStateMap, syncMessageStateMap, ());67 static NeverDestroyed<SyncMessageStateMap> syncMessageStateMap; 67 68 return syncMessageStateMap; 68 69 } … … 70 71 static Mutex& syncMessageStateMapMutex() 71 72 { 72 DEFINE_STATIC_LOCAL(Mutex, syncMessageStateMapMutex, ());73 static NeverDestroyed<Mutex> syncMessageStateMapMutex; 73 74 return syncMessageStateMapMutex; 74 75 } -
trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp
r160308 r161045 51 51 PluginProcess& PluginProcess::shared() 52 52 { 53 DEFINE_STATIC_LOCAL(PluginProcess, pluginProcess, ());53 static NeverDestroyed<PluginProcess> pluginProcess; 54 54 return pluginProcess; 55 55 } -
trunk/Source/WebKit2/PluginProcess/PluginProcess.h
r159001 r161045 31 31 #include "ChildProcess.h" 32 32 #include <wtf/Forward.h> 33 #include <wtf/NeverDestroyed.h> 33 34 #include <wtf/text/WTFString.h> 34 35 … … 41 42 class PluginProcess : public ChildProcess { 42 43 WTF_MAKE_NONCOPYABLE(PluginProcess); 44 friend NeverDestroyed<PluginProcess>; 43 45 public: 44 46 static PluginProcess& shared(); -
trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm
r159437 r161045 44 44 #import <sysexits.h> 45 45 #import <wtf/HashSet.h> 46 #import <wtf/NeverDestroyed.h> 46 47 47 48 using namespace WebCore; … … 128 129 static FullscreenWindowTracker& fullscreenWindowTracker() 129 130 { 130 DEFINE_STATIC_LOCAL(FullscreenWindowTracker, fullscreenWindowTracker, ());131 static NeverDestroyed<FullscreenWindowTracker> fullscreenWindowTracker; 131 132 return fullscreenWindowTracker; 132 133 } -
trunk/Source/WebKit2/Shared/ConnectionStack.cpp
r131861 r161045 27 27 #include "ConnectionStack.h" 28 28 29 #include <wtf/NeverDestroyed.h> 30 29 31 namespace WebKit { 30 32 31 33 ConnectionStack& ConnectionStack::shared() 32 34 { 33 DEFINE_STATIC_LOCAL(ConnectionStack, connectionStack, ()); 34 35 static NeverDestroyed<ConnectionStack> connectionStack; 35 36 return connectionStack; 36 37 } -
trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp
r159437 r161045 32 32 #include "NPRuntimeUtilities.h" 33 33 #include "NetscapeBrowserFuncs.h" 34 #include <wtf/NeverDestroyed.h> 34 35 #include <wtf/text/CString.h> 35 36 … … 38 39 static Vector<NetscapePluginModule*>& initializedNetscapePluginModules() 39 40 { 40 DEFINE_STATIC_LOCAL(Vector<NetscapePluginModule*>, initializedNetscapePluginModules, ());41 static NeverDestroyed<Vector<NetscapePluginModule*>> initializedNetscapePluginModules; 41 42 return initializedNetscapePluginModules; 42 43 } -
trunk/Source/WebKit2/Shared/WebContextMenuItem.cpp
r159269 r161045 32 32 #include "APIArray.h" 33 33 #include <WebCore/ContextMenuItem.h> 34 #include <wtf/NeverDestroyed.h> 34 35 35 36 namespace WebKit { … … 58 59 WebContextMenuItem* WebContextMenuItem::separatorItem() 59 60 { 60 DEFINE_STATIC_LOCAL(WebContextMenuItem*, separatorItem, (adoptRef(new WebContextMenuItem(WebContextMenuItemData(WebCore::SeparatorType, WebCore::ContextMenuItemTagNoAction, String(), true, false))).leakRef()));61 static WebContextMenuItem* separatorItem = new WebContextMenuItem(WebContextMenuItemData(WebCore::SeparatorType, WebCore::ContextMenuItemTagNoAction, String(), true, false)); 61 62 return separatorItem; 62 63 } -
trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp
r145961 r161045 30 30 #include "WebCoreArgumentCoders.h" 31 31 #include <WebCore/Settings.h> 32 #include <wtf/NeverDestroyed.h> 32 33 33 34 namespace WebKit { … … 38 39 const String& KeyLower##Key() \ 39 40 { \ 40 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral(#KeyUpper))); \41 static NeverDestroyed<String> key(ASCIILiteral(#KeyUpper)); \ 41 42 return key; \ 42 43 } … … 52 53 static BoolOverridesMap& boolTestRunnerOverridesMap() 53 54 { 54 DEFINE_STATIC_LOCAL(BoolOverridesMap, map, ());55 static NeverDestroyed<BoolOverridesMap> map; 55 56 return map; 56 57 } -
trunk/Source/WebKit2/Shared/mac/CookieStorageShim.cpp
r156550 r161045 59 59 CookieStorageShim& CookieStorageShim::shared() 60 60 { 61 DEFINE_STATIC_LOCAL(CookieStorageShim, storage, ());61 static NeverDestroyed<CookieStorageShim> storage; 62 62 return storage; 63 63 } -
trunk/Source/WebKit2/Shared/mac/CookieStorageShim.h
r149074 r161045 30 30 31 31 #include <wtf/Noncopyable.h> 32 #include <wtf/NeverDestroyed.h> 32 33 33 34 namespace WebKit { … … 35 36 class CookieStorageShim { 36 37 WTF_MAKE_NONCOPYABLE(CookieStorageShim); 38 friend NeverDestroyed<CookieStorageShim>; 37 39 public: 38 40 static CookieStorageShim& shared(); … … 41 43 42 44 private: 43 CookieStorageShim() { }; 45 CookieStorageShim() 46 { 47 } 44 48 }; 45 49 -
trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp
r156069 r161045 39 39 PluginProcessManager& PluginProcessManager::shared() 40 40 { 41 DEFINE_STATIC_LOCAL(PluginProcessManager, pluginProcessManager, ());41 static NeverDestroyed<PluginProcessManager> pluginProcessManager; 42 42 return pluginProcessManager; 43 43 } -
trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h
r156069 r161045 35 35 #include <wtf/Forward.h> 36 36 #include <wtf/HashSet.h> 37 #include <wtf/NeverDestroyed.h> 37 38 #include <wtf/Noncopyable.h> 38 39 #include <wtf/Vector.h> … … 51 52 class PluginProcessManager { 52 53 WTF_MAKE_NONCOPYABLE(PluginProcessManager); 54 friend NeverDestroyed<PluginProcessManager>; 53 55 public: 54 56 static PluginProcessManager& shared(); -
trunk/Source/WebKit2/UIProcess/WebContext.cpp
r160986 r161045 115 115 static Vector<WebContext*>& contexts() 116 116 { 117 DEFINE_STATIC_LOCAL(Vector<WebContext*>, contexts, ()); 118 117 static NeverDestroyed<Vector<WebContext*>> contexts; 119 118 return contexts; 120 119 } -
trunk/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
r160608 r161045 35 35 #include "WebDatabaseManagerProxyMessages.h" 36 36 #include "WebSecurityOrigin.h" 37 #include <wtf/NeverDestroyed.h> 37 38 38 39 using namespace WebCore; … … 47 48 String WebDatabaseManagerProxy::originKey() 48 49 { 49 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerOriginKey")));50 static NeverDestroyed<String> key(ASCIILiteral("WebDatabaseManagerOriginKey")); 50 51 return key; 51 52 } … … 53 54 String WebDatabaseManagerProxy::originQuotaKey() 54 55 { 55 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerOriginQuotaKey")));56 static NeverDestroyed<String> key(ASCIILiteral("WebDatabaseManagerOriginQuotaKey")); 56 57 return key; 57 58 } … … 59 60 String WebDatabaseManagerProxy::originUsageKey() 60 61 { 61 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerOriginUsageKey")));62 static NeverDestroyed<String> key(ASCIILiteral("WebDatabaseManagerOriginUsageKey")); 62 63 return key; 63 64 } … … 65 66 String WebDatabaseManagerProxy::databaseDetailsKey() 66 67 { 67 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsKey")));68 static NeverDestroyed<String> key(ASCIILiteral("WebDatabaseManagerDatabaseDetailsKey")); 68 69 return key; 69 70 } … … 71 72 String WebDatabaseManagerProxy::databaseDetailsNameKey() 72 73 { 73 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsNameKey")));74 static NeverDestroyed<String> key(ASCIILiteral("WebDatabaseManagerDatabaseDetailsNameKey")); 74 75 return key; 75 76 } … … 77 78 String WebDatabaseManagerProxy::databaseDetailsDisplayNameKey() 78 79 { 79 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsDisplayNameKey")));80 static NeverDestroyed<String> key(ASCIILiteral("WebDatabaseManagerDatabaseDetailsDisplayNameKey")); 80 81 return key; 81 82 } … … 83 84 String WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey() 84 85 { 85 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsExpectedUsageKey")));86 static NeverDestroyed<String> key(ASCIILiteral("WebDatabaseManagerDatabaseDetailsExpectedUsageKey")); 86 87 return key; 87 88 } … … 89 90 String WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey() 90 91 { 91 DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsCurrentUsageKey")));92 static NeverDestroyed<String> key(ASCIILiteral("WebDatabaseManagerDatabaseDetailsCurrentUsageKey")); 92 93 return key; 93 94 } -
trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp
r160737 r161045 41 41 #include "WebProcessProxy.h" 42 42 #include <WebCore/SchemeRegistry.h> 43 #include <wtf/NeverDestroyed.h> 43 44 44 45 #if ENABLE(INSPECTOR_SERVER) … … 63 64 static WebInspectorPageGroups& shared() 64 65 { 65 DEFINE_STATIC_LOCAL(WebInspectorPageGroups, instance, ());66 static NeverDestroyed<WebInspectorPageGroups> instance; 66 67 return instance; 67 68 } -
trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp
r160727 r161045 32 32 #include "WebPreferences.h" 33 33 #include <wtf/HashMap.h> 34 #include <wtf/NeverDestroyed.h> 34 35 #include <wtf/text/StringConcatenate.h> 35 36 … … 46 47 static WebPageGroupMap& webPageGroupMap() 47 48 { 48 DEFINE_STATIC_LOCAL(WebPageGroupMap, map, ());49 static NeverDestroyed<WebPageGroupMap> map; 49 50 return map; 50 51 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r161007 r161045 91 91 #include <WebCore/TextCheckerClient.h> 92 92 #include <WebCore/WindowFeatures.h> 93 #include <wtf/NeverDestroyed.h> 93 94 #include <stdio.h> 94 95 … … 130 131 class ExceededDatabaseQuotaRecords { 131 132 WTF_MAKE_NONCOPYABLE(ExceededDatabaseQuotaRecords); WTF_MAKE_FAST_ALLOCATED; 133 friend NeverDestroyed<ExceededDatabaseQuotaRecords>; 132 134 public: 133 135 struct Record { … … 164 166 ExceededDatabaseQuotaRecords& ExceededDatabaseQuotaRecords::shared() 165 167 { 166 DEFINE_STATIC_LOCAL(ExceededDatabaseQuotaRecords, records, ());168 static NeverDestroyed<ExceededDatabaseQuotaRecords> records; 167 169 return records; 168 170 } … … 1059 1061 void WebPageProxy::executeEditCommand(const String& commandName) 1060 1062 { 1061 if (!isValid()) 1062 return; 1063 1064 DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, (ASCIILiteral("ignoreSpelling"))); 1063 static NeverDestroyed<String> ignoreSpellingCommandName(ASCIILiteral("ignoreSpelling")); 1064 1065 if (!isValid()) 1066 return; 1067 1065 1068 if (commandName == ignoreSpellingCommandName) 1066 1069 ++m_pendingLearnOrIgnoreWordMessageCount; -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp
r160727 r161045 47 47 #include <WebCore/URL.h> 48 48 #include <stdio.h> 49 #include <wtf/NeverDestroyed.h> 49 50 #include <wtf/RunLoop.h> 50 51 #include <wtf/text/CString.h> … … 75 76 { 76 77 ASSERT(RunLoop::isMain()); 77 DEFINE_STATIC_LOCAL(WebProcessProxy::WebPageProxyMap, pageMap, ());78 static NeverDestroyed<WebProcessProxy::WebPageProxyMap> pageMap; 78 79 return pageMap; 79 80 } -
trunk/Source/WebKit2/UIProcess/cf/WebBackForwardListCF.cpp
r149255 r161045 28 28 29 29 #include "Logging.h" 30 #include <CoreFoundation/CoreFoundation.h> 31 #include <wtf/NeverDestroyed.h> 30 32 #include <wtf/RetainPtr.h> 31 #include <CoreFoundation/CoreFoundation.h>32 33 33 34 using namespace WebCore; … … 45 46 } 46 47 47 static CFIndex currentVersion = 1; 48 DEFINE_STATIC_GETTER(CFNumberRef, SessionHistoryCurrentVersion, (CFNumberCreate(0, kCFNumberCFIndexType, ¤tVersion))); 49 50 DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryVersionKey, (CFSTR("SessionHistoryVersion"))); 51 DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryCurrentIndexKey, (CFSTR("SessionHistoryCurrentIndex"))); 52 DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryEntriesKey, (CFSTR("SessionHistoryEntries"))); 53 DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryEntryTitleKey, (CFSTR("SessionHistoryEntryTitle"))); 54 DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryEntryURLKey, (CFSTR("SessionHistoryEntryURL"))); 55 DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryEntryOriginalURLKey, (CFSTR("SessionHistoryEntryOriginalURL"))); 56 DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryEntryDataKey, (CFSTR("SessionHistoryEntryData"))); 48 static CFNumberRef sessionHistoryCurrentVersion() 49 { 50 static CFIndex currentVersionAsCFIndex = 1; 51 return CFNumberCreate(0, kCFNumberCFIndexType, ¤tVersionAsCFIndex); 52 } 53 54 static CFStringRef sessionHistoryVersionKey = CFSTR("SessionHistoryVersion"); 55 static CFStringRef sessionHistoryCurrentIndexKey = CFSTR("SessionHistoryCurrentIndex"); 56 static CFStringRef sessionHistoryEntriesKey = CFSTR("SessionHistoryEntries"); 57 static CFStringRef sessionHistoryEntryTitleKey = CFSTR("SessionHistoryEntryTitle"); 58 static CFStringRef sessionHistoryEntryURLKey = CFSTR("SessionHistoryEntryURL"); 59 static CFStringRef sessionHistoryEntryOriginalURLKey = CFSTR("SessionHistoryEntryOriginalURL"); 60 static CFStringRef sessionHistoryEntryDataKey = CFSTR("SessionHistoryEntryData"); 57 61 58 62 static bool extractBackForwardListEntriesFromArray(CFArrayRef, BackForwardListItemVector&); … … 60 64 static CFDictionaryRef createEmptySessionHistoryDictionary() 61 65 { 62 static const void* keys[1] = { SessionHistoryVersionKey()};63 static const void* values[1] = { SessionHistoryCurrentVersion() };66 static const void* keys[1] = { sessionHistoryVersionKey }; 67 static const void* values[1] = { sessionHistoryCurrentVersion() }; 64 68 65 69 return CFDictionaryCreate(0, keys, values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); … … 106 110 RetainPtr<CFDataRef> entryData = adoptCF(CFDataCreate(kCFAllocatorDefault, m_entries[i]->backForwardData().data(), m_entries[i]->backForwardData().size())); 107 111 108 const void* keys[4] = { SessionHistoryEntryURLKey(), SessionHistoryEntryTitleKey(), SessionHistoryEntryOriginalURLKey(), SessionHistoryEntryDataKey()};112 const void* keys[4] = { sessionHistoryEntryURLKey, sessionHistoryEntryTitleKey, sessionHistoryEntryOriginalURLKey, sessionHistoryEntryDataKey }; 109 113 const void* values[4] = { url.get(), title.get(), originalURL.get(), entryData.get() }; 110 114 … … 131 135 if (hasCurrentIndex) { 132 136 RetainPtr<CFNumberRef> currentIndexNumber = adoptCF(CFNumberCreate(0, kCFNumberCFIndexType, ¤tIndex)); 133 const void* keys[3] = { SessionHistoryVersionKey(), SessionHistoryCurrentIndexKey(), SessionHistoryEntriesKey()};134 const void* values[3] = { SessionHistoryCurrentVersion(), currentIndexNumber.get(), entries.get() };137 const void* keys[3] = { sessionHistoryVersionKey, sessionHistoryCurrentIndexKey, sessionHistoryEntriesKey }; 138 const void* values[3] = { sessionHistoryCurrentVersion(), currentIndexNumber.get(), entries.get() }; 135 139 136 140 return CFDictionaryCreate(0, keys, values, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); … … 143 147 bool WebBackForwardList::restoreFromCFDictionaryRepresentation(CFDictionaryRef dictionary) 144 148 { 145 CFNumberRef cfVersion = (CFNumberRef)CFDictionaryGetValue(dictionary, SessionHistoryVersionKey());149 CFNumberRef cfVersion = (CFNumberRef)CFDictionaryGetValue(dictionary, sessionHistoryVersionKey); 146 150 if (!cfVersion) { 147 151 // v0 session history dictionaries did not contain versioning … … 169 173 bool WebBackForwardList::restoreFromV0CFDictionaryRepresentation(CFDictionaryRef dictionary) 170 174 { 171 CFNumberRef cfIndex = (CFNumberRef)CFDictionaryGetValue(dictionary, SessionHistoryCurrentIndexKey());175 CFNumberRef cfIndex = (CFNumberRef)CFDictionaryGetValue(dictionary, sessionHistoryCurrentIndexKey); 172 176 if (!cfIndex || CFGetTypeID(cfIndex) != CFNumberGetTypeID()) { 173 177 LOG(SessionState, "WebBackForwardList dictionary representation does not have a valid current index"); … … 186 190 } 187 191 188 CFArrayRef cfEntries = (CFArrayRef)CFDictionaryGetValue(dictionary, SessionHistoryEntriesKey());192 CFArrayRef cfEntries = (CFArrayRef)CFDictionaryGetValue(dictionary, sessionHistoryEntriesKey); 189 193 if (!cfEntries || CFGetTypeID(cfEntries) != CFArrayGetTypeID()) { 190 194 LOG(SessionState, "WebBackForwardList dictionary representation does not have a valid list of entries"); … … 223 227 bool WebBackForwardList::restoreFromV1CFDictionaryRepresentation(CFDictionaryRef dictionary) 224 228 { 225 CFNumberRef cfIndex = (CFNumberRef)CFDictionaryGetValue(dictionary, SessionHistoryCurrentIndexKey());229 CFNumberRef cfIndex = (CFNumberRef)CFDictionaryGetValue(dictionary, sessionHistoryCurrentIndexKey); 226 230 if (!cfIndex) { 227 231 // No current index means the dictionary represents an empty session. … … 249 253 } 250 254 251 CFArrayRef cfEntries = (CFArrayRef)CFDictionaryGetValue(dictionary, SessionHistoryEntriesKey());255 CFArrayRef cfEntries = (CFArrayRef)CFDictionaryGetValue(dictionary, sessionHistoryEntriesKey); 252 256 if (!cfEntries || CFGetTypeID(cfEntries) != CFArrayGetTypeID()) { 253 257 LOG(SessionState, "WebBackForwardList dictionary representation does not have a valid list of entries"); … … 288 292 } 289 293 290 CFStringRef entryURL = (CFStringRef)CFDictionaryGetValue(entryDictionary, SessionHistoryEntryURLKey());294 CFStringRef entryURL = (CFStringRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntryURLKey); 291 295 if (!entryURL || CFGetTypeID(entryURL) != CFStringGetTypeID()) { 292 296 LOG(SessionState, "WebBackForwardList entry at index %i does not have a valid URL", (int)i); … … 294 298 } 295 299 296 CFStringRef entryTitle = (CFStringRef)CFDictionaryGetValue(entryDictionary, SessionHistoryEntryTitleKey());300 CFStringRef entryTitle = (CFStringRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntryTitleKey); 297 301 if (!entryTitle || CFGetTypeID(entryTitle) != CFStringGetTypeID()) { 298 302 LOG(SessionState, "WebBackForwardList entry at index %i does not have a valid title", (int)i); … … 300 304 } 301 305 302 CFStringRef originalURL = (CFStringRef)CFDictionaryGetValue(entryDictionary, SessionHistoryEntryOriginalURLKey());306 CFStringRef originalURL = (CFStringRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntryOriginalURLKey); 303 307 if (!originalURL || CFGetTypeID(originalURL) != CFStringGetTypeID()) { 304 308 LOG(SessionState, "WebBackForwardList entry at index %i does not have a valid original URL", (int)i); … … 306 310 } 307 311 308 CFDataRef backForwardData = (CFDataRef)CFDictionaryGetValue(entryDictionary, SessionHistoryEntryDataKey());312 CFDataRef backForwardData = (CFDataRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntryDataKey); 309 313 if (!backForwardData || CFGetTypeID(backForwardData) != CFDataGetTypeID()) { 310 314 LOG(SessionState, "WebBackForwardList entry at index %i does not have back/forward data", (int)i); -
trunk/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp
r160653 r161045 42 42 namespace WebKit { 43 43 44 DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryKey, (CFSTR("SessionHistory")));45 DEFINE_STATIC_GETTER(CFStringRef, ProvisionalURLKey, (CFSTR("ProvisionalURL")));44 static CFStringRef sessionHistoryKey = CFSTR("SessionHistory"); 45 static CFStringRef provisionalURLKey = CFSTR("ProvisionalURL"); 46 46 47 47 static const UInt32 CurrentSessionStateDataVersion = 2; … … 55 55 RetainPtr<CFDictionaryRef> sessionHistoryDictionary = adoptCF(m_backForwardList->createCFDictionaryRepresentation(filter, context)); 56 56 if (sessionHistoryDictionary) { 57 keys[numValues] = SessionHistoryKey();57 keys[numValues] = sessionHistoryKey; 58 58 values[numValues] = sessionHistoryDictionary.get(); 59 59 ++numValues; … … 67 67 if (!provisionalURL.isEmpty()) { 68 68 provisionalURLString = provisionalURL.createCFString(); 69 keys[numValues] = ProvisionalURLKey();69 keys[numValues] = provisionalURLKey; 70 70 values[numValues] = provisionalURLString.get(); 71 71 ++numValues; … … 137 137 138 138 CFDictionaryRef backForwardListDictionary = 0; 139 if (CFTypeRef value = CFDictionaryGetValue(static_cast<CFDictionaryRef>(propertyList.get()), SessionHistoryKey())) {139 if (CFTypeRef value = CFDictionaryGetValue(static_cast<CFDictionaryRef>(propertyList.get()), sessionHistoryKey)) { 140 140 if (CFGetTypeID(value) != CFDictionaryGetTypeID()) 141 141 LOG(SessionState, "SessionState dictionary has a SessionHistory key, but the value is not a dictionary"); … … 145 145 146 146 CFStringRef provisionalURL = 0; 147 if (CFTypeRef value = CFDictionaryGetValue(static_cast<CFDictionaryRef>(propertyList.get()), ProvisionalURLKey())) {147 if (CFTypeRef value = CFDictionaryGetValue(static_cast<CFDictionaryRef>(propertyList.get()), provisionalURLKey)) { 148 148 if (CFGetTypeID(value) != CFStringGetTypeID()) 149 149 LOG(SessionState, "SessionState dictionary has a ProvisionalValue key, but the value is not a string"); -
trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
r160412 r161045 48 48 #import <WebKitSystemInterface.h> 49 49 #import <mach-o/dyld.h> 50 #import <wtf/NeverDestroyed.h> 50 51 #import <wtf/text/StringConcatenate.h> 51 52 … … 106 107 String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent) 107 108 { 108 DEFINE_STATIC_LOCAL(String, osVersion, (systemMarketingVersionForUserAgentString()));109 DEFINE_STATIC_LOCAL(String, webKitVersion, (userVisibleWebKitVersionString()));109 static NeverDestroyed<String> osVersion(systemMarketingVersionForUserAgentString()); 110 static NeverDestroyed<String> webKitVersion(userVisibleWebKitVersionString()); 110 111 111 112 if (applicationNameForUserAgent.isEmpty()) 112 return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion , ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");113 return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion , ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);113 return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion.get(), ") AppleWebKit/", webKitVersion.get(), " (KHTML, like Gecko)"); 114 return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion.get(), ") AppleWebKit/", webKitVersion.get(), " (KHTML, like Gecko) ", applicationNameForUserAgent); 114 115 } 115 116 -
trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp
r159737 r161045 40 40 #include <WebCore/SecurityOrigin.h> 41 41 #include <wtf/MainThread.h> 42 #include <wtf/NeverDestroyed.h> 42 43 43 44 #if ENABLE(INDEXED_DATABASE) … … 52 53 static IDBDatabaseBackendMap& sharedDatabaseBackendMap() 53 54 { 54 DEFINE_STATIC_LOCAL(IDBDatabaseBackendMap, databaseBackendMap, ());55 static NeverDestroyed<IDBDatabaseBackendMap> databaseBackendMap; 55 56 return databaseBackendMap; 56 57 } -
trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp
r160732 r161045 37 37 #include "WebProcess.h" 38 38 #include "WebToDatabaseProcessConnection.h" 39 40 39 #include <WebCore/IDBDatabaseMetadata.h> 41 40 #include <WebCore/SecurityOrigin.h> … … 48 47 { 49 48 ASSERT(isMainThread()); 50 DEFINE_STATIC_LOCAL(uint64_t, identifier, (0));49 static uint64_t identifier = 0; 51 50 return ++identifier; 52 51 } -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm
r159760 r161045 34 34 #import <WebCore/Range.h> 35 35 #import <WebCore/Text.h> 36 #import <wtf/NeverDestroyed.h> 36 37 37 38 // Classes to instantiate. … … 49 50 DOMCache<WebCore::Node*, WKDOMNode *>& WKDOMNodeCache() 50 51 { 51 typedef DOMCache<WebCore::Node*, WKDOMNode *> Cache; 52 DEFINE_STATIC_LOCAL(Cache, cache, ()); 52 static NeverDestroyed<DOMCache<WebCore::Node*, WKDOMNode *>> cache; 53 53 return cache; 54 54 } … … 56 56 DOMCache<WebCore::Range*, WKDOMRange *>& WKDOMRangeCache() 57 57 { 58 typedef DOMCache<WebCore::Range*, WKDOMRange *> Cache; 59 DEFINE_STATIC_LOCAL(Cache, cache, ()); 58 static NeverDestroyed<DOMCache<WebCore::Range*, WKDOMRange *>> cache; 60 59 return cache; 61 60 } -
trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
r156688 r161045 49 49 #include <WebCore/RenderObject.h> 50 50 #include <wtf/HashMap.h> 51 #include <wtf/NeverDestroyed.h> 51 52 #include <wtf/text/WTFString.h> 52 53 … … 60 61 static DOMHandleCache& domHandleCache() 61 62 { 62 DEFINE_STATIC_LOCAL(DOMHandleCache, cache, ());63 static NeverDestroyed<DOMHandleCache> cache; 63 64 return cache; 64 65 } -
trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp
r155729 r161045 31 31 #include <WebCore/Range.h> 32 32 #include <wtf/HashMap.h> 33 #include <wtf/NeverDestroyed.h> 33 34 34 35 using namespace WebCore; … … 40 41 static DOMHandleCache& domHandleCache() 41 42 { 42 DEFINE_STATIC_LOCAL(DOMHandleCache, cache, ());43 static NeverDestroyed<DOMHandleCache> cache; 43 44 return cache; 44 45 } -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp
r154142 r161045 35 35 #include <WebCore/FrameLoader.h> 36 36 #include <wtf/HashMap.h> 37 #include <wtf/NeverDestroyed.h> 37 38 38 39 using namespace WebCore; … … 43 44 static ExtensionMap& allExtensions() 44 45 { 45 DEFINE_STATIC_LOCAL(ExtensionMap, map, ());46 static NeverDestroyed<ExtensionMap> map; 46 47 return map; 47 48 } -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp
r156769 r161045 30 30 #include <WebCore/ScriptController.h> 31 31 #include <wtf/HashMap.h> 32 #include <wtf/NeverDestroyed.h> 32 33 33 34 using namespace WebCore; … … 39 40 static WorldMap& allWorlds() 40 41 { 41 DEFINE_STATIC_LOCAL(WorldMap, map, ());42 static NeverDestroyed<WorldMap> map; 42 43 return map; 43 44 } -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
r160208 r161045 45 45 #include <WebCore/PageThrottler.h> 46 46 #include <WebCore/ScriptController.h> 47 #include <wtf/NeverDestroyed.h> 47 48 48 49 using namespace JSC; … … 259 260 static String& globalExceptionString() 260 261 { 261 DEFINE_STATIC_LOCAL(String, exceptionString, ());262 static NeverDestroyed<String> exceptionString; 262 263 return exceptionString; 263 264 } -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
r156598 r161045 37 37 #import <WebCore/NotImplemented.h> 38 38 #import <WebKitSystemInterface.h> 39 #import <wtf/NeverDestroyed.h> 39 40 40 41 using namespace WebCore; … … 197 198 static WindowMap& windowMap() 198 199 { 199 DEFINE_STATIC_LOCAL(WindowMap, windowMap, ()); 200 200 static NeverDestroyed<WindowMap windowMap; 201 201 return windowMap; 202 202 } -
trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp
r156056 r161045 36 36 #include <WebCore/SecurityOrigin.h> 37 37 #include <WebCore/Settings.h> 38 #include <wtf/NeverDestroyed.h> 38 39 39 40 using namespace WebCore; … … 45 46 static LocalStorageNamespaceMap& localStorageNamespaceMap() 46 47 { 47 DEFINE_STATIC_LOCAL(LocalStorageNamespaceMap, localStorageNamespaceMap, ());48 static NeverDestroyed<LocalStorageNamespaceMap> localStorageNamespaceMap; 48 49 return localStorageNamespaceMap; 49 50 } -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
r159856 r161045 51 51 #include <WebCore/UndoStep.h> 52 52 #include <WebCore/UserTypingGestureIndicator.h> 53 #include <wtf/NeverDestroyed.h> 53 54 54 55 using namespace WebCore; … … 171 172 { 172 173 // FIXME: What good is a notification name, if it's always the same? 173 DEFINE_STATIC_LOCAL(String, WebViewDidBeginEditingNotification, (ASCIILiteral("WebViewDidBeginEditingNotification")));174 m_page->injectedBundleEditorClient().didBeginEditing(m_page, WebViewDidBeginEditingNotification. impl());174 static NeverDestroyed<String> WebViewDidBeginEditingNotification(ASCIILiteral("WebViewDidBeginEditingNotification")); 175 m_page->injectedBundleEditorClient().didBeginEditing(m_page, WebViewDidBeginEditingNotification.get().impl()); 175 176 notImplemented(); 176 177 } … … 178 179 void WebEditorClient::respondToChangedContents() 179 180 { 180 DEFINE_STATIC_LOCAL(String, WebViewDidChangeNotification, (ASCIILiteral("WebViewDidChangeNotification")));181 m_page->injectedBundleEditorClient().didChange(m_page, WebViewDidChangeNotification. impl());181 static NeverDestroyed<String> WebViewDidChangeNotification(ASCIILiteral("WebViewDidChangeNotification")); 182 m_page->injectedBundleEditorClient().didChange(m_page, WebViewDidChangeNotification.get().impl()); 182 183 notImplemented(); 183 184 } … … 185 186 void WebEditorClient::respondToChangedSelection(Frame* frame) 186 187 { 187 DEFINE_STATIC_LOCAL(String, WebViewDidChangeSelectionNotification, (ASCIILiteral("WebViewDidChangeSelectionNotification")));188 m_page->injectedBundleEditorClient().didChangeSelection(m_page, WebViewDidChangeSelectionNotification. impl());188 static NeverDestroyed<String> WebViewDidChangeSelectionNotification(ASCIILiteral("WebViewDidChangeSelectionNotification")); 189 m_page->injectedBundleEditorClient().didChangeSelection(m_page, WebViewDidChangeSelectionNotification.get().impl()); 189 190 if (!frame) 190 191 return; … … 199 200 void WebEditorClient::didEndEditing() 200 201 { 201 DEFINE_STATIC_LOCAL(String, WebViewDidEndEditingNotification, (ASCIILiteral("WebViewDidEndEditingNotification")));202 m_page->injectedBundleEditorClient().didEndEditing(m_page, WebViewDidEndEditingNotification. impl());202 static NeverDestroyed<String> WebViewDidEndEditingNotification(ASCIILiteral("WebViewDidEndEditingNotification")); 203 m_page->injectedBundleEditorClient().didEndEditing(m_page, WebViewDidEndEditingNotification.get().impl()); 203 204 notImplemented(); 204 205 } -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r160866 r161045 79 79 #include <WebCore/Widget.h> 80 80 #include <WebCore/WindowFeatures.h> 81 #include <wtf/NeverDestroyed.h> 81 82 82 83 using namespace WebCore; … … 1074 1075 bool WebFrameLoaderClient::shouldFallBack(const ResourceError& error) 1075 1076 { 1076 DEFINE_STATIC_LOCAL(const ResourceError, cancelledError, (this->cancelledError(ResourceRequest())));1077 DEFINE_STATIC_LOCAL(const ResourceError, pluginWillHandleLoadError, (this->pluginWillHandleLoadError(ResourceResponse())));1078 1079 if (error.errorCode() == cancelledError. errorCode() && error.domain() == cancelledError.domain())1077 static NeverDestroyed<const ResourceError> cancelledError(this->cancelledError(ResourceRequest())); 1078 static NeverDestroyed<const ResourceError> pluginWillHandleLoadError(this->pluginWillHandleLoadError(ResourceResponse())); 1079 1080 if (error.errorCode() == cancelledError.get().errorCode() && error.domain() == cancelledError.get().domain()) 1080 1081 return false; 1081 1082 1082 if (error.errorCode() == pluginWillHandleLoadError. errorCode() && error.domain() == pluginWillHandleLoadError.domain())1083 if (error.errorCode() == pluginWillHandleLoadError.get().errorCode() && error.domain() == pluginWillHandleLoadError.get().domain()) 1083 1084 return false; 1084 1085 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
r159228 r161045 75 75 void WebPlatformStrategies::initialize() 76 76 { 77 DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ());78 setPlatformStrategies(&platformStrategies );77 static NeverDestroyed<WebPlatformStrategies> platformStrategies; 78 setPlatformStrategies(&platformStrategies.get()); 79 79 } 80 80 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
r158170 r161045 36 36 #include <WebCore/StorageStrategy.h> 37 37 #include <WebCore/VisitedLinkStrategy.h> 38 #include <wtf/NeverDestroyed.h> 38 39 39 40 namespace WebKit { 40 41 41 42 class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PasteboardStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy { 43 friend NeverDestroyed<WebPlatformStrategies>; 42 44 public: 43 45 static void initialize(); -
trunk/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
r158990 r161045 37 37 #include <WebCore/PageCache.h> 38 38 #include <wtf/HashMap.h> 39 #include <wtf/NeverDestroyed.h> 39 40 40 41 using namespace WebCore; … … 50 51 static IDToHistoryItemMap& idToHistoryItemMap() 51 52 { 52 DEFINE_STATIC_LOCAL(IDToHistoryItemMap, map, ());53 static NeverDestroyed<IDToHistoryItemMap> map;; 53 54 return map; 54 55 } … … 56 57 static HistoryItemToIDMap& historyItemToIDMap() 57 58 { 58 DEFINE_STATIC_LOCAL(HistoryItemToIDMap, map, ());59 static NeverDestroyed<HistoryItemToIDMap> map; 59 60 return map; 60 61 } -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r160378 r161045 473 473 #endif 474 474 475 DEFINE_STATIC_LOCAL(DownloadManager, downloadManager, (this));475 static NeverDestroyed<DownloadManager> downloadManager(this); 476 476 return downloadManager; 477 477 } -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r160986 r161045 41 41 #include <wtf/HashMap.h> 42 42 #include <wtf/HashSet.h> 43 #include <wtf/NeverDestroyed.h> 43 44 #include <wtf/text/AtomicString.h> 44 45 #include <wtf/text/AtomicStringHash.h> … … 85 86 86 87 class WebProcess : public ChildProcess, private DownloadManager::Client { 88 friend NeverDestroyed<DownloadManager>; 87 89 public: 88 90 static WebProcess& shared(); -
trunk/Source/WebKit2/config.h
r160549 r161045 48 48 #endif 49 49 50 // For defining getters to a static value, where the getters have internal linkage51 #define DEFINE_STATIC_GETTER(type, name, arguments) \52 static const type& name() \53 { \54 DEFINE_STATIC_LOCAL(type, name##Value, arguments); \55 return name##Value; \56 }57 58 50 #ifdef __cplusplus 59 51
Note: See TracChangeset
for help on using the changeset viewer.