Commit b9b4add1 authored by andersca@apple.com's avatar andersca@apple.com

Use nullptr instead of 0 in calls to HashMap::add

https://bugs.webkit.org/show_bug.cgi?id=121322

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
(JSC::BytecodeGenerator::addStringConstant):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::cellConstant):

Source/WebCore:

* bridge/IdentifierRep.cpp:
(WebCore::IdentifierRep::get):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::getFontFace):
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::getFontData):
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFamilyValue):
(WebCore::CSSValuePool::createFontFaceValue):
* dom/ChildListMutationScope.cpp:
(WebCore::ChildListMutationAccumulator::getOrCreate):
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasElement):
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::addCacheWithAtomicName):
(WebCore::NodeListsNodeData::addCacheWithName):
(WebCore::NodeListsNodeData::addCacheWithQualifiedName):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
* page/PageGroup.cpp:
(WebCore::PageGroup::pageGroup):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::registerScrollbar):
* storage/StorageNamespaceImpl.cpp:
(WebCore::StorageNamespaceImpl::localStorageNamespace):

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::hostForPlugin):

Source/WebKit2:

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::SyncMessageState::getOrCreate):
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addBackForwardItem):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::getOrCreate):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::getOrCreate):
* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::webPageGroup):

Tools:

* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::evaluateScriptInIsolatedWorld):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::evaluateScriptInIsolatedWorld):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6dc0af44
2013-09-13 Anders Carlsson <andersca@apple.com>
Use nullptr instead of 0 in calls to HashMap::add
https://bugs.webkit.org/show_bug.cgi?id=121322
Reviewed by Sam Weinig.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
(JSC::BytecodeGenerator::addStringConstant):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::cellConstant):
2013-09-13 Oliver Hunt <oliver@apple.com>
Try to kill initialiser expression in for-in statements
......
......@@ -1096,7 +1096,7 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, double number)
RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, const Identifier& identifier)
{
JSString*& stringInMap = m_stringMap.add(identifier.impl(), 0).iterator->value;
JSString*& stringInMap = m_stringMap.add(identifier.impl(), nullptr).iterator->value;
if (!stringInMap)
stringInMap = jsOwnedString(vm(), identifier.string());
return emitLoad(dst, JSValue(stringInMap));
......@@ -1436,7 +1436,7 @@ unsigned BytecodeGenerator::addConstantBuffer(unsigned length)
JSString* BytecodeGenerator::addStringConstant(const Identifier& identifier)
{
JSString*& stringInMap = m_stringMap.add(identifier.impl(), 0).iterator->value;
JSString*& stringInMap = m_stringMap.add(identifier.impl(), nullptr).iterator->value;
if (!stringInMap) {
stringInMap = jsString(vm(), identifier.string());
addConstantValue(stringInMap);
......
......@@ -679,7 +679,7 @@ private:
Node* cellConstant(JSCell* cell)
{
HashMap<JSCell*, Node*>::AddResult result = m_cellConstantNodes.add(cell, 0);
HashMap<JSCell*, Node*>::AddResult result = m_cellConstantNodes.add(cell, nullptr);
if (result.isNewEntry)
result.iterator->value = addToGraph(WeakJSConstant, OpInfo(cell));
......
2013-09-13 Anders Carlsson <andersca@apple.com>
Use nullptr instead of 0 in calls to HashMap::add
https://bugs.webkit.org/show_bug.cgi?id=121322
Reviewed by Sam Weinig.
* bridge/IdentifierRep.cpp:
(WebCore::IdentifierRep::get):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::getFontFace):
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::getFontData):
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFamilyValue):
(WebCore::CSSValuePool::createFontFaceValue):
* dom/ChildListMutationScope.cpp:
(WebCore::ChildListMutationAccumulator::getOrCreate):
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasElement):
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::addCacheWithAtomicName):
(WebCore::NodeListsNodeData::addCacheWithName):
(WebCore::NodeListsNodeData::addCacheWithQualifiedName):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
* page/PageGroup.cpp:
(WebCore::PageGroup::pageGroup):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::registerScrollbar):
* storage/StorageNamespaceImpl.cpp:
(WebCore::StorageNamespaceImpl::localStorageNamespace):
2013-09-13 Sam Weinig <sam@webkit.org>
ContextMenuController should hold onto a Page&
......@@ -66,7 +66,7 @@ IdentifierRep* IdentifierRep::get(int intID)
return identifier;
}
IntIdentifierMap::AddResult result = intIdentifierMap().add(intID, 0);
IntIdentifierMap::AddResult result = intIdentifierMap().add(intID, nullptr);
if (result.isNewEntry) {
ASSERT(!result.iterator->value);
result.iterator->value = new IdentifierRep(intID);
......
......@@ -115,7 +115,7 @@ PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription&
unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 5 | fontDescription.widthVariant() << 3
| (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
RefPtr<SimpleFontData>& fontData = m_fontDataTable.add(hashKey, 0).iterator->value;
RefPtr<SimpleFontData>& fontData = m_fontDataTable.add(hashKey, nullptr).iterator->value;
if (fontData)
return fontData; // No release, because fontData is a reference to a RefPtr that is held in the m_fontDataTable.
......
......@@ -515,7 +515,7 @@ CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDe
FontTraitsMask traitsMask = fontDescription.traitsMask();
RefPtr<CSSSegmentedFontFace>& face = segmentedFontFaceCache->add(traitsMask, 0).iterator->value;
RefPtr<CSSSegmentedFontFace>& face = segmentedFontFaceCache->add(traitsMask, nullptr).iterator->value;
if (!face) {
face = CSSSegmentedFontFace::create(this);
......
......@@ -124,7 +124,7 @@ PassRefPtr<FontData> CSSSegmentedFontFace::getFontData(const FontDescription& fo
| fontDescription.widthVariant() << FontTraitsMaskWidth
| desiredTraitsMask;
RefPtr<SegmentedFontData>& fontData = m_fontDataTable.add(hashKey, 0).iterator->value;
RefPtr<SegmentedFontData>& fontData = m_fontDataTable.add(hashKey, nullptr).iterator->value;
if (fontData && fontData->numRanges())
return fontData; // No release, we have a reference to an object in the cache which should retain the ref count it has.
......
......@@ -119,7 +119,7 @@ PassRefPtr<CSSPrimitiveValue> CSSValuePool::createValue(double value, CSSPrimiti
PassRefPtr<CSSPrimitiveValue> CSSValuePool::createFontFamilyValue(const String& familyName)
{
RefPtr<CSSPrimitiveValue>& value = m_fontFamilyValueCache.add(familyName, 0).iterator->value;
RefPtr<CSSPrimitiveValue>& value = m_fontFamilyValueCache.add(familyName, nullptr).iterator->value;
if (!value)
value = CSSPrimitiveValue::create(familyName, CSSPrimitiveValue::CSS_STRING);
return value;
......@@ -132,7 +132,7 @@ PassRefPtr<CSSValueList> CSSValuePool::createFontFaceValue(const AtomicString& s
if (m_fontFaceValueCache.size() > maximumFontFaceCacheSize)
m_fontFaceValueCache.clear();
RefPtr<CSSValueList>& value = m_fontFaceValueCache.add(string, 0).iterator->value;
RefPtr<CSSValueList>& value = m_fontFaceValueCache.add(string, nullptr).iterator->value;
if (!value)
value = CSSParser::parseFontFaceValue(string);
return value;
......
......@@ -67,7 +67,7 @@ ChildListMutationAccumulator::~ChildListMutationAccumulator()
PassRefPtr<ChildListMutationAccumulator> ChildListMutationAccumulator::getOrCreate(Node* target)
{
AccumulatorMap::AddResult result = accumulatorMap().add(target, 0);
AccumulatorMap::AddResult result = accumulatorMap().add(target, nullptr);
RefPtr<ChildListMutationAccumulator> accumulator;
if (!result.isNewEntry)
accumulator = result.iterator->value;
......
......@@ -4732,7 +4732,7 @@ CanvasRenderingContext* Document::getCSSCanvasContext(const String& type, const
HTMLCanvasElement* Document::getCSSCanvasElement(const String& name)
{
RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, 0).iterator->value;
RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, nullptr).iterator->value;
if (!element)
element = HTMLCanvasElement::create(this);
return element.get();
......
......@@ -89,7 +89,7 @@ public:
template<typename T>
PassRefPtr<T> addCacheWithAtomicName(Node* node, CollectionType collectionType, const AtomicString& name)
{
NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(collectionType, name), 0);
NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(collectionType, name), nullptr);
if (!result.isNewEntry)
return static_cast<T*>(result.iterator->value);
......@@ -102,7 +102,7 @@ public:
template<typename T>
PassRefPtr<T> addCacheWithAtomicName(Node* node, CollectionType collectionType)
{
NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(collectionType, starAtom), 0);
NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(collectionType, starAtom), nullptr);
if (!result.isNewEntry)
return static_cast<T*>(result.iterator->value);
......@@ -120,7 +120,7 @@ public:
template<typename T>
PassRefPtr<T> addCacheWithName(Node* node, CollectionType collectionType, const String& name)
{
NodeListNameCacheMap::AddResult result = m_nameCaches.add(namedNodeListKey(collectionType, name), 0);
NodeListNameCacheMap::AddResult result = m_nameCaches.add(namedNodeListKey(collectionType, name), nullptr);
if (!result.isNewEntry)
return static_cast<T*>(result.iterator->value);
......@@ -132,7 +132,7 @@ public:
PassRefPtr<TagNodeList> addCacheWithQualifiedName(Node* node, const AtomicString& namespaceURI, const AtomicString& localName)
{
QualifiedName name(nullAtom, localName, namespaceURI);
TagNodeListCacheNS::AddResult result = m_tagNodeListCacheNS.add(name, 0);
TagNodeListCacheNS::AddResult result = m_tagNodeListCacheNS.add(name, nullptr);
if (!result.isNewEntry)
return result.iterator->value;
......
......@@ -139,7 +139,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::findOrCreateCacheGroup(const KUR
{
ASSERT(!manifestURL.hasFragmentIdentifier());
CacheGroupMap::AddResult result = m_cachesInMemory.add(manifestURL, 0);
CacheGroupMap::AddResult result = m_cachesInMemory.add(manifestURL, nullptr);
if (!result.isNewEntry) {
ASSERT(result.iterator->value);
......
......@@ -96,7 +96,7 @@ PageGroup* PageGroup::pageGroup(const String& groupName)
if (!pageGroups)
pageGroups = new PageGroupMap;
PageGroupMap::AddResult result = pageGroups->add(groupName, 0);
PageGroupMap::AddResult result = pageGroups->add(groupName, nullptr);
if (result.isNewEntry) {
ASSERT(!result.iterator->value);
......
......@@ -69,7 +69,7 @@ AnimationControllerPrivate::~AnimationControllerPrivate()
CompositeAnimation& AnimationControllerPrivate::ensureCompositeAnimation(RenderObject* renderer)
{
RenderObjectAnimationMap::AddResult result = m_compositeAnimations.add(renderer, 0);
RenderObjectAnimationMap::AddResult result = m_compositeAnimations.add(renderer, nullptr);
if (result.isNewEntry)
result.iterator->value = CompositeAnimation::create(this);
return *result.iterator->value;
......
......@@ -171,7 +171,7 @@ void ScrollbarThemeMac::registerScrollbar(ScrollbarThemeClient* scrollbar)
updateEnabledState(scrollbar);
updateScrollbarOverlayStyle(scrollbar);
} else {
scrollbarMap()->add(scrollbar, nil);
scrollbarMap()->add(scrollbar, nullptr);
}
}
......
......@@ -60,7 +60,7 @@ PassRefPtr<StorageNamespace> StorageNamespaceImpl::localStorageNamespace(PageGro
unsigned quota = pageGroup->groupSettings().localStorageQuotaBytes();
const String lookupPath = path.isNull() ? emptyString() : path;
LocalStorageNamespaceMap::AddResult result = localStorageNamespaceMap().add(lookupPath, 0);
LocalStorageNamespaceMap::AddResult result = localStorageNamespaceMap().add(lookupPath, nullptr);
if (!result.isNewEntry)
return result.iterator->value;
......
2013-09-13 Anders Carlsson <andersca@apple.com>
Use nullptr instead of 0 in calls to HashMap::add
https://bugs.webkit.org/show_bug.cgi?id=121322
Reviewed by Sam Weinig.
* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::hostForPlugin):
2013-09-13 Dan Bernstein <mitz@apple.com>
[mac WK1] Introduce WebViewWillCloseNotification
......
......@@ -68,7 +68,7 @@ NetscapePluginHostManager::~NetscapePluginHostManager()
NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier)
{
PluginHostMap::AddResult result = m_pluginHosts.add(pluginPath, 0);
PluginHostMap::AddResult result = m_pluginHosts.add(pluginPath, nullptr);
// The package was already in the map, just return it.
if (!result.isNewEntry)
......
2013-09-13 Anders Carlsson <andersca@apple.com>
Use nullptr instead of 0 in calls to HashMap::add
https://bugs.webkit.org/show_bug.cgi?id=121322
Reviewed by Sam Weinig.
* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::SyncMessageState::getOrCreate):
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addBackForwardItem):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::getOrCreate):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::getOrCreate):
* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::webPageGroup):
2013-09-13 Gustavo Noronha Silva <gustavo.noronha@collabora.com>
[GTK] Move to the new web inspector
......
......@@ -111,7 +111,7 @@ public:
PassRefPtr<Connection::SyncMessageState> Connection::SyncMessageState::getOrCreate(RunLoop* runLoop)
{
MutexLocker locker(syncMessageStateMapMutex());
SyncMessageStateMap::AddResult result = syncMessageStateMap().add(runLoop, 0);
SyncMessageStateMap::AddResult result = syncMessageStateMap().add(runLoop, nullptr);
if (!result.isNewEntry) {
ASSERT(result.iterator->value);
......
......@@ -442,7 +442,7 @@ void StorageManager::createLocalStorageMap(CoreIPC::Connection* connection, uint
// FIXME: This should be a message check.
ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair)));
HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, 0);
HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, nullptr);
// FIXME: These should be a message checks.
ASSERT(result.isNewEntry);
......@@ -475,7 +475,7 @@ void StorageManager::createSessionStorageMap(CoreIPC::Connection* connection, ui
// FIXME: This should be a message check.
ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair)));
HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, 0);
HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, nullptr);
// FIXME: This should be a message check.
ASSERT(result.isNewEntry);
......@@ -616,7 +616,7 @@ StorageManager::LocalStorageNamespace* StorageManager::getOrCreateLocalStorageNa
if (!HashMap<uint64_t, RefPtr<LocalStorageNamespace>>::isValidKey(storageNamespaceID))
return 0;
HashMap<uint64_t, RefPtr<LocalStorageNamespace>>::AddResult result = m_localStorageNamespaces.add(storageNamespaceID, 0);
HashMap<uint64_t, RefPtr<LocalStorageNamespace>>::AddResult result = m_localStorageNamespaces.add(storageNamespaceID, nullptr);
if (result.isNewEntry)
result.iterator->value = LocalStorageNamespace::create(this, storageNamespaceID);
......
......@@ -292,7 +292,7 @@ void WebProcessProxy::addBackForwardItem(uint64_t itemID, const String& original
MESSAGE_CHECK_URL(originalURL);
MESSAGE_CHECK_URL(url);
WebBackForwardListItemMap::AddResult result = m_backForwardListItemMap.add(itemID, 0);
WebBackForwardListItemMap::AddResult result = m_backForwardListItemMap.add(itemID, nullptr);
if (result.isNewEntry) {
result.iterator->value = WebBackForwardListItem::create(originalURL, url, title, backForwardData.data(), backForwardData.size(), itemID);
return;
......
......@@ -74,7 +74,7 @@ PassRefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::getOrCreate(Node*
if (!node)
return 0;
DOMHandleCache::AddResult result = domHandleCache().add(node, 0);
DOMHandleCache::AddResult result = domHandleCache().add(node, nullptr);
if (!result.isNewEntry)
return PassRefPtr<InjectedBundleNodeHandle>(result.iterator->value);
......
......@@ -54,7 +54,7 @@ PassRefPtr<InjectedBundleRangeHandle> InjectedBundleRangeHandle::getOrCreate(Ran
if (!range)
return 0;
DOMHandleCache::AddResult result = domHandleCache().add(range, 0);
DOMHandleCache::AddResult result = domHandleCache().add(range, nullptr);
if (!result.isNewEntry)
return PassRefPtr<InjectedBundleRangeHandle>(result.iterator->value);
......
......@@ -52,7 +52,7 @@ PassRefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createLocalStorageNamespa
{
uint64_t pageGroupID = WebProcess::shared().webPageGroup(pageGroup)->pageGroupID();
LocalStorageNamespaceMap::AddResult result = localStorageNamespaceMap().add(pageGroupID, 0);
LocalStorageNamespaceMap::AddResult result = localStorageNamespaceMap().add(pageGroupID, nullptr);
if (!result.isNewEntry)
return result.iterator->value;
......
......@@ -574,7 +574,7 @@ void WebProcess::createWebPage(uint64_t pageID, const WebPageCreationParameters&
{
// It is necessary to check for page existence here since during a window.open() (or targeted
// link) the WebPage gets created both in the synchronous handler and through the normal way.
HashMap<uint64_t, RefPtr<WebPage>>::AddResult result = m_pageMap.add(pageID, 0);
HashMap<uint64_t, RefPtr<WebPage>>::AddResult result = m_pageMap.add(pageID, nullptr);
if (result.isNewEntry) {
ASSERT(!result.iterator->value);
result.iterator->value = WebPage::create(pageID, parameters);
......@@ -726,7 +726,7 @@ WebPageGroupProxy* WebProcess::webPageGroup(uint64_t pageGroupID)
WebPageGroupProxy* WebProcess::webPageGroup(const WebPageGroupData& pageGroupData)
{
HashMap<uint64_t, RefPtr<WebPageGroupProxy>>::AddResult result = m_pageGroupMap.add(pageGroupData.pageGroupID, 0);
HashMap<uint64_t, RefPtr<WebPageGroupProxy>>::AddResult result = m_pageGroupMap.add(pageGroupData.pageGroupID, nullptr);
if (result.isNewEntry) {
ASSERT(!result.iterator->value);
result.iterator->value = WebPageGroupProxy::create(pageGroupData);
......
2013-09-13 Anders Carlsson <andersca@apple.com>
Use nullptr instead of 0 in calls to HashMap::add
https://bugs.webkit.org/show_bug.cgi?id=121322
Reviewed by Sam Weinig.
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::evaluateScriptInIsolatedWorld):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::evaluateScriptInIsolatedWorld):
2013-09-13 Gustavo Noronha Silva <gustavo.noronha@collabora.com>
[GTK] Move to the new web inspector
......
......@@ -844,7 +844,7 @@ void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef glo
if (!worldID)
world = [WebScriptWorld world];
else {
RetainPtr<WebScriptWorld>& worldSlot = worldMap().add(worldID, 0).iterator->value;
RetainPtr<WebScriptWorld>& worldSlot = worldMap().add(worldID, nullptr).iterator->value;
if (!worldSlot)
worldSlot = adoptNS([[WebScriptWorld alloc] init]);
world = worldSlot.get();
......
......@@ -449,7 +449,7 @@ void TestRunner::evaluateScriptInIsolatedWorld(JSContextRef context, unsigned wo
if (!worldID)
world.adopt(WKBundleScriptWorldCreateWorld());
else {
WKRetainPtr<WKBundleScriptWorldRef>& worldSlot = worldMap().add(worldID, 0).iterator->value;
WKRetainPtr<WKBundleScriptWorldRef>& worldSlot = worldMap().add(worldID, nullptr).iterator->value;
if (!worldSlot)
worldSlot.adopt(WKBundleScriptWorldCreateWorld());
world = worldSlot;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment