Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
https://bugs.webkit.org/show_bug.cgi?id=140053

Patch by Brian J. Burg <burg@cs.washington.edu> on 2015-01-07
Reviewed by Andreas Kling.

Source/JavaScriptCore:

This patch replaces uses of PassRefPtr with uses of RefPtr&& and WTF::move() in code
related to Web Inspector. It also converts many uses of RefPtr to Ref where
references are always non-null. These two refactorings have been combined since
they tend to require similar changes to the code.

Creation methods for subclasses of InspectorValue now return a Ref, and callsites
have been updated to take a Ref instead of RefPtr.

Builders for typed protocol objects now return a Ref. Since there is no implicit
call to operator&, callsites now must explicitly call .release() to convert a
builder object into the corresponding protocol object once required fields are set.
Update callsites and use auto to eliminate repetition of longwinded protocol types.

Tests for inspector protocol and replay inputs have been rebaselined.

* bindings/ScriptValue.cpp:
(Deprecated::jsToInspectorValue):
(Deprecated::ScriptValue::toInspectorValue):
* bindings/ScriptValue.h:
* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::addToFrontend):
* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::buildObjectForSearchMatch):
(Inspector::ContentSearchUtilities::searchInTextByLines):
* inspector/ContentSearchUtilities.h:
* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::getFunctionDetails):
(Inspector::InjectedScript::getProperties):
(Inspector::InjectedScript::getInternalProperties):
(Inspector::InjectedScript::wrapCallFrames):
(Inspector::InjectedScript::wrapObject):
(Inspector::InjectedScript::wrapTable):
* inspector/InjectedScript.h:
* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeEvalCall): Split the early exits.
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::InspectorBackendDispatcher::CallbackBase::CallbackBase):
(Inspector::InspectorBackendDispatcher::CallbackBase::sendIfActive):
(Inspector::InspectorBackendDispatcher::create):
(Inspector::InspectorBackendDispatcher::dispatch):
(Inspector::InspectorBackendDispatcher::sendResponse):
(Inspector::InspectorBackendDispatcher::reportProtocolError):
(Inspector::getPropertyValue): Add a comment to clarify what this clever code does.
(Inspector::InspectorBackendDispatcher::getInteger):
(Inspector::InspectorBackendDispatcher::getDouble):
(Inspector::InspectorBackendDispatcher::getString):
(Inspector::InspectorBackendDispatcher::getBoolean):
(Inspector::InspectorBackendDispatcher::getObject):
(Inspector::InspectorBackendDispatcher::getArray):
(Inspector::InspectorBackendDispatcher::getValue):
* inspector/InspectorBackendDispatcher.h: Use a typed protocol object to collect
protocol error strings.
(Inspector::InspectorSupplementalBackendDispatcher::InspectorSupplementalBackendDispatcher):
Convert the supplemental dispatcher's reference to Ref since it is never null.
* inspector/InspectorEnvironment.h:
* inspector/InspectorProtocolTypes.h: Get rid of ArrayItemHelper and
StructItemTraits. Add more versions of addItem to handle pushing various types.
(Inspector::Protocol::Array::openAccessors):
(Inspector::Protocol::Array::addItem):
(Inspector::Protocol::Array::create):
(Inspector::Protocol::StructItemTraits::push):
(Inspector::Protocol::BindingTraits<Protocol::Array<T>>::runtimeCast): Assert argument.
(Inspector::Protocol::StructItemTraits::pushRefPtr): Deleted.
(Inspector::Protocol::ArrayItemHelper<String>::Traits::pushRaw): Deleted.
(Inspector::Protocol::ArrayItemHelper<int>::Traits::pushRaw): Deleted.
(Inspector::Protocol::ArrayItemHelper<double>::Traits::pushRaw): Deleted.
(Inspector::Protocol::ArrayItemHelper<bool>::Traits::pushRaw): Deleted.
(Inspector::Protocol::ArrayItemHelper<InspectorValue>::Traits::pushRefPtr): Deleted.
(Inspector::Protocol::ArrayItemHelper<InspectorObject>::Traits::pushRefPtr): Deleted.
(Inspector::Protocol::ArrayItemHelper<InspectorArray>::Traits::pushRefPtr): Deleted.
(Inspector::Protocol::ArrayItemHelper<Protocol::Array<T>>::Traits::pushRefPtr): Deleted.
* inspector/InspectorValues.cpp: Straighten out getArray and getObject to have
the same call signature as other getters. Use Ref where possible.
(Inspector::InspectorObjectBase::getBoolean):
(Inspector::InspectorObjectBase::getString):
(Inspector::InspectorObjectBase::getObject):
(Inspector::InspectorObjectBase::getArray):
(Inspector::InspectorObjectBase::getValue):
(Inspector::InspectorObjectBase::writeJSON):
(Inspector::InspectorArrayBase::get):
(Inspector::InspectorObject::create):
(Inspector::InspectorArray::create):
(Inspector::InspectorValue::null):
(Inspector::InspectorString::create):
(Inspector::InspectorBasicValue::create):
(Inspector::InspectorObjectBase::get): Deleted.
* inspector/InspectorValues.h:
(Inspector::InspectorObjectBase::setValue):
(Inspector::InspectorObjectBase::setObject):
(Inspector::InspectorObjectBase::setArray):
(Inspector::InspectorArrayBase::pushValue):
(Inspector::InspectorArrayBase::pushObject):
(Inspector::InspectorArrayBase::pushArray):
* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::messageWithTypeAndLevel):
(Inspector::JSGlobalObjectConsoleClient::count):
(Inspector::JSGlobalObjectConsoleClient::timeEnd):
(Inspector::JSGlobalObjectConsoleClient::timeStamp):
* inspector/JSGlobalObjectConsoleClient.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::executionStopwatch):
* inspector/JSGlobalObjectInspectorController.h:
* inspector/ScriptCallFrame.cpp:
(Inspector::ScriptCallFrame::buildInspectorObject):
* inspector/ScriptCallFrame.h:
* inspector/ScriptCallStack.cpp:
(Inspector::ScriptCallStack::create):
(Inspector::ScriptCallStack::buildInspectorArray):
* inspector/ScriptCallStack.h:
* inspector/agents/InspectorAgent.cpp:
(Inspector::InspectorAgent::enable):
(Inspector::InspectorAgent::inspect):
(Inspector::InspectorAgent::activateExtraDomain):
* inspector/agents/InspectorAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::handleConsoleAssert):
(Inspector::buildObjectForBreakpointCookie):
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
(Inspector::InspectorDebuggerAgent::setBreakpoint):
(Inspector::InspectorDebuggerAgent::continueToLocation):
(Inspector::InspectorDebuggerAgent::resolveBreakpoint):
(Inspector::InspectorDebuggerAgent::schedulePauseOnNextStatement):
(Inspector::InspectorDebuggerAgent::scriptExecutionBlockedByCSP):
(Inspector::InspectorDebuggerAgent::currentCallFrames):
(Inspector::InspectorDebuggerAgent::didParseSource):
(Inspector::InspectorDebuggerAgent::breakpointActionProbe):
(Inspector::InspectorDebuggerAgent::breakProgram):
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::buildErrorRangeObject):
(Inspector::InspectorRuntimeAgent::callFunctionOn):
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
(Inspector::InspectorRuntimeAgent::getBasicBlocks):
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator.cpp_type_for_unchecked_formal_in_parameter):
(CppGenerator.cpp_type_for_type_with_name):
(CppGenerator.cpp_type_for_formal_async_parameter):
(CppGenerator.should_use_references_for_type):
(CppGenerator):
* inspector/scripts/codegen/cpp_generator_templates.py:
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:
(CppBackendDispatcherHeaderGenerator.generate_output):
(CppBackendDispatcherHeaderGenerator._generate_async_handler_declaration_for_command):
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator._generate_small_dispatcher_switch_implementation_for_domain):
(CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:
(CppFrontendDispatcherHeaderGenerator.generate_output):
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:
(CppFrontendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_event):
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(CppProtocolTypesHeaderGenerator.generate_output):
(_generate_class_for_object_declaration):
(_generate_unchecked_setter_for_member):
(_generate_forward_declarations_for_binding_traits):
* inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:
(ObjCConfigurationImplementationGenerator._generate_success_block_for_command):
* inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py:
(ObjCFrontendDispatcherImplementationGenerator._generate_event):
(ObjCFrontendDispatcherImplementationGenerator._generate_event_out_parameters):
* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
(ObjCProtocolTypesImplementationGenerator.generate_output):
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
* replay/EncodedValue.cpp:
(JSC::EncodedValue::asObject):
(JSC::EncodedValue::asArray):
(JSC::EncodedValue::put<EncodedValue>):
(JSC::EncodedValue::append<EncodedValue>):
(JSC::EncodedValue::get<EncodedValue>):
* replay/EncodedValue.h:
* replay/scripts/CodeGeneratorReplayInputs.py:
(Type.borrow_type):
(Type.argument_type):
(Generator.generate_member_move_expression):
* runtime/ConsoleClient.cpp:
(JSC::ConsoleClient::printConsoleMessageWithArguments):
(JSC::ConsoleClient::internalMessageWithTypeAndLevel):
(JSC::ConsoleClient::logWithLevel):
(JSC::ConsoleClient::clear):
(JSC::ConsoleClient::dir):
(JSC::ConsoleClient::dirXML):
(JSC::ConsoleClient::table):
(JSC::ConsoleClient::trace):
(JSC::ConsoleClient::assertCondition):
(JSC::ConsoleClient::group):
(JSC::ConsoleClient::groupCollapsed):
(JSC::ConsoleClient::groupEnd):
* runtime/ConsoleClient.h:
* runtime/TypeSet.cpp:
(JSC::TypeSet::allStructureRepresentations):
(JSC::TypeSet::inspectorTypeSet):
(JSC::StructureShape::inspectorRepresentation):
* runtime/TypeSet.h:

Source/WebCore:

This patch replaces uses of PassRefPtr with uses of RefPtr&& and WTF::move() in code
related to Web Inspector. It also converts many uses of RefPtr to Ref where
references are always non-null. These two refactorings have been combined since
they tend to require similar changes to the code.

No new tests, no behavior changed.

* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabase):
* dom/Document.cpp:
(WebCore::Document::logExceptionToConsole):
(WebCore::Document::addMessage):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::reportException):
* dom/ScriptExecutionContext.h:
* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSAuditorDelegate::generateViolationReport):
* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::inspectImpl):
* inspector/CommandLineAPIHost.h:
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache):
(WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource):
* inspector/InspectorApplicationCacheAgent.h:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::getComputedStyleForNode):
(WebCore::InspectorCSSAgent::setStyleText):
(WebCore::InspectorCSSAgent::setPropertyText):
(WebCore::InspectorCSSAgent::toggleProperty):
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::getNamedFlowCollection):
(WebCore::InspectorCSSAgent::detectOrigin):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
(WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
(WebCore::InspectorCSSAgent::buildArrayForRegions):
(WebCore::InspectorCSSAgent::buildObjectForNamedFlow):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorConsoleInstrumentation.h:
(WebCore::InspectorInstrumentation::addMessageToConsole):
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::consoleTimeStamp):
(WebCore::InspectorInstrumentation::stopProfiling):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::buildObjectForHighlightedNode):
(WebCore::InspectorController::executionStopwatch):
* inspector/InspectorController.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::parseColor):
(WebCore::parseConfigColor):
(WebCore::InspectorDOMAgent::pushNodePathToFrontend):
(WebCore::InspectorDOMAgent::performSearch):
(WebCore::InspectorDOMAgent::setInspectModeEnabled):
(WebCore::InspectorDOMAgent::highlightRect):
(WebCore::InspectorDOMAgent::highlightQuad):
(WebCore::InspectorDOMAgent::innerHighlightQuad):
(WebCore::InspectorDOMAgent::highlightNode):
(WebCore::InspectorDOMAgent::highlightFrame):
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
(WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
(WebCore::InspectorDOMAgent::processAccessibilityChildren):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
(WebCore::InspectorDOMAgent::didCommitLoad):
(WebCore::InspectorDOMAgent::didInsertDOMNode):
(WebCore::InspectorDOMAgent::styleAttributeInvalidated):
(WebCore::InspectorDOMAgent::resolveNode):
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
(WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
(WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
(WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
(WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::storageId):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorDatabaseAgent.cpp: Use Ref for all callbacks since they are
not nullable.
(WebCore::InspectorDatabaseAgent::executeSQL):
* inspector/InspectorDatabaseAgent.h:
* inspector/InspectorDatabaseInstrumentation.h:
(WebCore::InspectorInstrumentation::didOpenDatabase):
* inspector/InspectorDatabaseResource.cpp:
(WebCore::InspectorDatabaseResource::create):
(WebCore::InspectorDatabaseResource::InspectorDatabaseResource):
(WebCore::InspectorDatabaseResource::bind):
* inspector/InspectorDatabaseResource.h:
(WebCore::InspectorDatabaseResource::setDatabase):
* inspector/InspectorFrontendHost.h:
(WebCore::InspectorFrontendHost::create):
* inspector/InspectorIndexedDBAgent.cpp: Use Ref for all callbacks since they are
not nullable.
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
(WebCore::InspectorIndexedDBAgent::requestDatabase):
(WebCore::InspectorIndexedDBAgent::requestData):
(WebCore::ClearObjectStoreListener::create):
(WebCore::ClearObjectStoreListener::ClearObjectStoreListener):
(WebCore::ClearObjectStore::create):
(WebCore::ClearObjectStore::ClearObjectStore):
(WebCore::InspectorIndexedDBAgent::clearObjectStore):
* inspector/InspectorIndexedDBAgent.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willLoadXHRImpl):
(WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
(WebCore::InspectorInstrumentation::consoleCountImpl):
(WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
(WebCore::InspectorInstrumentation::consoleTimeStampImpl):
(WebCore::InspectorInstrumentation::stopProfilingImpl):
(WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
(WebCore::InspectorInstrumentation::sessionCreatedImpl):
(WebCore::InspectorInstrumentation::sessionLoadedImpl):
(WebCore::InspectorInstrumentation::sessionModifiedImpl):
(WebCore::InspectorInstrumentation::segmentCreatedImpl):
(WebCore::InspectorInstrumentation::segmentCompletedImpl):
(WebCore::InspectorInstrumentation::segmentLoadedImpl):
(WebCore::InspectorInstrumentation::willLoadXHRSynchronouslyImpl): Deleted.
(WebCore::InspectorInstrumentation::didLoadXHRSynchronouslyImpl): Deleted.
(WebCore::InspectorInstrumentation::startProfilingImpl): Deleted.
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl): Deleted.
(WebCore::InspectorInstrumentation::willEvaluateWorkerScript): Deleted.
(WebCore::InspectorInstrumentation::captureStoppedImpl): Deleted.
(WebCore::InspectorInstrumentation::playbackStartedImpl): Deleted.
(WebCore::InspectorInstrumentation::playbackPausedImpl): Deleted.
(WebCore::InspectorInstrumentation::playbackHitPositionImpl): Deleted.
(WebCore::InspectorInstrumentation::playbackFinishedImpl): Deleted.
(WebCore::InspectorInstrumentation::networkStateChangedImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willLoadXHR):
(WebCore::InspectorInstrumentation::sessionCreated):
(WebCore::InspectorInstrumentation::sessionLoaded):
(WebCore::InspectorInstrumentation::sessionModified):
(WebCore::InspectorInstrumentation::segmentCreated):
(WebCore::InspectorInstrumentation::segmentCompleted):
(WebCore::InspectorInstrumentation::segmentLoaded):
(WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient): Deleted.
(WebCore::InspectorInstrumentation::didSendWebSocketFrame): Deleted.
* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
(WebCore::InspectorLayerTreeAgent::buildObjectForIntRect):
(WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
* inspector/InspectorLayerTreeAgent.h:
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForPoint):
(WebCore::buildObjectForRect):
(WebCore::buildArrayForQuad):
(WebCore::buildObjectForHighlight):
(WebCore::buildObjectForRegionHighlight):
(WebCore::buildObjectForCSSRegionsHighlight):
(WebCore::buildObjectForSize):
(WebCore::buildObjectForCSSRegionContentClip):
(WebCore::InspectorOverlay::drawPaintRects):
(WebCore::buildObjectForRendererFragments):
(WebCore::buildObjectForShapeOutside):
(WebCore::buildObjectForElementInfo):
(WebCore::InspectorOverlay::buildObjectForHighlightedNode):
(WebCore::InspectorOverlay::reset):
(WebCore::InspectorOverlay::evaluateInOverlay):
* inspector/InspectorOverlay.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::createXHRTextDecoder):
(WebCore::buildObjectForCookie):
(WebCore::buildArrayForCookies):
(WebCore::buildObjectForSearchResult):
(WebCore::InspectorPageAgent::buildObjectForFrame):
(WebCore::InspectorPageAgent::buildObjectForFrameTree):
* inspector/InspectorPageAgent.h:
* inspector/InspectorReplayAgent.cpp:
(WebCore::buildInspectorObjectForPosition):
(WebCore::buildInspectorObjectForInput):
(WebCore::buildInspectorObjectForSession):
(WebCore::buildInspectorObjectForSegment):
(WebCore::InspectorReplayAgent::replayToPosition):
(WebCore::InspectorReplayAgent::getSessionData):
(WebCore::InspectorReplayAgent::getSegmentData):
* inspector/InspectorReplayAgent.h:
* inspector/InspectorResourceAgent.cpp:
(WebCore::buildObjectForHeaders):
(WebCore::buildObjectForTiming):
(WebCore::buildObjectForResourceRequest):
(WebCore::buildObjectForResourceResponse):
(WebCore::buildObjectForCachedResource):
(WebCore::InspectorResourceAgent::willLoadXHR):
(WebCore::InspectorResourceAgent::buildInitiatorObject):
(WebCore::InspectorResourceAgent::willSendWebSocketHandshakeRequest):
(WebCore::InspectorResourceAgent::didReceiveWebSocketHandshakeResponse):
(WebCore::InspectorResourceAgent::didReceiveWebSocketFrame):
(WebCore::InspectorResourceAgent::didSendWebSocketFrame):
(WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
(WebCore::InspectorResourceAgent::loadResource):
(WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): Deleted.
(WebCore::InspectorResourceAgent::didScheduleStyleRecalculation): Deleted.
(WebCore::InspectorResourceAgent::disable): Deleted.
(WebCore::InspectorResourceAgent::setCacheDisabled): Deleted.
* inspector/InspectorResourceAgent.h:
* inspector/InspectorStyleSheet.cpp:
(ParsedStyleSheet::ruleSourceDataAt):
(WebCore::buildSourceRangeObject):
(WebCore::buildMediaObject):
(WebCore::asCSSRuleList):
(WebCore::fillMediaListChain):
(WebCore::InspectorStyle::create):
(WebCore::InspectorStyle::InspectorStyle):
(WebCore::InspectorStyle::buildObjectForStyle):
(WebCore::InspectorStyle::buildArrayForComputedStyle):
(WebCore::InspectorStyle::styleWithProperties):
(WebCore::InspectorStyle::extractSourceData):
(WebCore::InspectorStyleSheet::create):
(WebCore::InspectorStyleSheet::InspectorStyleSheet):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo):
(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelector):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::InspectorStyleSheet::buildObjectForStyle):
(WebCore::InspectorStyleSheet::toggleProperty):
(WebCore::InspectorStyleSheet::inspectorStyleForId):
(WebCore::InspectorStyleSheet::rememberInspectorStyle):
(WebCore::InspectorStyleSheet::buildArrayForRuleList):
(WebCore::InspectorStyleSheet::collectFlatRules):
(WebCore::InspectorStyleSheetForInlineStyle::create):
(WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
(WebCore::InspectorStyleSheetForInlineStyle::inspectorStyleForId):
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorCSSId::InspectorCSSId):
(WebCore::InspectorCSSId::asProtocolValue):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::startFromConsole):
(WebCore::InspectorTimelineAgent::stopFromConsole):
(WebCore::InspectorTimelineAgent::addRecordToTimeline):
(WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
(WebCore::InspectorTimelineAgent::appendRecord):
(WebCore::InspectorTimelineAgent::sendEvent):
(WebCore::InspectorTimelineAgent::createRecordEntry):
(WebCore::InspectorTimelineAgent::pushCurrentRecord):
* inspector/InspectorTimelineAgent.h:
* inspector/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::sendMessageToWorker):
* inspector/InspectorWorkerAgent.h:
* inspector/NetworkResourcesData.cpp:
(WebCore::XHRReplayData::create):
(WebCore::XHRReplayData::XHRReplayData):
* inspector/NetworkResourcesData.h:
(WebCore::NetworkResourcesData::ResourceData::decoder):
(WebCore::NetworkResourcesData::ResourceData::setDecoder):
(WebCore::NetworkResourcesData::ResourceData::buffer):
(WebCore::NetworkResourcesData::ResourceData::setBuffer):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):
(WebCore::TimelineRecordFactory::createBackgroundRecord):
(WebCore::TimelineRecordFactory::createGCEventData):
(WebCore::TimelineRecordFactory::createFunctionCallData):
(WebCore::TimelineRecordFactory::createConsoleProfileData):
(WebCore::TimelineRecordFactory::createProbeSampleData):
(WebCore::TimelineRecordFactory::createEventDispatchData):
(WebCore::TimelineRecordFactory::createGenericTimerData):
(WebCore::TimelineRecordFactory::createTimerInstallData):
(WebCore::TimelineRecordFactory::createXHRReadyStateChangeData):
(WebCore::TimelineRecordFactory::createXHRLoadData):
(WebCore::TimelineRecordFactory::createEvaluateScriptData):
(WebCore::TimelineRecordFactory::createTimeStampData):
(WebCore::TimelineRecordFactory::createScheduleResourceRequestData):
(WebCore::TimelineRecordFactory::createResourceSendRequestData):
(WebCore::TimelineRecordFactory::createResourceReceiveResponseData):
(WebCore::TimelineRecordFactory::createResourceFinishData):
(WebCore::TimelineRecordFactory::createReceiveResourceData):
(WebCore::TimelineRecordFactory::createLayoutData):
(WebCore::TimelineRecordFactory::createDecodeImageData):
(WebCore::TimelineRecordFactory::createResizeImageData):
(WebCore::TimelineRecordFactory::createMarkData):
(WebCore::TimelineRecordFactory::createParseHTMLData):
(WebCore::TimelineRecordFactory::createAnimationFrameData):
(WebCore::createQuad):
(WebCore::TimelineRecordFactory::createPaintData):
(WebCore::buildInspectorObject):
(WebCore::buildProfileInspectorObject):
(WebCore::TimelineRecordFactory::appendProfile):
* inspector/TimelineRecordFactory.h:
(WebCore::TimelineRecordFactory::createWebSocketCreateData):
(WebCore::TimelineRecordFactory::createGenericWebSocketData):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::executionStopwatch):
* inspector/WorkerInspectorController.h:
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::addMessage):
(WebCore::PageConsoleClient::messageWithTypeAndLevel):
(WebCore::PageConsoleClient::count):
(WebCore::PageConsoleClient::profileEnd):
(WebCore::PageConsoleClient::timeEnd):
(WebCore::PageConsoleClient::timeStamp):
* page/PageConsoleClient.h:
* replay/ReplayController.cpp:
(WebCore::ReplayController::switchSession):
(WebCore::ReplayController::createSegment):
(WebCore::ReplayController::completeSegment):
(WebCore::ReplayController::loadSegmentAtIndex):
* replay/ReplayInputCreationMethods.cpp:
(WebCore::InitialNavigation::createFromPage):
* workers/SharedWorkerGlobalScope.cpp:
(WebCore::SharedWorkerGlobalScope::logExceptionToConsole):
* workers/SharedWorkerGlobalScope.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::logExceptionToConsole):
(WebCore::WorkerGlobalScope::addMessage):
(WebCore::WorkerGlobalScope::addMessageToWorkerConsole):
* workers/WorkerGlobalScope.h:

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: update symbol.

