HashMap<>::add should return a more descriptive object
https://bugs.webkit.org/show_bug.cgi?id=71063
Reviewed by Ryosuke Niwa.
Source/JavaScriptCore:
Update code to use AddResult instead of a pair. Note that since WeakGCMap wraps
the iterator type, there's a need for its own AddResult type -- instantiated from
HashTableAddResult template class.
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
(OpaqueJSClass::contextData):
- bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addVar):
(JSC::BytecodeGenerator::addGlobalVar):
(JSC::BytecodeGenerator::addConstant):
(JSC::BytecodeGenerator::addConstantValue):
(JSC::BytecodeGenerator::emitLoad):
(JSC::BytecodeGenerator::addStringConstant):
(JSC::BytecodeGenerator::emitLazyNewFunction):
- bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitBytecode):
- debugger/Debugger.cpp:
- dfg/DFGAssemblyHelpers.cpp:
(JSC::DFG::AssemblyHelpers::decodedCodeMapFor):
- dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::cellConstant):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
(JSC::JITThunks::ctiStub):
(JSC::JITThunks::hostFunctionStub):
(JSC::::parseStrictObjectLiteral):
(JSC::Scope::declareParameter):
(JSC::Identifier::add):
(JSC::Identifier::add8):
(JSC::Identifier::addSlowCase):
(JSC::Identifier::add):
(JSC::IdentifierTable::add):
(JSC::SparseArrayValueMap::add):
(JSC::SparseArrayValueMap::put):
(JSC::SparseArrayValueMap::putDirect):
(JSC::JSArray::enterDictionaryMode):
(JSC::JSArray::defineOwnNumericProperty):
(SparseArrayValueMap):
- runtime/PropertyNameArray.cpp:
(JSC::PropertyNameArray::add):
- runtime/StringRecursionChecker.h:
(JSC::StringRecursionChecker::performCheck):
(JSC::StructureTransitionTable::add):
(WeakGCMap):
(JSC::WeakGCMap::add):
(JSC::WeakGCMap::set):
(JSC::ProfileTreeNode::sampleChild):
Source/WebCore:
Update code to use AddResult instead of a pair. No new tests, just a refactoring.
- Modules/webdatabase/SQLTransactionCoordinator.cpp:
(WebCore::SQLTransactionCoordinator::acquireLock):
- Modules/webdatabase/chromium/QuotaTracker.cpp:
(WebCore::QuotaTracker::updateDatabaseSize):
- bindings/js/DOMObjectHashTableMap.h:
(WebCore::DOMObjectHashTableMap::get):
- bindings/js/JSDOMBinding.cpp:
(WebCore::cacheDOMStructure):
- bindings/js/JSDOMBinding.h:
(WebCore::cacheWrapper):
- bindings/js/JSDOMGlobalObject.h:
(WebCore::getDOMConstructor):
- bindings/js/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::addListener):
- bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::setBreakpoint):
- bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::startObjectInternal):
(WebCore::CloneSerializer::write):
- bindings/v8/NPV8Object.cpp:
(WebCore::npCreateV8ScriptObject):
- bridge/IdentifierRep.cpp:
(WebCore::IdentifierRep::get):
(ObjectMap::add):
- css/CSSComputedStyleDeclaration.cpp:
(WebCore::logUnimplementedPropertyID):
- css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData):
(WebCore::CSSFontSelector::addFontFaceRule):
(WebCore::CSSFontSelector::getFontData):
- css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::getFontData):
- css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyCounter::applyInheritValue):
(WebCore::ApplyPropertyCounter::applyValue):
- css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::appendAuthorStylesheets):
(WebCore::CSSStyleSelector::collectMatchingRulesForList):
(WebCore::CSSValuePool::createIdentifierValue):
(WebCore::CSSValuePool::createColorValue):
(WebCore::CSSValuePool::createValue):
(WebCore::CSSValuePool::createFontFamilyValue):
(WebCore::CSSValuePool::createFontFaceValue):
- dom/CheckedRadioButtons.cpp:
(WebCore::RadioButtonGroup::add):
(WebCore::CheckedRadioButtons::addButton):
- dom/ChildListMutationScope.cpp:
(WebCore::ChildListMutationScope::MutationAccumulationRouter::incrementScopingLevel):
(WebCore::Document::windowNamedItems):
(WebCore::Document::documentNamedItems):
(WebCore::Document::getCSSCanvasElement):
(WebCore::Document::getItems):
- dom/DocumentEventQueue.cpp:
(WebCore::DocumentEventQueue::enqueueEvent):
(WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
(WebCore::DocumentEventQueue::pendingEventTimerFired):
- dom/DocumentOrderedMap.cpp:
(WebCore::DocumentOrderedMap::add):
- dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::add):
(WebCore::Node::dumpStatistics):
(WebCore::Node::getElementsByTagName):
(WebCore::Node::getElementsByTagNameNS):
(WebCore::Node::getElementsByName):
(WebCore::Node::getElementsByClassName):
(WebCore::Node::collectMatchingObserversForMutation):
(WebCore::QualifiedName::init):
- dom/SpaceSplitString.cpp:
(WebCore::SpaceSplitStringData::create):
(WebCore::StyledElement::updateAttributeStyle):
(WebCore::HTMLCollection::append):
- inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::diff):
- inspector/InspectorCSSAgent.cpp:
(WebCore::SelectorProfile::commitSelector):
- inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::performSearch):
- inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::resolveBreakpoint):
- inspector/InspectorValues.h:
(WebCore::InspectorObject::setValue):
(WebCore::InspectorObject::setObject):
(WebCore::InspectorObject::setArray):
- loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::addEntry):
- loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
(WebCore::EventHandler::handleTouchEvent):
(WebCore::PageGroup::pageGroup):
(WebCore::PageGroup::addVisitedLink):
(WebCore::PageGroup::addUserScriptToWorld):
(WebCore::PageGroup::addUserStyleSheetToWorld):
(WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
- page/TouchAdjustment.cpp:
(WebCore::TouchAdjustment::compileSubtargetList):
- platform/cf/BinaryPropertyList.cpp:
(WebCore::BinaryPropertyListPlan::writeInteger):
(WebCore::BinaryPropertyListPlan::writeString):
(WebCore::BinaryPropertyListPlan::writeIntegerArray):
- platform/graphics/blackberry/LayerTiler.cpp:
(WebCore::LayerTiler::addTileJob):
- platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::findOrMakeClone):
- platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::revalidateTiles):
- platform/graphics/ca/win/LayerChangesFlusher.cpp:
(WebCore::LayerChangesFlusher::flushPendingLayerChangesSoon):
- platform/graphics/chromium/FontUtilsChromiumWin.cpp:
(WebCore::getDerivedFontData):
- platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
(WebCore::CCLayerAnimationController::startAnimationsWaitingForTargetAvailability):
- platform/graphics/mac/ComplexTextControllerATSUI.cpp:
(WebCore::initializeATSUStyle):
- platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::SimpleFontData::getCFStringAttributes):
- platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::canRenderCombiningCharacterSequence):
- platform/graphics/wince/FontPlatformData.cpp:
(WebCore::FixedSizeFontData::create):
- platform/gtk/RenderThemeGtk3.cpp:
(WebCore::getStyleContext):
- platform/mac/ThreadCheck.mm:
(WebCoreReportThreadViolation):
- platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::add):
- platform/network/HTTPHeaderMap.h:
(HTTPHeaderMap):
- platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::addHTTPHeaderField):
- plugins/PluginDatabase.cpp:
(WebCore::PluginDatabase::add):
(WebCore::PluginDatabase::loadPersistentMetadataCache):
- plugins/win/PluginDatabaseWin.cpp:
(WebCore::PluginDatabase::getPluginPathsInDirectories):
- rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addPercentHeightDescendant):
- rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):
- rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::addDependencyOnFlowThread):
- rendering/RenderRegion.cpp:
(WebCore::RenderRegion::setRenderBoxRegionInfo):
- rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
- rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::applyResource):
(WebCore::StorageMap::setItem):
(WebCore::StorageMap::importItem):
- svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::addPendingResource):
(WebCore::XMLHttpRequest::setRequestHeaderInternal):
(WebCore::XPath::FunId::evaluate):
(WebCore::XPath::LocationPath::evaluate):
(WebCore::XPath::Union::evaluate):
Source/WebKit/chromium:
Update code to use AddResult instead of a pair.
(WebKit::addHeader):
(WebKit::WebURLResponse::addHTTPHeaderField):
Source/WebKit/mac:
Update code to use AddResult instead of a pair.
- Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::hostForPlugin):
- Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyInstance::methodsNamed):
(WebKit::ProxyInstance::fieldNamed):
- WebCoreSupport/WebNotificationClient.mm:
(WebNotificationClient::show):
Source/WebKit/win:
Update code to use AddResult instead of a pair.
(classFactory):
Source/WebKit2:
Update code to use AddResult instead of a pair.
- Platform/CoreIPC/ArgumentCoders.h:
- Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::SyncMessageState::getOrCreate):
- Shared/MutableDictionary.cpp:
(WebKit::MutableDictionary::add):
(WebKit::MutableDictionary::set):
- Shared/UserMessageCoders.h:
(WebKit::UserMessageDecoder::baseDecode):
- Shared/mac/CommandLineMac.cpp:
(WebKit::CommandLine::parse):
- UIProcess/API/mac/WKPrintingView.mm:
(pageDidDrawToPDF):
- UIProcess/API/mac/WKView.mm:
(-[WKView validateUserInterfaceItem:]):
- UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addBackForwardItem):
- WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::getOrCreate):
- WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::getOrCreate):
- WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::show):
- WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::webPageGroup):
Source/WTF:
Make HashTable<>::add() and derivate functions return an AddResult struct instead
of a pair. This struct contains contains 'iterator' and 'isNewEntry' members, that are
more readable at callsites than previous 'first' and 'second'.
(HashCountedSet):
(WTF::::add):
(HashMap):
(WTF):
(WTF::::set):
(HashSet):
(WTF::::add):
(WTF):
(WTF::HashTableAddResult::HashTableAddResult):
(HashTableAddResult):
(WTF):
(HashTable):
(WTF::HashTable::add):
(WTF::::add):
(WTF::::addPassingHashCode):
(ListHashSet):
(WTF::::add):
(WTF::::insertBefore):
(WTF):
(WTF::::set):
(WTF::Spectrum::add):
(JSC::IdentifierTable::add):
(IdentifierTable):
- wtf/text/AtomicString.cpp:
(WTF::addToStringTable):
(WTF::AtomicString::addSlowCase):
Tools:
Update code to use AddResult instead of a pair.
- DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::evaluateScriptInIsolatedWorld):
- DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::evaluateScriptInIsolatedWorld):
- WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::evaluateScriptInIsolatedWorld):