2012-01-26 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+ WebPreferencesStore: use DEFINE_STATIC_LOCAL for overrides HashMap
+ https://bugs.webkit.org/show_bug.cgi?id=77109
+
+ Reviewed by Andreas Kling.
+
+ Fix build for Clang.
+
+ * Shared/WebPreferencesStore.cpp:
+ (WebKit):
+ (WebKit::boolTestRunnerOverridesMap):
+ (WebKit::WebPreferencesStore::overrideBoolValueForKey):
+ (WebKit::WebPreferencesStore::removeTestRunnerOverrides):
+ (WebKit::WebPreferencesStore::getBoolValueForKey):
+
+2012-01-26 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
Implement overridePreference for boolean preferences in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=77033
} // namespace WebPreferencesKey
+typedef HashMap<String, bool> BoolOverridesMap;
-static HashMap<String, bool> boolTestRunnerOverridesMap;
+static BoolOverridesMap& boolTestRunnerOverridesMap()
+{
+ DEFINE_STATIC_LOCAL(BoolOverridesMap, map, ());
+ return map;
+}
WebPreferencesStore::WebPreferencesStore()
{
void WebPreferencesStore::overrideBoolValueForKey(const String& key, bool value)
{
- boolTestRunnerOverridesMap.set(key, value);
+ boolTestRunnerOverridesMap().set(key, value);
}
void WebPreferencesStore::removeTestRunnerOverrides()
{
- boolTestRunnerOverridesMap.clear();
+ boolTestRunnerOverridesMap().clear();
}
bool WebPreferencesStore::getBoolValueForKey(const String& key) const
{
// FIXME: Extend overriding to other key types used from LayoutTestController.
- HashMap<String, bool>::const_iterator it = boolTestRunnerOverridesMap.find(key);
- if (it != boolTestRunnerOverridesMap.end())
+ BoolOverridesMap::const_iterator it = boolTestRunnerOverridesMap().find(key);
+ if (it != boolTestRunnerOverridesMap().end())
return it->second;
return valueForKey(m_boolValues, key);
}