Source/WTF:

* wtf/Stopwatch.h:
(WTF::Stopwatch::create): Return a Ref.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@178060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/inspector/InspectorValues.h b/Source/JavaScriptCore/inspector/InspectorValues.h
index 296af7d..baffcb0b 100644
--- a/Source/JavaScriptCore/inspector/InspectorValues.h
+++ b/Source/JavaScriptCore/inspector/InspectorValues.h
@@ -32,7 +32,7 @@
 #ifndef InspectorValues_h
 #define InspectorValues_h
 
-#include <wtf/Forward.h>
+#include <wtf/Assertions.h>
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
@@ -54,7 +54,7 @@
         : m_type(Type::Null) { }
     virtual ~InspectorValue() { }
 
-    static PassRefPtr<InspectorValue> null();
+    static Ref<InspectorValue> null();
 
     enum class Type {
         Null = 0,
@@ -99,9 +99,9 @@
 class JS_EXPORT_PRIVATE InspectorBasicValue : public InspectorValue {
 public:
 
-    static PassRefPtr<InspectorBasicValue> create(bool);
-    static PassRefPtr<InspectorBasicValue> create(int);
-    static PassRefPtr<InspectorBasicValue> create(double);
+    static Ref<InspectorBasicValue> create(bool);
+    static Ref<InspectorBasicValue> create(int);
+    static Ref<InspectorBasicValue> create(double);
 
     virtual bool asBoolean(bool&) const override;
     // Numbers from the frontend are always parsed as doubles, so we allow
@@ -138,8 +138,8 @@
 
 class JS_EXPORT_PRIVATE InspectorString : public InspectorValue {
 public:
-    static PassRefPtr<InspectorString> create(const String&);
-    static PassRefPtr<InspectorString> create(const char*);
+    static Ref<InspectorString> create(const String&);
+    static Ref<InspectorString> create(const char*);
 
     virtual bool asString(String& output) const override;
 
@@ -177,9 +177,9 @@
     void setInteger(const String& name, int);
     void setDouble(const String& name, double);
     void setString(const String& name, const String&);
-    void setValue(const String& name, PassRefPtr<InspectorValue>);
-    void setObject(const String& name, PassRefPtr<InspectorObjectBase>);
-    void setArray(const String& name, PassRefPtr<InspectorArrayBase>);
+    void setValue(const String& name, RefPtr<InspectorValue>&&);
+    void setObject(const String& name, RefPtr<InspectorObjectBase>&&);
+    void setArray(const String& name, RefPtr<InspectorArrayBase>&&);
 
     iterator find(const String& name);
     const_iterator find(const String& name) const;
@@ -188,23 +188,25 @@
     bool getBoolean(const String& name, bool& output) const;
     template<class T> bool getDouble(const String& name, T& output) const
     {
-        RefPtr<InspectorValue> value = get(name);
-        if (!value)
+        RefPtr<InspectorValue> value;
+        if (!getValue(name, value))
             return false;
+
         return value->asDouble(output);
     }
     template<class T> bool getInteger(const String& name, T& output) const
     {
-        RefPtr<InspectorValue> value = get(name);
-        if (!value)
+        RefPtr<InspectorValue> value;
+        if (!getValue(name, value))
             return false;
+
         return value->asInteger(output);
     }
 
     bool getString(const String& name, String& output) const;
-    PassRefPtr<InspectorObject> getObject(const String& name) const;
-    PassRefPtr<InspectorArray> getArray(const String& name) const;
-    PassRefPtr<InspectorValue> get(const String& name) const;
+    bool getObject(const String& name, RefPtr<InspectorObject>&) const;
+    bool getArray(const String& name, RefPtr<InspectorArray>&) const;
+    bool getValue(const String& name, RefPtr<InspectorValue>&) const;
 
     void remove(const String& name);
 
@@ -227,7 +229,7 @@
 
 class InspectorObject : public InspectorObjectBase {
 public:
-    static JS_EXPORT_PRIVATE PassRefPtr<InspectorObject> create();
+    static JS_EXPORT_PRIVATE Ref<InspectorObject> create();
 
     using InspectorObjectBase::asObject;
 
@@ -246,7 +248,7 @@
     using InspectorObjectBase::getString;
     using InspectorObjectBase::getObject;
     using InspectorObjectBase::getArray;
-    using InspectorObjectBase::get;
+    using InspectorObjectBase::getValue;
 
     using InspectorObjectBase::remove;
 
@@ -273,11 +275,11 @@
     void pushInteger(int);
     void pushDouble(double);
     void pushString(const String&);
-    void pushValue(PassRefPtr<InspectorValue>);
-    void pushObject(PassRefPtr<InspectorObject>);
-    void pushArray(PassRefPtr<InspectorArray>);
+    void pushValue(RefPtr<InspectorValue>&&);
+    void pushObject(RefPtr<InspectorObjectBase>&&);
+    void pushArray(RefPtr<InspectorArrayBase>&&);
 
-    PassRefPtr<InspectorValue> get(size_t index);
+    RefPtr<InspectorValue> get(size_t index);
 
     virtual void writeJSON(StringBuilder& output) const override;
 
@@ -295,7 +297,7 @@
 
 class InspectorArray : public InspectorArrayBase {
 public:
-    static JS_EXPORT_PRIVATE PassRefPtr<InspectorArray> create();
+    static JS_EXPORT_PRIVATE Ref<InspectorArray> create();
 
     using InspectorArrayBase::asArray;
 
@@ -344,24 +346,24 @@
     setValue(name, InspectorString::create(value));
 }
 
-inline void InspectorObjectBase::setValue(const String& name, PassRefPtr<InspectorValue> value)
+inline void InspectorObjectBase::setValue(const String& name, RefPtr<InspectorValue>&& value)
 {
     ASSERT(value);
-    if (m_data.set(name, value).isNewEntry)
+    if (m_data.set(name, WTF::move(value)).isNewEntry)
         m_order.append(name);
 }
 
-inline void InspectorObjectBase::setObject(const String& name, PassRefPtr<InspectorObjectBase> value)
+inline void InspectorObjectBase::setObject(const String& name, RefPtr<InspectorObjectBase>&& value)
 {
     ASSERT(value);
-    if (m_data.set(name, value).isNewEntry)
+    if (m_data.set(name, WTF::move(value)).isNewEntry)
         m_order.append(name);
 }
 
-inline void InspectorObjectBase::setArray(const String& name, PassRefPtr<InspectorArrayBase> value)
+inline void InspectorObjectBase::setArray(const String& name, RefPtr<InspectorArrayBase>&& value)
 {
     ASSERT(value);
-    if (m_data.set(name, value).isNewEntry)
+    if (m_data.set(name, WTF::move(value)).isNewEntry)
         m_order.append(name);
 }
 
@@ -385,22 +387,22 @@
     m_data.append(InspectorString::create(value));
 }
 
-inline void InspectorArrayBase::pushValue(PassRefPtr<InspectorValue> value)
+inline void InspectorArrayBase::pushValue(RefPtr<InspectorValue>&& value)
 {
     ASSERT(value);
-    m_data.append(value);
+    m_data.append(WTF::move(value));
 }
 
-inline void InspectorArrayBase::pushObject(PassRefPtr<InspectorObject> value)
+inline void InspectorArrayBase::pushObject(RefPtr<InspectorObjectBase>&& value)
 {
     ASSERT(value);
-    m_data.append(value);
+    m_data.append(WTF::move(value));
 }
 
-inline void InspectorArrayBase::pushArray(PassRefPtr<InspectorArray> value)
+inline void InspectorArrayBase::pushArray(RefPtr<InspectorArrayBase>&& value)
 {
     ASSERT(value);
-    m_data.append(value);
+    m_data.append(WTF::move(value));
 }
 
 } // namespace Inspector