Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 00:43:32 +0000 (00:43 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 00:43:32 +0000 (00:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173793

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-11-14
Reviewed by Brian Burg.

Source/JavaScriptCore:

Based on patch by Brian Burg.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bindings/ScriptValue.cpp:
(Inspector::jsToInspectorValue):
(Inspector::toInspectorValue):
(Deprecated::ScriptValue::toInspectorValue const):
* bindings/ScriptValue.h:
* inspector/AsyncStackTrace.cpp:
* inspector/ConsoleMessage.cpp:
* inspector/ContentSearchUtilities.cpp:
* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::getFunctionDetails):
(Inspector::InjectedScript::functionDetails):
(Inspector::InjectedScript::getPreview):
(Inspector::InjectedScript::getProperties):
(Inspector::InjectedScript::getDisplayableProperties):
(Inspector::InjectedScript::getInternalProperties):
(Inspector::InjectedScript::getCollectionEntries):
(Inspector::InjectedScript::saveResult):
(Inspector::InjectedScript::wrapCallFrames const):
(Inspector::InjectedScript::wrapObject const):
(Inspector::InjectedScript::wrapTable const):
(Inspector::InjectedScript::previewValue const):
(Inspector::InjectedScript::setExceptionValue):
(Inspector::InjectedScript::clearExceptionValue):
(Inspector::InjectedScript::inspectObject):
(Inspector::InjectedScript::releaseObject):
* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeCall):
(Inspector::InjectedScriptBase::makeEvalCall):
* inspector/InjectedScriptBase.h:
* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::injectedScriptForObjectId):
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::CallbackBase::sendSuccess):
(Inspector::BackendDispatcher::dispatch):
(Inspector::BackendDispatcher::sendResponse):
(Inspector::BackendDispatcher::sendPendingErrors):
(Inspector::BackendDispatcher::getPropertyValue):
(Inspector::castToInteger):
(Inspector::castToNumber):
(Inspector::BackendDispatcher::getInteger):
(Inspector::BackendDispatcher::getDouble):
(Inspector::BackendDispatcher::getString):
(Inspector::BackendDispatcher::getBoolean):
(Inspector::BackendDispatcher::getObject):
(Inspector::BackendDispatcher::getArray):
(Inspector::BackendDispatcher::getValue):
* inspector/InspectorBackendDispatcher.h:
* inspector/InspectorProtocolTypes.h:
(Inspector::Protocol::Array::openAccessors):
(Inspector::Protocol::PrimitiveBindingTraits::assertValueHasExpectedType):
(Inspector::Protocol::BindingTraits<Protocol::Array<T>>::runtimeCast):
(Inspector::Protocol::BindingTraits<Protocol::Array<T>>::assertValueHasExpectedType):
(Inspector::Protocol::BindingTraits<JSON::Value>::assertValueHasExpectedType):
* inspector/ScriptCallFrame.cpp:
* inspector/ScriptCallStack.cpp:
* inspector/agents/InspectorAgent.cpp:
(Inspector::InspectorAgent::inspect):
* inspector/agents/InspectorAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::buildAssertPauseReason):
(Inspector::buildCSPViolationPauseReason):
(Inspector::InspectorDebuggerAgent::buildBreakpointPauseReason):
(Inspector::InspectorDebuggerAgent::buildExceptionPauseReason):
(Inspector::buildObjectForBreakpointCookie):
(Inspector::InspectorDebuggerAgent::breakpointActionsFromProtocol):
(Inspector::parseLocation):
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
(Inspector::InspectorDebuggerAgent::setBreakpoint):
(Inspector::InspectorDebuggerAgent::continueToLocation):
(Inspector::InspectorDebuggerAgent::schedulePauseOnNextStatement):
(Inspector::InspectorDebuggerAgent::didParseSource):
(Inspector::InspectorDebuggerAgent::breakProgram):
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::callFunctionOn):
(Inspector::InspectorRuntimeAgent::saveResult):
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:
(CppBackendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_command):
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator.generate_output):
(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:
(_generate_unchecked_setter_for_member):
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator):
* inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:
(ObjCBackendDispatcherImplementationGenerator.generate_output):
(ObjCBackendDispatcherImplementationGenerator._generate_success_block_for_command):
* inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py:
(ObjCFrontendDispatcherImplementationGenerator.generate_output):
(ObjCFrontendDispatcherImplementationGenerator._generate_event):
(ObjCFrontendDispatcherImplementationGenerator._generate_event_out_parameters):
* inspector/scripts/codegen/generate_objc_internal_header.py:
(ObjCInternalHeaderGenerator.generate_output):
* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
(ObjCProtocolTypesImplementationGenerator.generate_output):
* inspector/scripts/codegen/generator.py:
* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/domain-availability.json-result:
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result:
* inspector/scripts/tests/generic/expected/worker-supported-domains.json-result:
* inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:

Source/WebCore:

Based on patch by Brian Burg.

* ForwardingHeaders/inspector/InspectorValues.h: Removed.
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsKeyids):
(WebCore::sanitizeKeyids):
* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSAuditorDelegate::generateViolationReport):
* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::inspect):
* inspector/CommandLineAPIHost.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::releaseData):
(WebCore::InspectorCanvas::indexForData):
(WebCore::buildArrayForVector):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::buildAction):
(WebCore::InspectorCanvas::buildArrayForCanvasGradient):
(WebCore::InspectorCanvas::buildArrayForCanvasPattern):
(WebCore::InspectorCanvas::buildArrayForImageData):
(WebCore::InspectorCanvas::buildArrayForImageBitmap):
* inspector/InspectorCanvas.h:
* inspector/InspectorDatabaseResource.cpp:
* inspector/InspectorOverlay.cpp:
(WebCore::evaluateCommandInOverlay):
(WebCore::InspectorOverlay::evaluateInOverlay):
* inspector/InspectorOverlay.h:
* inspector/InspectorShaderProgram.h:
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorCSSId::InspectorCSSId):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):
(WebCore::TimelineRecordFactory::createFunctionCallData):
(WebCore::TimelineRecordFactory::createConsoleProfileData):
(WebCore::TimelineRecordFactory::createProbeSampleData):
(WebCore::TimelineRecordFactory::createEventDispatchData):
(WebCore::TimelineRecordFactory::createGenericTimerData):
(WebCore::TimelineRecordFactory::createTimerInstallData):
(WebCore::TimelineRecordFactory::createEvaluateScriptData):
(WebCore::TimelineRecordFactory::createTimeStampData):
(WebCore::TimelineRecordFactory::createAnimationFrameData):
(WebCore::createQuad):
(WebCore::TimelineRecordFactory::createPaintData):
(WebCore::TimelineRecordFactory::appendLayoutRoot):
* inspector/TimelineRecordFactory.h:
* inspector/agents/InspectorApplicationCacheAgent.cpp:
* inspector/agents/InspectorApplicationCacheAgent.h:
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::computePseudoClassMask):
(WebCore::InspectorCSSAgent::setStyleText):
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::forcePseudoState):
* inspector/agents/InspectorCSSAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::parseColor):
(WebCore::parseConfigColor):
(WebCore::parseQuad):
(WebCore::InspectorDOMAgent::performSearch):
(WebCore::InspectorDOMAgent::setSearchingForNode):
(WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
(WebCore::InspectorDOMAgent::setInspectModeEnabled):
(WebCore::InspectorDOMAgent::highlightRect):
(WebCore::InspectorDOMAgent::highlightQuad):
(WebCore::InspectorDOMAgent::innerHighlightQuad):
(WebCore::InspectorDOMAgent::highlightSelector):
(WebCore::InspectorDOMAgent::highlightNode):
(WebCore::InspectorDOMAgent::highlightNodeList):
(WebCore::InspectorDOMAgent::highlightFrame):
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
(WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
(WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
(WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
(WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/agents/InspectorDOMStorageAgent.h:
* inspector/agents/InspectorDatabaseAgent.cpp:
* inspector/agents/InspectorIndexedDBAgent.cpp:
(WebCore::Inspector::idbKeyFromInspectorObject):
(WebCore::Inspector::idbKeyRangeFromKeyRange):
(WebCore::InspectorIndexedDBAgent::requestData):
* inspector/agents/InspectorIndexedDBAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::buildObjectForHeaders):
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
(WebCore::InspectorNetworkAgent::setExtraHTTPHeaders):
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setInstruments):
(WebCore::InspectorTimelineAgent::internalStart):
(WebCore::InspectorTimelineAgent::didInvalidateLayout):
(WebCore::InspectorTimelineAgent::willLayout):
(WebCore::InspectorTimelineAgent::didScheduleStyleRecalculation):
(WebCore::InspectorTimelineAgent::willRecalculateStyle):
(WebCore::InspectorTimelineAgent::willComposite):
(WebCore::InspectorTimelineAgent::willPaint):
(WebCore::InspectorTimelineAgent::addRecordToTimeline):
(WebCore::InspectorTimelineAgent::setFrameIdentifier):
(WebCore::InspectorTimelineAgent::appendRecord):
(WebCore::InspectorTimelineAgent::sendEvent):
(WebCore::InspectorTimelineAgent::createRecordEntry):
(WebCore::InspectorTimelineAgent::pushCurrentRecord):
* inspector/agents/InspectorTimelineAgent.h:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::parseJSONObject):
(WebCore::parseLicenseFormat):
(WebCore::parseLicenseReleaseAcknowledgementFormat):
(WebCore::CDMInstanceClearKey::updateLicense):
(WebCore::CDMInstanceClearKey::removeSessionData):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::extractSinfData):
* testing/Internals.cpp:

Source/WebDriver:

* CMakeLists.txt:
* CommandResult.cpp:
(WebDriver::CommandResult::CommandResult):
* CommandResult.h:
(WebDriver::CommandResult::success):
(WebDriver::CommandResult::fail):
(WebDriver::CommandResult::result const):
(WebDriver::CommandResult::setAdditionalErrorData):
(WebDriver::CommandResult::additionalErrorData const):
* Session.cpp:
(WebDriver::firstWindowHandleInResult):
(WebDriver::Session::handleUserPrompts):
(WebDriver::Session::reportUnexpectedAlertOpen):
(WebDriver::Session::go):
(WebDriver::Session::getCurrentURL):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::getTitle):
(WebDriver::Session::getWindowHandle):
(WebDriver::Session::closeTopLevelBrowsingContext):
(WebDriver::Session::switchToWindow):
(WebDriver::Session::getWindowHandles):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):
(WebDriver::Session::getToplevelBrowsingContextRect):
(WebDriver::Session::moveToplevelBrowsingContextWindow):
(WebDriver::Session::resizeToplevelBrowsingContextWindow):
(WebDriver::Session::createElement):
(WebDriver::Session::extractElement):
(WebDriver::Session::extractElementID):
(WebDriver::Session::computeElementLayout):
(WebDriver::Session::findElements):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::getElementText):
(WebDriver::Session::getElementTagName):
(WebDriver::Session::getElementRect):
(WebDriver::Session::isElementEnabled):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::waitForNavigationToComplete):
(WebDriver::Session::selectOptionElement):
(WebDriver::Session::elementClick):
(WebDriver::Session::elementClear):
(WebDriver::Session::elementSendKeys):
(WebDriver::Session::elementSubmit):
(WebDriver::Session::handleScriptResult):
(WebDriver::Session::executeScript):
(WebDriver::Session::performMouseInteraction):
(WebDriver::Session::performKeyboardInteractions):
(WebDriver::parseAutomationCookie):
(WebDriver::builtAutomationCookie):
(WebDriver::serializeCookie):
(WebDriver::Session::getAllCookies):
(WebDriver::Session::getNamedCookie):
(WebDriver::Session::addCookie):
(WebDriver::Session::deleteCookie):
(WebDriver::Session::deleteAllCookies):
(WebDriver::Session::dismissAlert):
(WebDriver::Session::acceptAlert):
(WebDriver::Session::getAlertText):
(WebDriver::Session::sendAlertText):
(WebDriver::Session::takeScreenshot):
* Session.h:
* SessionHost.cpp:
(WebDriver::SessionHost::sendCommandToBackend):
(WebDriver::SessionHost::dispatchMessage):
* SessionHost.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::handleRequest):
(WebDriver::WebDriverService::sendResponse const):
(WebDriver::deserializeTimeouts):
(WebDriver::WebDriverService::parseCapabilities const):
(WebDriver::WebDriverService::findSessionOrCompleteWithError):
(WebDriver::WebDriverService::validatedCapabilities const):
(WebDriver::WebDriverService::mergeCapabilities const):
(WebDriver::WebDriverService::matchCapabilities const):
(WebDriver::WebDriverService::processCapabilities const):
(WebDriver::WebDriverService::newSession):
(WebDriver::WebDriverService::deleteSession):
(WebDriver::WebDriverService::setTimeouts):
(WebDriver::WebDriverService::go):
(WebDriver::WebDriverService::getCurrentURL):
(WebDriver::WebDriverService::back):
(WebDriver::WebDriverService::forward):
(WebDriver::WebDriverService::refresh):
(WebDriver::WebDriverService::getTitle):
(WebDriver::WebDriverService::getWindowHandle):
(WebDriver::WebDriverService::getWindowRect):
(WebDriver::valueAsNumberInRange):
(WebDriver::WebDriverService::setWindowRect):
(WebDriver::WebDriverService::closeWindow):
(WebDriver::WebDriverService::switchToWindow):
(WebDriver::WebDriverService::getWindowHandles):
(WebDriver::WebDriverService::switchToFrame):
(WebDriver::WebDriverService::switchToParentFrame):
(WebDriver::findElementOrCompleteWithError):
(WebDriver::findStrategyAndSelectorOrCompleteWithError):
(WebDriver::WebDriverService::findElement):
(WebDriver::WebDriverService::findElements):
(WebDriver::WebDriverService::findElementFromElement):
(WebDriver::WebDriverService::findElementsFromElement):
(WebDriver::WebDriverService::isElementSelected):
(WebDriver::WebDriverService::getElementAttribute):
(WebDriver::WebDriverService::getElementText):
(WebDriver::WebDriverService::getElementTagName):
(WebDriver::WebDriverService::getElementRect):
(WebDriver::WebDriverService::isElementEnabled):
(WebDriver::WebDriverService::isElementDisplayed):
(WebDriver::WebDriverService::elementClick):
(WebDriver::WebDriverService::elementClear):
(WebDriver::WebDriverService::elementSendKeys):
(WebDriver::WebDriverService::elementSubmit):
(WebDriver::findScriptAndArgumentsOrCompleteWithError):
(WebDriver::WebDriverService::executeScript):
(WebDriver::WebDriverService::executeAsyncScript):
(WebDriver::WebDriverService::getAllCookies):
(WebDriver::WebDriverService::getNamedCookie):
(WebDriver::deserializeCookie):
(WebDriver::WebDriverService::addCookie):
(WebDriver::WebDriverService::deleteCookie):
(WebDriver::WebDriverService::deleteAllCookies):
(WebDriver::WebDriverService::dismissAlert):
(WebDriver::WebDriverService::acceptAlert):
(WebDriver::WebDriverService::getAlertText):
(WebDriver::WebDriverService::sendAlertText):
(WebDriver::WebDriverService::takeScreenshot):
(WebDriver::WebDriverService::takeElementScreenshot):
* WebDriverService.h:
* gtk/WebDriverServiceGtk.cpp:
(WebDriver::WebDriverService::platformValidateCapability const):
(WebDriver::WebDriverService::platformMatchCapability const):
(WebDriver::WebDriverService::platformParseCapabilities const):

Source/WebKit:

Based on patch by Brian Burg.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
(WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
(WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
(WebKit::WebAutomationSession::navigationOccurredForFrame):
(WebKit::WebAutomationSession::documentLoadedForFrame):
(WebKit::WebAutomationSession::inspectorFrontendLoaded):
(WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
(WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
(WebKit::WebAutomationSession::addSingleCookie):
(WebKit::WebAutomationSession::setSessionPermissions):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
* UIProcess/Automation/WebAutomationSession.h:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/JSONValues.cpp: Renamed from Source/JavaScriptCore/inspector/InspectorValues.cpp.
(JSON::Value::null):
(JSON::Value::create):
(JSON::Value::asValue):
(JSON::Value::asObject):
(JSON::Value::asArray):
(JSON::Value::parseJSON):
(JSON::Value::toJSONString const):
(JSON::Value::asBoolean const):
(JSON::Value::asDouble const):
(JSON::Value::asInteger const):
(JSON::Value::asString const):
(JSON::Value::writeJSON const):
(JSON::Value::memoryCost const):
(JSON::ObjectBase::~ObjectBase):
(JSON::ObjectBase::asObject):
(JSON::ObjectBase::openAccessors):
(JSON::ObjectBase::memoryCost const):
(JSON::ObjectBase::getBoolean const):
(JSON::ObjectBase::getString const):
(JSON::ObjectBase::getObject const):
(JSON::ObjectBase::getArray const):
(JSON::ObjectBase::getValue const):
(JSON::ObjectBase::remove):
(JSON::ObjectBase::writeJSON const):
(JSON::ObjectBase::ObjectBase):
(JSON::ArrayBase::~ArrayBase):
(JSON::ArrayBase::asArray):
(JSON::ArrayBase::writeJSON const):
(JSON::ArrayBase::ArrayBase):
(JSON::ArrayBase::get const):
(JSON::Object::create):
(JSON::Array::create):
(JSON::ArrayBase::memoryCost const):
* wtf/JSONValues.h: Renamed from Source/JavaScriptCore/inspector/InspectorValues.h.
(JSON::ObjectBase::find):
(JSON::ObjectBase::find const):
(JSON::ObjectBase::setBoolean):
(JSON::ObjectBase::setInteger):
(JSON::ObjectBase::setDouble):
(JSON::ObjectBase::setString):
(JSON::ObjectBase::setValue):
(JSON::ObjectBase::setObject):
(JSON::ObjectBase::setArray):
(JSON::ArrayBase::pushBoolean):
(JSON::ArrayBase::pushInteger):
(JSON::ArrayBase::pushDouble):
(JSON::ArrayBase::pushString):
(JSON::ArrayBase::pushValue):
(JSON::ArrayBase::pushObject):
(JSON::ArrayBase::pushArray):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/JSONValue.cpp: Renamed from Tools/TestWebKitAPI/Tests/JavaScriptCore/InspectorValue.cpp.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224863 268f45cc-cd09-0410-ab3c-d52691b4dbfc

117 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Sources.txt
Source/JavaScriptCore/bindings/ScriptValue.cpp
Source/JavaScriptCore/bindings/ScriptValue.h
Source/JavaScriptCore/inspector/AsyncStackTrace.cpp
Source/JavaScriptCore/inspector/ConsoleMessage.cpp
Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp
Source/JavaScriptCore/inspector/InjectedScript.cpp
Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
Source/JavaScriptCore/inspector/InjectedScriptBase.h
Source/JavaScriptCore/inspector/InjectedScriptManager.cpp
Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
Source/JavaScriptCore/inspector/InspectorFrontendRouter.h
Source/JavaScriptCore/inspector/InspectorProtocolTypes.h
Source/JavaScriptCore/inspector/ScriptCallFrame.cpp
Source/JavaScriptCore/inspector/ScriptCallStack.cpp
Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorAgent.h
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_internal_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generator.py
Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/worker-supported-domains.json-result
Source/JavaScriptCore/inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result
Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/JSONValues.cpp [moved from Source/JavaScriptCore/inspector/InspectorValues.cpp with 72% similarity]
Source/WTF/wtf/JSONValues.h [moved from Source/JavaScriptCore/inspector/InspectorValues.h with 52% similarity]
Source/WebCore/ChangeLog
Source/WebCore/ForwardingHeaders/inspector/InspectorValues.h [deleted file]
Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp
Source/WebCore/html/parser/XSSAuditorDelegate.cpp
Source/WebCore/inspector/CommandLineAPIHost.cpp
Source/WebCore/inspector/CommandLineAPIHost.h
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/inspector/InspectorCanvas.h
Source/WebCore/inspector/InspectorDatabaseResource.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/InspectorOverlay.h
Source/WebCore/inspector/InspectorShaderProgram.h
Source/WebCore/inspector/InspectorStyleSheet.h
Source/WebCore/inspector/TimelineRecordFactory.cpp
Source/WebCore/inspector/TimelineRecordFactory.h
Source/WebCore/inspector/agents/InspectorApplicationCacheAgent.cpp
Source/WebCore/inspector/agents/InspectorApplicationCacheAgent.h
Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
Source/WebCore/inspector/agents/InspectorCSSAgent.h
Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
Source/WebCore/inspector/agents/InspectorDOMAgent.h
Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp
Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h
Source/WebCore/inspector/agents/InspectorDOMStorageAgent.cpp
Source/WebCore/inspector/agents/InspectorDOMStorageAgent.h
Source/WebCore/inspector/agents/InspectorDatabaseAgent.cpp
Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp
Source/WebCore/inspector/agents/InspectorIndexedDBAgent.h
Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
Source/WebCore/inspector/agents/InspectorNetworkAgent.h
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.h
Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp
Source/WebCore/inspector/agents/InspectorTimelineAgent.h
Source/WebCore/page/csp/ContentSecurityPolicy.cpp
Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp
Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp
Source/WebCore/testing/Internals.cpp
Source/WebDriver/CMakeLists.txt
Source/WebDriver/ChangeLog
Source/WebDriver/CommandResult.cpp
Source/WebDriver/CommandResult.h
Source/WebDriver/Session.cpp
Source/WebDriver/Session.h
Source/WebDriver/SessionHost.cpp
Source/WebDriver/SessionHost.h
Source/WebDriver/WebDriverService.cpp
Source/WebDriver/WebDriverService.h
Source/WebDriver/gtk/WebDriverServiceGtk.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit/UIProcess/Automation/WebAutomationSession.h
Tools/ChangeLog
Tools/TestWebKitAPI/CMakeLists.txt
Tools/TestWebKitAPI/PlatformGTK.cmake
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WTF/JSONValue.cpp [moved from Tools/TestWebKitAPI/Tests/JavaScriptCore/InspectorValue.cpp with 97% similarity]

index 8b63de0..23a8fef 100644 (file)
@@ -1,3 +1,138 @@
+2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
+        https://bugs.webkit.org/show_bug.cgi?id=173793
+
+        Reviewed by Brian Burg.
+
+        Based on patch by Brian Burg.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * Sources.txt:
+        * bindings/ScriptValue.cpp:
+        (Inspector::jsToInspectorValue):
+        (Inspector::toInspectorValue):
+        (Deprecated::ScriptValue::toInspectorValue const):
+        * bindings/ScriptValue.h:
+        * inspector/AsyncStackTrace.cpp:
+        * inspector/ConsoleMessage.cpp:
+        * inspector/ContentSearchUtilities.cpp:
+        * inspector/InjectedScript.cpp:
+        (Inspector::InjectedScript::getFunctionDetails):
+        (Inspector::InjectedScript::functionDetails):
+        (Inspector::InjectedScript::getPreview):
+        (Inspector::InjectedScript::getProperties):
+        (Inspector::InjectedScript::getDisplayableProperties):
+        (Inspector::InjectedScript::getInternalProperties):
+        (Inspector::InjectedScript::getCollectionEntries):
+        (Inspector::InjectedScript::saveResult):
+        (Inspector::InjectedScript::wrapCallFrames const):
+        (Inspector::InjectedScript::wrapObject const):
+        (Inspector::InjectedScript::wrapTable const):
+        (Inspector::InjectedScript::previewValue const):
+        (Inspector::InjectedScript::setExceptionValue):
+        (Inspector::InjectedScript::clearExceptionValue):
+        (Inspector::InjectedScript::inspectObject):
+        (Inspector::InjectedScript::releaseObject):
+        * inspector/InjectedScriptBase.cpp:
+        (Inspector::InjectedScriptBase::makeCall):
+        (Inspector::InjectedScriptBase::makeEvalCall):
+        * inspector/InjectedScriptBase.h:
+        * inspector/InjectedScriptManager.cpp:
+        (Inspector::InjectedScriptManager::injectedScriptForObjectId):
+        * inspector/InspectorBackendDispatcher.cpp:
+        (Inspector::BackendDispatcher::CallbackBase::sendSuccess):
+        (Inspector::BackendDispatcher::dispatch):
+        (Inspector::BackendDispatcher::sendResponse):
+        (Inspector::BackendDispatcher::sendPendingErrors):
+        (Inspector::BackendDispatcher::getPropertyValue):
+        (Inspector::castToInteger):
+        (Inspector::castToNumber):
+        (Inspector::BackendDispatcher::getInteger):
+        (Inspector::BackendDispatcher::getDouble):
+        (Inspector::BackendDispatcher::getString):
+        (Inspector::BackendDispatcher::getBoolean):
+        (Inspector::BackendDispatcher::getObject):
+        (Inspector::BackendDispatcher::getArray):
+        (Inspector::BackendDispatcher::getValue):
+        * inspector/InspectorBackendDispatcher.h:
+        * inspector/InspectorProtocolTypes.h:
+        (Inspector::Protocol::Array::openAccessors):
+        (Inspector::Protocol::PrimitiveBindingTraits::assertValueHasExpectedType):
+        (Inspector::Protocol::BindingTraits<Protocol::Array<T>>::runtimeCast):
+        (Inspector::Protocol::BindingTraits<Protocol::Array<T>>::assertValueHasExpectedType):
+        (Inspector::Protocol::BindingTraits<JSON::Value>::assertValueHasExpectedType):
+        * inspector/ScriptCallFrame.cpp:
+        * inspector/ScriptCallStack.cpp:
+        * inspector/agents/InspectorAgent.cpp:
+        (Inspector::InspectorAgent::inspect):
+        * inspector/agents/InspectorAgent.h:
+        * inspector/agents/InspectorDebuggerAgent.cpp:
+        (Inspector::buildAssertPauseReason):
+        (Inspector::buildCSPViolationPauseReason):
+        (Inspector::InspectorDebuggerAgent::buildBreakpointPauseReason):
+        (Inspector::InspectorDebuggerAgent::buildExceptionPauseReason):
+        (Inspector::buildObjectForBreakpointCookie):
+        (Inspector::InspectorDebuggerAgent::breakpointActionsFromProtocol):
+        (Inspector::parseLocation):
+        (Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
+        (Inspector::InspectorDebuggerAgent::setBreakpoint):
+        (Inspector::InspectorDebuggerAgent::continueToLocation):
+        (Inspector::InspectorDebuggerAgent::schedulePauseOnNextStatement):
+        (Inspector::InspectorDebuggerAgent::didParseSource):
+        (Inspector::InspectorDebuggerAgent::breakProgram):
+        * inspector/agents/InspectorDebuggerAgent.h:
+        * inspector/agents/InspectorRuntimeAgent.cpp:
+        (Inspector::InspectorRuntimeAgent::callFunctionOn):
+        (Inspector::InspectorRuntimeAgent::saveResult):
+        (Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
+        * inspector/agents/InspectorRuntimeAgent.h:
+        * inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:
+        (CppBackendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_command):
+        * inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
+        (CppBackendDispatcherImplementationGenerator.generate_output):
+        (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:
+        (_generate_unchecked_setter_for_member):
+        * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
+        (CppProtocolTypesImplementationGenerator):
+        * inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:
+        (ObjCBackendDispatcherImplementationGenerator.generate_output):
+        (ObjCBackendDispatcherImplementationGenerator._generate_success_block_for_command):
+        * inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py:
+        (ObjCFrontendDispatcherImplementationGenerator.generate_output):
+        (ObjCFrontendDispatcherImplementationGenerator._generate_event):
+        (ObjCFrontendDispatcherImplementationGenerator._generate_event_out_parameters):
+        * inspector/scripts/codegen/generate_objc_internal_header.py:
+        (ObjCInternalHeaderGenerator.generate_output):
+        * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
+        (ObjCProtocolTypesImplementationGenerator.generate_output):
+        * inspector/scripts/codegen/generator.py:
+        * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
+        * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
+        * inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
+        * inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result:
+        * inspector/scripts/tests/generic/expected/domain-availability.json-result:
+        * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
+        * inspector/scripts/tests/generic/expected/enum-values.json-result:
+        * inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
+        * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
+        * inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result:
+        * inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
+        * inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result:
+        * inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
+        * inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
+        * inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
+        * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
+        * inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result:
+        * inspector/scripts/tests/generic/expected/worker-supported-domains.json-result:
+        * inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result:
+        * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
+
 2017-11-14  Mark Lam  <mark.lam@apple.com>
 
         Fix a bit-rotted Interpreter::dumpRegisters() and make it more robust.
index a9c4a99..4beba53 100644 (file)
                A58C024218E4A41A00032BC5 /* JSContextPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A58C024118E4A41A00032BC5 /* JSContextPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A593CF7D1840360300BFCE27 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A593CF7F1840362C00BFCE27 /* InspectorAgentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               A593CF831840377100BFCE27 /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF811840377100BFCE27 /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A593CF87184038CA00BFCE27 /* InspectorAgentRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF85184038CA00BFCE27 /* InspectorAgentRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A59455931824744700CC3843 /* JSGlobalObjectDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A59455911824744700CC3843 /* JSGlobalObjectDebuggable.h */; };
                A5945595182479EB00CC3843 /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackendDispatcher.cpp; sourceTree = "<group>"; };
                A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackendDispatcher.h; sourceTree = "<group>"; };
                A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgentBase.h; sourceTree = "<group>"; };
-               A593CF801840377100BFCE27 /* InspectorValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorValues.cpp; sourceTree = "<group>"; };
-               A593CF811840377100BFCE27 /* InspectorValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorValues.h; sourceTree = "<group>"; };
                A593CF84184038CA00BFCE27 /* InspectorAgentRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAgentRegistry.cpp; sourceTree = "<group>"; };
                A593CF85184038CA00BFCE27 /* InspectorAgentRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgentRegistry.h; sourceTree = "<group>"; };
                A594558E18245EDE00CC3843 /* RemoteInspectionTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteInspectionTarget.cpp; sourceTree = "<group>"; };
                                99F1A6FC1B8E6D9400463B26 /* InspectorFrontendRouter.cpp */,
                                99F1A7001B98FBEC00463B26 /* InspectorFrontendRouter.h */,
                                A55D93AB18514F7900400DED /* InspectorProtocolTypes.h */,
-                               A593CF801840377100BFCE27 /* InspectorValues.cpp */,
-                               A593CF811840377100BFCE27 /* InspectorValues.h */,
                                A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */,
                                A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */,
                                A5C3A1A318C0490200C9593A /* JSGlobalObjectConsoleClient.cpp */,
                                A55D93AC18514F7900400DED /* InspectorProtocolTypes.h in Headers */,
                                A50E4B6218809DD50068A46D /* InspectorRuntimeAgent.h in Headers */,
                                A55165D31BDF0B9E003B75C1 /* InspectorScriptProfilerAgent.h in Headers */,
-                               A593CF831840377100BFCE27 /* InspectorValues.h in Headers */,
                                969A07990ED1D3AE00F1F681 /* Instruction.h in Headers */,
                                A7A8AF3B17ADB5F3005AB174 /* Int16Array.h in Headers */,
                                A7A8AF3C17ADB5F3005AB174 /* Int32Array.h in Headers */,
index 70e4a32..f03656e 100644 (file)
@@ -530,7 +530,6 @@ inspector/InjectedScriptModule.cpp
 inspector/InspectorAgentRegistry.cpp
 inspector/InspectorFrontendRouter.cpp
 inspector/InspectorBackendDispatcher.cpp
-inspector/InspectorValues.cpp
 inspector/JSGlobalObjectConsoleClient.cpp
 inspector/JSGlobalObjectInspectorController.cpp
 inspector/JSGlobalObjectScriptDebugServer.cpp
index d0070ec..d839232 100644 (file)
 
 #include "APICast.h"
 #include "CatchScope.h"
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "JSLock.h"
+#include <wtf/JSONValues.h>
 
 using namespace JSC;
 using namespace Inspector;
 
 namespace Inspector {
 
-static RefPtr<InspectorValue> jsToInspectorValue(ExecState& scriptState, JSValue value, int maxDepth)
+static RefPtr<JSON::Value> jsToInspectorValue(ExecState& scriptState, JSValue value, int maxDepth)
 {
     if (!value) {
         ASSERT_NOT_REACHED();
@@ -54,19 +54,19 @@ static RefPtr<InspectorValue> jsToInspectorValue(ExecState& scriptState, JSValue
     maxDepth--;
 
     if (value.isUndefinedOrNull())
-        return InspectorValue::null();
+        return JSON::Value::null();
     if (value.isBoolean())
-        return InspectorValue::create(value.asBoolean());
+        return JSON::Value::create(value.asBoolean());
     if (value.isNumber() && value.isDouble())
-        return InspectorValue::create(value.asNumber());
+        return JSON::Value::create(value.asNumber());
     if (value.isNumber() && value.isAnyInt())
-        return InspectorValue::create(static_cast<int>(value.asAnyInt()));
+        return JSON::Value::create(static_cast<int>(value.asAnyInt()));
     if (value.isString())
-        return InspectorValue::create(asString(value)->value(&scriptState));
+        return JSON::Value::create(asString(value)->value(&scriptState));
 
     if (value.isObject()) {
         if (isJSArray(value)) {
-            auto inspectorArray = InspectorArray::create();
+            auto inspectorArray = JSON::Array::create();
             auto& array = *asArray(value);
             unsigned length = array.length();
             for (unsigned i = 0; i < length; i++) {
@@ -77,7 +77,7 @@ static RefPtr<InspectorValue> jsToInspectorValue(ExecState& scriptState, JSValue
             }
             return WTFMove(inspectorArray);
         }
-        auto inspectorObject = InspectorObject::create();
+        auto inspectorObject = JSON::Object::create();
         auto& object = *value.getObject();
         PropertyNameArray propertyNames(&scriptState.vm(), PropertyNameMode::Strings, PrivateSymbolMode::Exclude);
         object.methodTable()->getOwnPropertyNames(&object, &scriptState, propertyNames, EnumerationMode());
@@ -94,12 +94,12 @@ static RefPtr<InspectorValue> jsToInspectorValue(ExecState& scriptState, JSValue
     return nullptr;
 }
 
-RefPtr<InspectorValue> toInspectorValue(ExecState& state, JSValue value)
+RefPtr<JSON::Value> toInspectorValue(ExecState& state, JSValue value)
 {
     // FIXME: Maybe we should move the JSLockHolder stuff to the callers since this function takes a JSValue directly.
     // Doing the locking here made sense when we were trying to abstract the difference between multiple JavaScript engines.
     JSLockHolder holder(&state);
-    return jsToInspectorValue(state, value, InspectorValue::maxDepth);
+    return jsToInspectorValue(state, value, JSON::Value::maxDepth);
 }
 
 } // namespace Inspector
@@ -166,10 +166,10 @@ bool ScriptValue::isFunction() const
     return getCallData(m_value.get(), callData) != CallType::None;
 }
 
-RefPtr<InspectorValue> ScriptValue::toInspectorValue(ExecState* scriptState) const
+RefPtr<JSON::Value> ScriptValue::toInspectorValue(ExecState* scriptState) const
 {
     JSLockHolder holder(scriptState);
-    return jsToInspectorValue(*scriptState, m_value.get(), InspectorValue::maxDepth);
+    return jsToInspectorValue(*scriptState, m_value.get(), JSON::Value::maxDepth);
 }
 
 } // namespace Deprecated
index 5b02f04..c08449b 100644 (file)
 #include "StrongInlines.h"
 #include <wtf/text/WTFString.h>
 
-namespace Inspector {
-
-class InspectorValue;
-
-JS_EXPORT_PRIVATE RefPtr<InspectorValue> toInspectorValue(JSC::ExecState&, JSC::JSValue);
+namespace JSON {
+class Value;
+}
 
+namespace Inspector {
+JS_EXPORT_PRIVATE RefPtr<JSON::Value> toInspectorValue(JSC::ExecState&, JSC::JSValue);
 }
 
 namespace Deprecated {
@@ -68,7 +68,7 @@ public:
 
     bool operator==(const ScriptValue& other) const { return m_value == other.m_value; }
 
-    RefPtr<Inspector::InspectorValue> toInspectorValue(JSC::ExecState*) const;
+    RefPtr<JSON::Value> toInspectorValue(JSC::ExecState*) const;
 
 private:
     JSC::Strong<JSC::Unknown> m_value;
index b764096..9e68b49 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "AsyncStackTrace.h"
 
-#include "InspectorValues.h"
 #include "ScriptCallStack.h"
 
 namespace Inspector {
index 9084862..04430ab 100644 (file)
@@ -35,7 +35,6 @@
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
 #include "InspectorFrontendDispatchers.h"
-#include "InspectorValues.h"
 #include "ScriptArguments.h"
 #include "ScriptCallFrame.h"
 #include "ScriptCallStack.h"
index 0121c39..3c41754 100644 (file)
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "ContentSearchUtilities.h"
 
-#include "InspectorValues.h"
 #include "RegularExpression.h"
 #include "Yarr.h"
 #include "YarrInterpreter.h"
index c6912c1..fd8e4ad 100644 (file)
 #include "config.h"
 #include "InjectedScript.h"
 
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "ScriptFunctionCall.h"
 #include "ScriptObject.h"
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 using Inspector::Protocol::Array;
@@ -98,9 +98,9 @@ void InjectedScript::getFunctionDetails(ErrorString& errorString, const String&
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getFunctionDetails"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(functionId);
 
-    RefPtr<InspectorValue> resultValue;
+    RefPtr<JSON::Value> resultValue;
     makeCall(function, &resultValue);
-    if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
+    if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
         if (!resultValue->asString(errorString))
             errorString = ASCIILiteral("Internal error");
         return;
@@ -114,9 +114,9 @@ void InjectedScript::functionDetails(ErrorString& errorString, JSC::JSValue valu
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("functionDetails"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(value);
 
-    RefPtr<InspectorValue> resultValue;
+    RefPtr<JSON::Value> resultValue;
     makeCall(function, &resultValue);
-    if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
+    if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
         if (!resultValue->asString(errorString))
             errorString = ASCIILiteral("Internal error");
         return;
@@ -130,9 +130,9 @@ void InjectedScript::getPreview(ErrorString& errorString, const String& objectId
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getPreview"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
 
-    RefPtr<InspectorValue> resultValue;
+    RefPtr<JSON::Value> resultValue;
     makeCall(function, &resultValue);
-    if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
+    if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
         if (!resultValue->asString(errorString))
             errorString = ASCIILiteral("Internal error");
         return;
@@ -148,9 +148,9 @@ void InjectedScript::getProperties(ErrorString& errorString, const String& objec
     function.appendArgument(ownProperties);
     function.appendArgument(generatePreview);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Array) {
+    if (!result || result->type() != JSON::Value::Type::Array) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -164,9 +164,9 @@ void InjectedScript::getDisplayableProperties(ErrorString& errorString, const St
     function.appendArgument(objectId);
     function.appendArgument(generatePreview);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Array) {
+    if (!result || result->type() != JSON::Value::Type::Array) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -180,9 +180,9 @@ void InjectedScript::getInternalProperties(ErrorString& errorString, const Strin
     function.appendArgument(objectId);
     function.appendArgument(generatePreview);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Array) {
+    if (!result || result->type() != JSON::Value::Type::Array) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -199,9 +199,9 @@ void InjectedScript::getCollectionEntries(ErrorString& errorString, const String
     function.appendArgument(startIndex);
     function.appendArgument(numberToFetch);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Array) {
+    if (!result || result->type() != JSON::Value::Type::Array) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -214,9 +214,9 @@ void InjectedScript::saveResult(ErrorString& errorString, const String& callArgu
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("saveResult"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(callArgumentJSON);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Integer) {
+    if (!result || result->type() != JSON::Value::Type::Integer) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -237,8 +237,8 @@ Ref<Array<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFra
     if (!callFramesValue)
         return Array<Inspector::Protocol::Debugger::CallFrame>::create();
     ASSERT(!hadException);
-    RefPtr<InspectorValue> result = toInspectorValue(*scriptState(), callFramesValue);
-    if (result->type() == InspectorValue::Type::Array)
+    RefPtr<JSON::Value> result = toInspectorValue(*scriptState(), callFramesValue);
+    if (result->type() == JSON::Value::Type::Array)
         return BindingTraits<Array<Inspector::Protocol::Debugger::CallFrame>>::runtimeCast(WTFMove(result)).releaseNonNull();
 
     return Array<Inspector::Protocol::Debugger::CallFrame>::create();
@@ -258,7 +258,7 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(JS
     if (hadException)
         return nullptr;
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
@@ -281,7 +281,7 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapTable(JSC
     if (hadException)
         return nullptr;
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
@@ -299,7 +299,7 @@ RefPtr<Inspector::Protocol::Runtime::ObjectPreview> InjectedScript::previewValue
     if (hadException)
         return nullptr;
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
@@ -311,7 +311,7 @@ void InjectedScript::setExceptionValue(JSC::JSValue value)
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("setExceptionValue"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(value);
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
 }
 
@@ -319,7 +319,7 @@ void InjectedScript::clearExceptionValue()
 {
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("clearExceptionValue"), inspectorEnvironment()->functionCallHandler());
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
 }
 
@@ -341,7 +341,7 @@ void InjectedScript::inspectObject(JSC::JSValue value)
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("inspectObject"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(value);
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
 }
 
@@ -349,7 +349,7 @@ void InjectedScript::releaseObject(const String& objectId)
 {
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("releaseObject"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
 }
 
index 9caa4eb..56cc9fe 100644 (file)
 #include "InjectedScriptBase.h"
 
 #include "DebuggerEvalEnabler.h"
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "JSGlobalObject.h"
 #include "ScriptFunctionCall.h"
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -75,10 +75,10 @@ JSC::JSValue InjectedScriptBase::callFunctionWithEvalEnabled(Deprecated::ScriptF
     return function.call(hadException);
 }
 
-void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr<InspectorValue>* result)
+void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr<JSON::Value>* result)
 {
     if (hasNoValue() || !hasAccessToInspectedScriptState()) {
-        *result = InspectorValue::null();
+        *result = JSON::Value::null();
         return;
     }
 
@@ -89,33 +89,33 @@ void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefP
     if (!hadException) {
         *result = toInspectorValue(*m_injectedScriptObject.scriptState(), resultValue);
         if (!*result)
-            *result = InspectorValue::create(String::format("Object has too long reference chain (must not be longer than %d)", InspectorValue::maxDepth));
+            *result = JSON::Value::create(String::format("Object has too long reference chain (must not be longer than %d)", JSON::Value::maxDepth));
     } else
-        *result = InspectorValue::create("Exception while making a call.");
+        *result = JSON::Value::create("Exception while making a call.");
 }
 
 void InjectedScriptBase::makeEvalCall(ErrorString& errorString, Deprecated::ScriptFunctionCall& function, RefPtr<Protocol::Runtime::RemoteObject>* objectResult, Protocol::OptOutput<bool>* wasThrown, Protocol::OptOutput<int>* savedResultIndex)
 {
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
     if (!result) {
         errorString = ASCIILiteral("Internal error: result value is empty");
         return;
     }
 
-    if (result->type() == InspectorValue::Type::String) {
+    if (result->type() == JSON::Value::Type::String) {
         result->asString(errorString);
         ASSERT(errorString.length());
         return;
     }
 
-    RefPtr<InspectorObject> resultTuple;
+    RefPtr<JSON::Object> resultTuple;
     if (!result->asObject(resultTuple)) {
         errorString = ASCIILiteral("Internal error: result is not an Object");
         return;
     }
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     if (!resultTuple->getObject(ASCIILiteral("result"), resultObject)) {
         errorString = ASCIILiteral("Internal error: result is not a pair of value and wasThrown flag");
         return;
index 55dd0e5..6b62f49 100644 (file)
@@ -63,7 +63,7 @@ protected:
 
     const Deprecated::ScriptObject& injectedScriptObject() const;
     JSC::JSValue callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall&, bool& hadException) const;
-    void makeCall(Deprecated::ScriptFunctionCall&, RefPtr<InspectorValue>* result);
+    void makeCall(Deprecated::ScriptFunctionCall&, RefPtr<JSON::Value>* result);
     void makeEvalCall(ErrorString&, Deprecated::ScriptFunctionCall&, RefPtr<Protocol::Runtime::RemoteObject>* result, Protocol::OptOutput<bool>* wasThrown, Protocol::OptOutput<int>* savedResult = nullptr);
 
 private:
index e96987e..fe1133c 100644 (file)
 #include "Completion.h"
 #include "InjectedScriptHost.h"
 #include "InjectedScriptSource.h"
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "JSInjectedScriptHost.h"
 #include "JSLock.h"
 #include "ScriptObject.h"
 #include "SourceCode.h"
+#include <wtf/JSONValues.h>
 
 using namespace JSC;
 
@@ -101,11 +101,11 @@ int InjectedScriptManager::injectedScriptIdFor(ExecState* scriptState)
 
 InjectedScript InjectedScriptManager::injectedScriptForObjectId(const String& objectId)
 {
-    RefPtr<InspectorValue> parsedObjectId;
-    if (!InspectorValue::parseJSON(objectId, parsedObjectId))
+    RefPtr<JSON::Value> parsedObjectId;
+    if (!JSON::Value::parseJSON(objectId, parsedObjectId))
         return InjectedScript();
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     if (!parsedObjectId->asObject(resultObject))
         return InjectedScript();
 
index b1984a8..0235e47 100644 (file)
@@ -28,7 +28,7 @@
 #include "InspectorBackendDispatcher.h"
 
 #include "InspectorFrontendRouter.h"
-#include "InspectorValues.h"
+#include <wtf/JSONValues.h>
 #include <wtf/SetForScope.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
@@ -69,7 +69,7 @@ void BackendDispatcher::CallbackBase::sendFailure(const ErrorString& error)
     m_backendDispatcher->sendPendingErrors();
 }
 
-void BackendDispatcher::CallbackBase::sendSuccess(RefPtr<InspectorObject>&& partialMessage)
+void BackendDispatcher::CallbackBase::sendSuccess(RefPtr<JSON::Object>&& partialMessage)
 {
     if (m_alreadySent)
         return;
@@ -109,15 +109,15 @@ void BackendDispatcher::dispatch(const String& message)
     ASSERT(!m_protocolErrors.size());
 
     long requestId = 0;
-    RefPtr<InspectorObject> messageObject;
+    RefPtr<JSON::Object> messageObject;
 
     {
         // In case this is a re-entrant call from a nested run loop, we don't want to lose
         // the outer request's id just because the inner request is bogus.
         SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, std::nullopt);
 
-        RefPtr<InspectorValue> parsedMessage;
-        if (!InspectorValue::parseJSON(message, parsedMessage)) {
+        RefPtr<JSON::Value> parsedMessage;
+        if (!JSON::Value::parseJSON(message, parsedMessage)) {
             reportProtocolError(ParseError, ASCIILiteral("Message must be in JSON format"));
             sendPendingErrors();
             return;
@@ -129,7 +129,7 @@ void BackendDispatcher::dispatch(const String& message)
             return;
         }
 
-        RefPtr<InspectorValue> requestIdValue;
+        RefPtr<JSON::Value> requestIdValue;
         if (!messageObject->getValue(ASCIILiteral("id"), requestIdValue)) {
             reportProtocolError(InvalidRequest, ASCIILiteral("'id' property was not found"));
             sendPendingErrors();
@@ -147,7 +147,7 @@ void BackendDispatcher::dispatch(const String& message)
         // We could be called re-entrantly from a nested run loop, so restore the previous id.
         SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, requestId);
 
-        RefPtr<InspectorValue> methodValue;
+        RefPtr<JSON::Value> methodValue;
         if (!messageObject->getValue(ASCIILiteral("method"), methodValue)) {
             reportProtocolError(InvalidRequest, ASCIILiteral("'method' property wasn't found"));
             sendPendingErrors();
@@ -185,13 +185,13 @@ void BackendDispatcher::dispatch(const String& message)
     }
 }
 
-void BackendDispatcher::sendResponse(long requestId, RefPtr<InspectorObject>&& result)
+void BackendDispatcher::sendResponse(long requestId, RefPtr<JSON::Object>&& result)
 {
     ASSERT(!m_protocolErrors.size());
 
     // The JSON-RPC 2.0 specification requires that the "error" member have the value 'null'
     // if no error occurred during an invocation, but we do not include it at all.
-    Ref<InspectorObject> responseMessage = InspectorObject::create();
+    Ref<JSON::Object> responseMessage = JSON::Object::create();
     responseMessage->setObject(ASCIILiteral("result"), WTFMove(result));
     responseMessage->setInteger(ASCIILiteral("id"), requestId);
     m_frontendRouter->sendResponse(responseMessage->toJSONString());
@@ -214,7 +214,7 @@ void BackendDispatcher::sendPendingErrors()
     // but only one top-level Error object should be sent per request.
     CommonErrorCode errorCode = InternalError;
     String errorMessage;
-    Ref<InspectorArray> payload = InspectorArray::create();
+    Ref<JSON::Array> payload = JSON::Array::create();
     
     for (auto& data : m_protocolErrors) {
         errorCode = std::get<0>(data);
@@ -223,24 +223,24 @@ void BackendDispatcher::sendPendingErrors()
         ASSERT_ARG(errorCode, (unsigned)errorCode < WTF_ARRAY_LENGTH(errorCodes));
         ASSERT_ARG(errorCode, errorCodes[errorCode]);
 
-        Ref<InspectorObject> error = InspectorObject::create();
+        Ref<JSON::Object> error = JSON::Object::create();
         error->setInteger(ASCIILiteral("code"), errorCodes[errorCode]);
         error->setString(ASCIILiteral("message"), errorMessage);
         payload->pushObject(WTFMove(error));
     }
 
-    Ref<InspectorObject> topLevelError = InspectorObject::create();
+    Ref<JSON::Object> topLevelError = JSON::Object::create();
     topLevelError->setInteger(ASCIILiteral("code"), errorCodes[errorCode]);
     topLevelError->setString(ASCIILiteral("message"), errorMessage);
     topLevelError->setArray(ASCIILiteral("data"), WTFMove(payload));
 
-    Ref<InspectorObject> message = InspectorObject::create();
+    Ref<JSON::Object> message = JSON::Object::create();
     message->setObject(ASCIILiteral("error"), WTFMove(topLevelError));
     if (m_currentRequestId)
         message->setInteger(ASCIILiteral("id"), m_currentRequestId.value());
     else {
         // The 'null' value for an unknown id is specified in JSON-RPC 2.0, Section 5.
-        message->setValue(ASCIILiteral("id"), InspectorValue::null());
+        message->setValue(ASCIILiteral("id"), JSON::Value::null());
     }
 
     m_frontendRouter->sendResponse(message->toJSONString());
@@ -276,7 +276,7 @@ void BackendDispatcher::reportProtocolError(WTF::DeprecatedOptional<long> relate
 #endif
 
 template<typename T>
-T BackendDispatcher::getPropertyValue(InspectorObject* object, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(InspectorValue&, T&)> asMethod, const char* typeName)
+T BackendDispatcher::getPropertyValue(JSON::Object* object, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(JSON::Value&, T&)> asMethod, const char* typeName)
 {
     T result(defaultValue);
     // out_optionalValueFound signals to the caller whether an optional property was found.
@@ -308,42 +308,42 @@ T BackendDispatcher::getPropertyValue(InspectorObject* object, const String& nam
     return result;
 }
 
-static bool castToInteger(InspectorValue& value, int& result) { return value.asInteger(result); }
-static bool castToNumber(InspectorValue& value, double& result) { return value.asDouble(result); }
+static bool castToInteger(JSON::Value& value, int& result) { return value.asInteger(result); }
+static bool castToNumber(JSON::Value& value, double& result) { return value.asDouble(result); }
 
-int BackendDispatcher::getInteger(InspectorObject* object, const String& name, bool* valueFound)
+int BackendDispatcher::getInteger(JSON::Object* object, const String& name, bool* valueFound)
 {
     return getPropertyValue<int>(object, name, valueFound, 0, &castToInteger, "Integer");
 }
 
-double BackendDispatcher::getDouble(InspectorObject* object, const String& name, bool* valueFound)
+double BackendDispatcher::getDouble(JSON::Object* object, const String& name, bool* valueFound)
 {
     return getPropertyValue<double>(object, name, valueFound, 0, &castToNumber, "Number");
 }
 
-String BackendDispatcher::getString(InspectorObject* object, const String& name, bool* valueFound)
+String BackendDispatcher::getString(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<String>(object, name, valueFound, "", &InspectorValue::asString, "String");
+    return getPropertyValue<String>(object, name, valueFound, "", &JSON::Value::asString, "String");
 }
 
-bool BackendDispatcher::getBoolean(InspectorObject* object, const String& name, bool* valueFound)
+bool BackendDispatcher::getBoolean(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<bool>(object, name, valueFound, false, &InspectorValue::asBoolean, "Boolean");
+    return getPropertyValue<bool>(object, name, valueFound, false, &JSON::Value::asBoolean, "Boolean");
 }
 
-RefPtr<InspectorObject> BackendDispatcher::getObject(InspectorObject* object, const String& name, bool* valueFound)
+RefPtr<JSON::Object> BackendDispatcher::getObject(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<RefPtr<InspectorObject>>(object, name, valueFound, nullptr, &InspectorValue::asObject, "Object");
+    return getPropertyValue<RefPtr<JSON::Object>>(object, name, valueFound, nullptr, &JSON::Value::asObject, "Object");
 }
 
-RefPtr<InspectorArray> BackendDispatcher::getArray(InspectorObject* object, const String& name, bool* valueFound)
+RefPtr<JSON::Array> BackendDispatcher::getArray(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<RefPtr<InspectorArray>>(object, name, valueFound, nullptr, &InspectorValue::asArray, "Array");
+    return getPropertyValue<RefPtr<JSON::Array>>(object, name, valueFound, nullptr, &JSON::Value::asArray, "Array");
 }
 
-RefPtr<InspectorValue> BackendDispatcher::getValue(InspectorObject* object, const String& name, bool* valueFound)
+RefPtr<JSON::Value> BackendDispatcher::getValue(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<RefPtr<InspectorValue>>(object, name, valueFound, nullptr, &InspectorValue::asValue, "Value");
+    return getPropertyValue<RefPtr<JSON::Value>>(object, name, valueFound, nullptr, &JSON::Value::asValue, "Value");
 }
 
 } // namespace Inspector
index 9b60ee1..8c170fc 100644 (file)
@@ -44,7 +44,7 @@ class JS_EXPORT_PRIVATE SupplementalBackendDispatcher : public RefCounted<Supple
 public:
     SupplementalBackendDispatcher(BackendDispatcher&);
     virtual ~SupplementalBackendDispatcher();
-    virtual void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) = 0;
+    virtual void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) = 0;
 protected:
     Ref<BackendDispatcher> m_backendDispatcher;
 };
@@ -60,7 +60,7 @@ public:
         bool isActive() const;
         void disable() { m_alreadySent = true; }
 
-        void sendSuccess(RefPtr<InspectorObject>&&);
+        void sendSuccess(RefPtr<JSON::Object>&&);
         void sendFailure(const ErrorString&);
 
     private:
@@ -85,7 +85,7 @@ public:
     void registerDispatcherForDomain(const String& domain, SupplementalBackendDispatcher*);
     void dispatch(const String& message);
 
-    void sendResponse(long requestId, RefPtr<InspectorObject>&& result);
+    void sendResponse(long requestId, RefPtr<JSON::Object>&& result);
     void sendPendingErrors();
 
     void reportProtocolError(CommonErrorCode, const String& errorMessage);
@@ -93,15 +93,15 @@ public:
 
     template<typename T>
     WTF_HIDDEN_DECLARATION
-    T getPropertyValue(InspectorObject*, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(InspectorValue&, T&)>, const char* typeName);
-
-    int getInteger(InspectorObject*, const String& name, bool* valueFound);
-    double getDouble(InspectorObject*, const String& name, bool* valueFound);
-    String getString(InspectorObject*, const String& name, bool* valueFound);
-    bool getBoolean(InspectorObject*, const String& name, bool* valueFound);
-    RefPtr<InspectorValue> getValue(InspectorObject*, const String& name, bool* valueFound);
-    RefPtr<InspectorObject> getObject(InspectorObject*, const String& name, bool* valueFound);
-    RefPtr<InspectorArray> getArray(InspectorObject*, const String& name, bool* valueFound);
+    T getPropertyValue(JSON::Object*, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(JSON::Value&, T&)>, const char* typeName);
+
+    int getInteger(JSON::Object*, const String& name, bool* valueFound);
+    double getDouble(JSON::Object*, const String& name, bool* valueFound);
+    String getString(JSON::Object*, const String& name, bool* valueFound);
+    bool getBoolean(JSON::Object*, const String& name, bool* valueFound);
+    RefPtr<JSON::Value> getValue(JSON::Object*, const String& name, bool* valueFound);
+    RefPtr<JSON::Object> getObject(JSON::Object*, const String& name, bool* valueFound);
+    RefPtr<JSON::Array> getArray(JSON::Object*, const String& name, bool* valueFound);
 
 private:
     BackendDispatcher(Ref<FrontendRouter>&&);
index 5872b6d..ee65b2f 100644 (file)
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include "JSExportMacros.h"
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
index 248e58a..d8ff8fd 100644 (file)
@@ -26,8 +26,8 @@
 
 #pragma once
 
-#include "InspectorValues.h"
 #include <wtf/Assertions.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -62,14 +62,14 @@ private:
 };
 
 template<typename T>
-class Array : public InspectorArrayBase {
+class Array : public JSON::ArrayBase {
 private:
     Array() { }
 
-    InspectorArray& openAccessors()
+    JSON::Array& openAccessors()
     {
-        COMPILE_ASSERT(sizeof(InspectorArray) == sizeof(Array<T>), cannot_cast);
-        return *static_cast<InspectorArray*>(static_cast<InspectorArrayBase*>(this));
+        COMPILE_ASSERT(sizeof(JSON::Array) == sizeof(Array<T>), cannot_cast);
+        return *static_cast<JSON::Array*>(static_cast<JSON::ArrayBase*>(this));
     }
 
 public:
@@ -104,25 +104,25 @@ public:
     }
 };
 
-// Helper methods for Protocol and other Inspector types are provided by
+// Helper methods for Protocol and other JSON types are provided by
 // specializations of BindingTraits<T>. Some are generated for protocol types.
 
 template<typename T>
 struct BindingTraits {
     typedef T BindingType;
 
-    static void push(InspectorArray&, BindingType&);
-    static InspectorValue::Type typeTag();
-    static RefPtr<T> runtimeCast(RefPtr<InspectorObject>&&);
+    static void push(JSON::Array&, BindingType&);
+    static JSON::Value::Type typeTag();
+    static RefPtr<T> runtimeCast(RefPtr<JSON::Object>&&);
 #if !ASSERT_DISABLED
-    static void assertValueHasExpectedType(InspectorValue*);
+    static void assertValueHasExpectedType(JSON::Value*);
 #endif // !ASSERT_DISABLED
 };
 
-template<InspectorValue::Type TYPE>
+template<JSON::Value::Type TYPE>
 struct PrimitiveBindingTraits {
 #if !ASSERT_DISABLED
-    static void assertValueHasExpectedType(InspectorValue* value)
+    static void assertValueHasExpectedType(JSON::Value* value)
     {
         ASSERT_ARG(value, value && value->type() == TYPE);
     }
@@ -131,24 +131,24 @@ struct PrimitiveBindingTraits {
 
 template<typename T>
 struct BindingTraits<Protocol::Array<T>> {
-    static RefPtr<Array<T>> runtimeCast(RefPtr<InspectorValue>&& value)
+    static RefPtr<Array<T>> runtimeCast(RefPtr<JSON::Value>&& value)
     {
         ASSERT_ARG(value, value);
-        RefPtr<InspectorArray> array;
+        RefPtr<JSON::Array> array;
         bool castSucceeded = value->asArray(array);
         ASSERT_UNUSED(castSucceeded, castSucceeded);
 #if !ASSERT_DISABLED
         assertValueHasExpectedType(array.get());
 #endif // !ASSERT_DISABLED
-        COMPILE_ASSERT(sizeof(Array<T>) == sizeof(InspectorArray), type_cast_problem);
-        return static_cast<Array<T>*>(static_cast<InspectorArrayBase*>(array.get()));
+        COMPILE_ASSERT(sizeof(Array<T>) == sizeof(JSON::Array), type_cast_problem);
+        return static_cast<Array<T>*>(static_cast<JSON::ArrayBase*>(array.get()));
     }
 
 #if !ASSERT_DISABLED
-    static void assertValueHasExpectedType(InspectorValue* value)
+    static void assertValueHasExpectedType(JSON::Value* value)
     {
         ASSERT_ARG(value, value);
-        RefPtr<InspectorArray> array;
+        RefPtr<JSON::Array> array;
         bool castSucceeded = value->asArray(array);
         ASSERT_UNUSED(castSucceeded, castSucceeded);
         for (unsigned i = 0; i < array->length(); i++)
@@ -158,20 +158,20 @@ struct BindingTraits<Protocol::Array<T>> {
 };
 
 template<>
-struct BindingTraits<InspectorValue> {
+struct BindingTraits<JSON::Value> {
 #if !ASSERT_DISABLED
-    static void assertValueHasExpectedType(InspectorValue*)
+    static void assertValueHasExpectedType(JSON::Value*)
     {
     }
 #endif // !ASSERT_DISABLED
 };
 
-template<> struct BindingTraits<InspectorArray> : public PrimitiveBindingTraits<InspectorValue::Type::Array> { };
-template<> struct BindingTraits<InspectorObject> : public PrimitiveBindingTraits<InspectorValue::Type::Object> { };
-template<> struct BindingTraits<String> : public PrimitiveBindingTraits<InspectorValue::Type::String> { };
-template<> struct BindingTraits<bool> : public PrimitiveBindingTraits<InspectorValue::Type::Boolean> { };
-template<> struct BindingTraits<double> : public PrimitiveBindingTraits<InspectorValue::Type::Double> { };
-template<> struct BindingTraits<int> : public PrimitiveBindingTraits<InspectorValue::Type::Integer> { };
+template<> struct BindingTraits<JSON::Array> : public PrimitiveBindingTraits<JSON::Value::Type::Array> { };
+template<> struct BindingTraits<JSON::Object> : public PrimitiveBindingTraits<JSON::Value::Type::Object> { };
+template<> struct BindingTraits<String> : public PrimitiveBindingTraits<JSON::Value::Type::String> { };
+template<> struct BindingTraits<bool> : public PrimitiveBindingTraits<JSON::Value::Type::Boolean> { };
+template<> struct BindingTraits<double> : public PrimitiveBindingTraits<JSON::Value::Type::Double> { };
+template<> struct BindingTraits<int> : public PrimitiveBindingTraits<JSON::Value::Type::Integer> { };
 
 } // namespace Protocol
 
index 44627ab..a7300af 100644 (file)
@@ -32,8 +32,6 @@
 #include "config.h"
 #include "ScriptCallFrame.h"
 
-#include "InspectorValues.h"
-
 namespace Inspector {
 
 ScriptCallFrame::ScriptCallFrame(const String& functionName, const String& scriptName, JSC::SourceID sourceID, unsigned lineNumber, unsigned column)
index c0a7ae5..60dff77 100644 (file)
@@ -32,7 +32,6 @@
 #include "config.h"
 #include "ScriptCallStack.h"
 
-#include "InspectorValues.h"
 #include <wtf/DataLog.h>
 
 namespace Inspector {
index f64baf3..5e9026a 100644 (file)
@@ -33,8 +33,8 @@
 
 #include "InspectorEnvironment.h"
 #include "InspectorFrontendRouter.h"
-#include "InspectorValues.h"
 #include "ScriptValue.h"
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -90,7 +90,7 @@ void InspectorAgent::initialized(ErrorString&)
     m_environment.frontendInitialized();
 }
 
-void InspectorAgent::inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<InspectorObject>&& hints)
+void InspectorAgent::inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<JSON::Object>&& hints)
 {
     if (m_enabled) {
         m_frontendDispatcher->inspect(objectToInspect, hints);
index a9b0392..21c4456 100644 (file)
@@ -39,7 +39,6 @@ namespace Inspector {
 
 class BackendDispatcher;
 class InspectorEnvironment;
-class InspectorObject;
 
 typedef String ErrorString;
 
@@ -57,7 +56,7 @@ public:
     void disable(ErrorString&) override;
     void initialized(ErrorString&) override;
 
-    void inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<InspectorObject>&& hints);
+    void inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<JSON::Object>&& hints);
     void evaluateForTestInFrontend(const String& script);
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -71,7 +70,7 @@ private:
     Ref<InspectorBackendDispatcher> m_backendDispatcher;
 
     Vector<String> m_pendingEvaluateTestCommands;
-    std::pair<RefPtr<Protocol::Runtime::RemoteObject>, RefPtr<InspectorObject>> m_pendingInspectData;
+    std::pair<RefPtr<Protocol::Runtime::RemoteObject>, RefPtr<JSON::Object>> m_pendingInspectData;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     RefPtr<Inspector::Protocol::Array<String>> m_pendingExtraDomainsData;
 #endif
index 84370b1..b4e1e6e 100644 (file)
@@ -35,7 +35,6 @@
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
 #include "InspectorFrontendRouter.h"
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "RegularExpression.h"
 #include "ScriptCallStack.h"
@@ -43,6 +42,7 @@
 #include "ScriptDebugServer.h"
 #include "ScriptObject.h"
 #include "ScriptValue.h"
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/Stopwatch.h>
 #include <wtf/text/WTFString.h>
@@ -172,7 +172,7 @@ void InspectorDebuggerAgent::setSuppressAllPauses(bool suppress)
     m_scriptDebugServer.setSuppressAllPauses(suppress);
 }
 
-static RefPtr<InspectorObject> buildAssertPauseReason(const String& message)
+static RefPtr<JSON::Object> buildAssertPauseReason(const String& message)
 {
     auto reason = Inspector::Protocol::Debugger::AssertPauseReason::create().release();
     if (!message.isNull())
@@ -180,7 +180,7 @@ static RefPtr<InspectorObject> buildAssertPauseReason(const String& message)
     return reason->openAccessors();
 }
 
-static RefPtr<InspectorObject> buildCSPViolationPauseReason(const String& directiveText)
+static RefPtr<JSON::Object> buildCSPViolationPauseReason(const String& directiveText)
 {
     auto reason = Inspector::Protocol::Debugger::CSPViolationPauseReason::create()
         .setDirective(directiveText)
@@ -188,7 +188,7 @@ static RefPtr<InspectorObject> buildCSPViolationPauseReason(const String& direct
     return reason->openAccessors();
 }
 
-RefPtr<InspectorObject> InspectorDebuggerAgent::buildBreakpointPauseReason(JSC::BreakpointID debuggerBreakpointIdentifier)
+RefPtr<JSON::Object> InspectorDebuggerAgent::buildBreakpointPauseReason(JSC::BreakpointID debuggerBreakpointIdentifier)
 {
     ASSERT(debuggerBreakpointIdentifier != JSC::noBreakpointID);
     auto it = m_debuggerBreakpointIdentifierToInspectorBreakpointIdentifier.find(debuggerBreakpointIdentifier);
@@ -201,7 +201,7 @@ RefPtr<InspectorObject> InspectorDebuggerAgent::buildBreakpointPauseReason(JSC::
     return reason->openAccessors();
 }
 
-RefPtr<InspectorObject> InspectorDebuggerAgent::buildExceptionPauseReason(JSC::JSValue exception, const InjectedScript& injectedScript)
+RefPtr<JSON::Object> InspectorDebuggerAgent::buildExceptionPauseReason(JSC::JSValue exception, const InjectedScript& injectedScript)
 {
     ASSERT(exception);
     if (!exception)
@@ -315,9 +315,9 @@ void InspectorDebuggerAgent::didDispatchAsyncCall()
         m_pendingAsyncCalls.remove(identifier);
 }
 
-static Ref<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue, unsigned ignoreCount)
+static Ref<JSON::Object> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<JSON::Array>& actions, bool isRegex, bool autoContinue, unsigned ignoreCount)
 {
-    Ref<InspectorObject> breakpointObject = InspectorObject::create();
+    Ref<JSON::Object> breakpointObject = JSON::Object::create();
     breakpointObject->setString(ASCIILiteral("url"), url);
     breakpointObject->setInteger(ASCIILiteral("lineNumber"), lineNumber);
     breakpointObject->setInteger(ASCIILiteral("columnNumber"), columnNumber);
@@ -363,7 +363,7 @@ static bool breakpointActionTypeForString(const String& typeString, ScriptBreakp
     return false;
 }
 
-bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString& errorString, RefPtr<InspectorArray>& actions, BreakpointActions* result)
+bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString& errorString, RefPtr<JSON::Array>& actions, BreakpointActions* result)
 {
     if (!actions)
         return true;
@@ -374,8 +374,8 @@ bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString& errorStr
 
     result->reserveCapacity(actionsLength);
     for (unsigned i = 0; i < actionsLength; ++i) {
-        RefPtr<InspectorValue> value = actions->get(i);
-        RefPtr<InspectorObject> object;
+        RefPtr<JSON::Value> value = actions->get(i);
+        RefPtr<JSON::Object> object;
         if (!value->asObject(object)) {
             errorString = ASCIILiteral("BreakpointAction of incorrect type, expected object");
             return false;
@@ -420,7 +420,7 @@ static RefPtr<Inspector::Protocol::Debugger::Location> buildDebuggerLocation(con
     return WTFMove(location);
 }
 
-static bool parseLocation(ErrorString& errorString, const InspectorObject& location, JSC::SourceID& sourceID, unsigned& lineNumber, unsigned& columnNumber)
+static bool parseLocation(ErrorString& errorString, const JSON::Object& location, JSC::SourceID& sourceID, unsigned& lineNumber, unsigned& columnNumber)
 {
     String scriptIDStr;
     if (!location.getString(ASCIILiteral("scriptId"), scriptIDStr) || !location.getInteger(ASCIILiteral("lineNumber"), lineNumber)) {
@@ -435,7 +435,7 @@ static bool parseLocation(ErrorString& errorString, const InspectorObject& locat
     return true;
 }
 
-void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations)
+void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const JSON::Object* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations)
 {
     locations = Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>::create();
     if (!optionalURL == !optionalURLRegex) {
@@ -456,7 +456,7 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int li
     String condition = emptyString();
     bool autoContinue = false;
     unsigned ignoreCount = 0;
-    RefPtr<InspectorArray> actions;
+    RefPtr<JSON::Array> actions;
     if (options) {
         options->getString(ASCIILiteral("condition"), condition);
         options->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
@@ -496,7 +496,7 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int li
     *outBreakpointIdentifier = breakpointIdentifier;
 }
 
-void InspectorDebuggerAgent::setBreakpoint(ErrorString& errorString, const InspectorObject& location, const InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation)
+void InspectorDebuggerAgent::setBreakpoint(ErrorString& errorString, const JSON::Object& location, const JSON::Object* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation)
 {
     JSC::SourceID sourceID;
     unsigned lineNumber;
@@ -507,7 +507,7 @@ void InspectorDebuggerAgent::setBreakpoint(ErrorString& errorString, const Inspe
     String condition = emptyString();
     bool autoContinue = false;
     unsigned ignoreCount = 0;
-    RefPtr<InspectorArray> actions;
+    RefPtr<JSON::Array> actions;
     if (options) {
         options->getString(ASCIILiteral("condition"), condition);
         options->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
@@ -604,7 +604,7 @@ void InspectorDebuggerAgent::continueUntilNextRunLoop(ErrorString& errorString)
     registerIdleHandler();
 }
 
-void InspectorDebuggerAgent::continueToLocation(ErrorString& errorString, const InspectorObject& location)
+void InspectorDebuggerAgent::continueToLocation(ErrorString& errorString, const JSON::Object& location)
 {
     if (!assertPaused(errorString))
         return;
@@ -695,7 +695,7 @@ void InspectorDebuggerAgent::getFunctionDetails(ErrorString& errorString, const
     injectedScript.getFunctionDetails(errorString, functionId, &details);
 }
 
-void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data)
+void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<JSON::Object>&& data)
 {
     if (m_javaScriptPauseScheduled)
         return;
@@ -909,7 +909,7 @@ void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script
         return;
 
     for (auto& entry : m_javaScriptBreakpoints) {
-        RefPtr<InspectorObject> breakpointObject = entry.value;
+        RefPtr<JSON::Object> breakpointObject = entry.value;
 
         bool isRegex;
         String url;
@@ -925,7 +925,7 @@ void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script
         breakpointObject->getBoolean(ASCIILiteral("autoContinue"), scriptBreakpoint.autoContinue);
         breakpointObject->getInteger(ASCIILiteral("ignoreCount"), scriptBreakpoint.ignoreCount);
         ErrorString errorString;
-        RefPtr<InspectorArray> actions;
+        RefPtr<JSON::Array> actions;
         breakpointObject->getArray(ASCIILiteral("actions"), actions);
         if (!breakpointActionsFromProtocol(errorString, actions, &scriptBreakpoint.actions)) {
             ASSERT_NOT_REACHED();
@@ -1061,7 +1061,7 @@ void InspectorDebuggerAgent::didContinue()
         m_frontendDispatcher->resumed();
 }
 
-void InspectorDebuggerAgent::breakProgram(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data)
+void InspectorDebuggerAgent::breakProgram(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<JSON::Object>&& data)
 {
     m_breakReason = breakReason;
     m_breakAuxData = WTFMove(data);
index 2292dbb..551620e 100644 (file)
@@ -46,8 +46,6 @@ namespace Inspector {
 class AsyncStackTrace;
 class InjectedScript;
 class InjectedScriptManager;
-class InspectorArray;
-class InspectorObject;
 class ScriptDebugServer;
 typedef String ErrorString;
 
@@ -66,11 +64,11 @@ public:
     void disable(ErrorString&) final;
     void setAsyncStackTraceDepth(ErrorString&, int depth) final;
     void setBreakpointsActive(ErrorString&, bool active) final;
-    void setBreakpointByUrl(ErrorString&, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const Inspector::InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) final;
-    void setBreakpoint(ErrorString&, const Inspector::InspectorObject& location, const Inspector::InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation) final;
+    void setBreakpointByUrl(ErrorString&, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const JSON::Object* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) final;
+    void setBreakpoint(ErrorString&, const JSON::Object& location, const JSON::Object* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation) final;
     void removeBreakpoint(ErrorString&, const String& breakpointIdentifier) final;
     void continueUntilNextRunLoop(ErrorString&) final;
-    void continueToLocation(ErrorString&, const InspectorObject& location) final;
+    void continueToLocation(ErrorString&, const JSON::Object& location) final;
     void searchInContent(ErrorString&, const String& scriptID, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&) final;
     void getScriptSource(ErrorString&, const String& scriptID, String* scriptSource) final;
     void getFunctionDetails(ErrorString&, const String& functionId, RefPtr<Inspector::Protocol::Debugger::FunctionDetails>&) final;
@@ -103,11 +101,11 @@ public:
     void willDispatchAsyncCall(AsyncCallType, int callbackId);
     void didDispatchAsyncCall();
 
-    void schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data);
+    void schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<JSON::Object>&& data);
     void cancelPauseOnNextStatement();
     bool pauseOnNextStatementEnabled() const { return m_javaScriptPauseScheduled; }
 
-    void breakProgram(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data);
+    void breakProgram(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<JSON::Object>&& data);
     void scriptExecutionBlockedByCSP(const String& directiveText);
 
     class Listener {
@@ -164,17 +162,17 @@ private:
     void willStepAndMayBecomeIdle();
     void didBecomeIdle();
 
-    RefPtr<InspectorObject> buildBreakpointPauseReason(JSC::BreakpointID);
-    RefPtr<InspectorObject> buildExceptionPauseReason(JSC::JSValue exception, const InjectedScript&);
+    RefPtr<JSON::Object> buildBreakpointPauseReason(JSC::BreakpointID);
+    RefPtr<JSON::Object> buildExceptionPauseReason(JSC::JSValue exception, const InjectedScript&);
 
-    bool breakpointActionsFromProtocol(ErrorString&, RefPtr<InspectorArray>& actions, BreakpointActions* result);
+    bool breakpointActionsFromProtocol(ErrorString&, RefPtr<JSON::Array>& actions, BreakpointActions* result);
 
     typedef std::pair<unsigned, int> AsyncCallIdentifier;
     static AsyncCallIdentifier asyncCallIdentifier(AsyncCallType, int callbackId);
 
     typedef HashMap<JSC::SourceID, Script> ScriptsMap;
     typedef HashMap<String, Vector<JSC::BreakpointID>> BreakpointIdentifierToDebugServerBreakpointIDsMap;
-    typedef HashMap<String, RefPtr<InspectorObject>> BreakpointIdentifierToBreakpointMap;
+    typedef HashMap<String, RefPtr<JSON::Object>> BreakpointIdentifierToBreakpointMap;
     typedef HashMap<JSC::BreakpointID, String> DebugServerBreakpointIDToBreakpointIdentifier;
 
     InjectedScriptManager& m_injectedScriptManager;
@@ -190,7 +188,7 @@ private:
     DebugServerBreakpointIDToBreakpointIdentifier m_debuggerBreakpointIdentifierToInspectorBreakpointIdentifier;
     JSC::BreakpointID m_continueToLocationBreakpointID;
     DebuggerFrontendDispatcher::Reason m_breakReason;
-    RefPtr<InspectorObject> m_breakAuxData;
+    RefPtr<JSON::Object> m_breakAuxData;
     ShouldDispatchResumed m_conditionToDispatchResumed { ShouldDispatchResumed::No };
     bool m_enablePauseWhenIdle { false };
     HashMap<AsyncCallIdentifier, RefPtr<AsyncStackTrace>> m_pendingAsyncCalls;
index 4d61f49..d2260e5 100644 (file)
@@ -38,7 +38,6 @@
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
 #include "InspectorFrontendRouter.h"
-#include "InspectorValues.h"
 #include "JSLock.h"
 #include "ParserError.h"
 #include "ScriptDebugServer.h"
@@ -46,6 +45,7 @@
 #include "TypeProfiler.h"
 #include "TypeProfilerLog.h"
 #include <wtf/CurrentTime.h>
+#include <wtf/JSONValues.h>
 
 using namespace JSC;
 
@@ -132,7 +132,7 @@ void InspectorRuntimeAgent::evaluate(ErrorString& errorString, const String& exp
     }
 }
 
-void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const InspectorArray* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown)
+void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown)
 {
     InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
     if (injectedScript.hasNoValue()) {
@@ -225,7 +225,7 @@ void InspectorRuntimeAgent::getCollectionEntries(ErrorString& errorString, const
     injectedScript.getCollectionEntries(errorString, objectId, objectGroup ? *objectGroup : String(), start, fetch, &entries);
 }
 
-void InspectorRuntimeAgent::saveResult(ErrorString& errorString, const Inspector::InspectorObject& callArgument, const int* executionContextId, Inspector::Protocol::OptOutput<int>* savedResultIndex)
+void InspectorRuntimeAgent::saveResult(ErrorString& errorString, const JSON::Object& callArgument, const int* executionContextId, Inspector::Protocol::OptOutput<int>* savedResultIndex)
 {
     InjectedScript injectedScript;
 
@@ -257,7 +257,7 @@ void InspectorRuntimeAgent::releaseObjectGroup(ErrorString&, const String& objec
     m_injectedScriptManager.releaseObjectGroup(objectGroup);
 }
 
-void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& errorString, const Inspector::InspectorArray& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>& typeDescriptions)
+void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& errorString, const JSON::Array& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>& typeDescriptions)
 {
     static const bool verbose = false;
 
@@ -271,8 +271,8 @@ void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& er
     m_vm.typeProfilerLog()->processLogEntries(ASCIILiteral("User Query"));
 
     for (size_t i = 0; i < locations.length(); i++) {
-        RefPtr<Inspector::InspectorValue> value = locations.get(i);
-        RefPtr<InspectorObject> location;
+        RefPtr<JSON::Value> value = locations.get(i);
+        RefPtr<JSON::Object> location;
         if (!value->asObject(location)) {
             errorString = ASCIILiteral("Array of TypeLocation objects has an object that does not have type of TypeLocation.");
             return;
index 31431d3..e2a152a 100644 (file)
@@ -44,7 +44,6 @@ namespace Inspector {
 
 class InjectedScript;
 class InjectedScriptManager;
-class InspectorArray;
 class ScriptDebugServer;
 typedef String ErrorString;
 
@@ -59,15 +58,15 @@ public:
     void disable(ErrorString&) override { m_enabled = false; }
     void parse(ErrorString&, const String& expression, Inspector::Protocol::Runtime::SyntaxErrorType* result, Inspector::Protocol::OptOutput<String>* message, RefPtr<Inspector::Protocol::Runtime::ErrorRange>&) final;
     void evaluate(ErrorString&, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const int* const executionContextId, const bool* const returnByValue, const bool* const generatePreview, const bool* const saveResult, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown, Inspector::Protocol::OptOutput<int>* savedResultIndex) final;
-    void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const Inspector::InspectorArray* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* const generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown) final;
+    void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* const generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown) final;
     void releaseObject(ErrorString&, const ErrorString& objectId) final;
     void getPreview(ErrorString&, const String& objectId, RefPtr<Inspector::Protocol::Runtime::ObjectPreview>&) final;
     void getProperties(ErrorString&, const String& objectId, const bool* const ownProperties, const bool* const generatePreview, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties) final;
     void getDisplayableProperties(ErrorString&, const String& objectId, const bool* const generatePreview, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties) final;
     void getCollectionEntries(ErrorString&, const String& objectId, const String* const objectGroup, const int* const startIndex, const int* const numberToFetch, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::CollectionEntry>>& entries) final;
-    void saveResult(ErrorString&, const Inspector::InspectorObject& callArgument, const int* const executionContextId, Inspector::Protocol::OptOutput<int>* savedResultIndex) final;
+    void saveResult(ErrorString&, const JSON::Object& callArgument, const int* const executionContextId, Inspector::Protocol::OptOutput<int>* savedResultIndex) final;
     void releaseObjectGroup(ErrorString&, const String& objectGroup) final;
-    void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const Inspector::InspectorArray& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>&) override;
+    void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const JSON::Array& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>&) override;
     void enableTypeProfiler(ErrorString&) override;
     void disableTypeProfiler(ErrorString&) override;
     void enableControlFlowProfiler(ErrorString&) override;
index 992622b..0fce11b 100755 (executable)
@@ -214,4 +214,4 @@ class CppBackendDispatcherHeaderGenerator(CppGenerator):
         return self.wrap_with_guard_for_domain(domain, Template(CppTemplates.BackendDispatcherHeaderDomainDispatcherDeclaration).substitute(None, **handler_args))
 
     def _generate_dispatcher_declaration_for_command(self, command):
-        return "    void %s(long requestId, RefPtr<InspectorObject>&& parameters);" % command.command_name
+        return "    void %s(long requestId, RefPtr<JSON::Object>&& parameters);" % command.command_name
index fccedcb..0ad18f3 100755 (executable)
@@ -50,7 +50,7 @@ class CppBackendDispatcherImplementationGenerator(CppGenerator):
     def generate_output(self):
         secondary_headers = [
             '<inspector/InspectorFrontendRouter.h>',
-            '<inspector/InspectorValues.h>',
+            '<wtf/JSONValues.h>',
             '<wtf/NeverDestroyed.h>',
             '<wtf/text/CString.h>']
 
@@ -277,9 +277,9 @@ class CppBackendDispatcherImplementationGenerator(CppGenerator):
 
         lines = []
         if len(command.call_parameters) == 0:
-            lines.append('void %(domainName)sBackendDispatcher::%(commandName)s(long requestId, RefPtr<InspectorObject>&&)' % command_args)
+            lines.append('void %(domainName)sBackendDispatcher::%(commandName)s(long requestId, RefPtr<JSON::Object>&&)' % command_args)
         else:
-            lines.append('void %(domainName)sBackendDispatcher::%(commandName)s(long requestId, RefPtr<InspectorObject>&& parameters)' % command_args)
+            lines.append('void %(domainName)sBackendDispatcher::%(commandName)s(long requestId, RefPtr<JSON::Object>&& parameters)' % command_args)
         lines.append('{')
 
         if len(command.call_parameters) > 0:
@@ -295,7 +295,7 @@ class CppBackendDispatcherImplementationGenerator(CppGenerator):
             lines.append('')
 
         lines.append('    ErrorString error;')
-        lines.append('    Ref<InspectorObject> result = InspectorObject::create();')
+        lines.append('    Ref<JSON::Object> result = JSON::Object::create();')
         if command.is_async:
             lines.append('    Ref<%(domainName)sBackendDispatcherHandler::%(callbackName)s> callback = adoptRef(*new %(domainName)sBackendDispatcherHandler::%(callbackName)s(m_backendDispatcher.copyRef(), requestId));' % command_args)
         if len(command.return_parameters) > 0:
index ed58b1e..b42bba5 100755 (executable)
@@ -51,7 +51,7 @@ class CppFrontendDispatcherHeaderGenerator(CppGenerator):
     def generate_output(self):
         headers = [
             '"%sProtocolObjects.h"' % self.protocol_name(),
-            '<inspector/InspectorValues.h>',
+            '<wtf/JSONValues.h>',
             '<wtf/text/WTFString.h>']
 
         header_args = {
index d9d336f..fc2bebf 100755 (executable)
@@ -111,11 +111,11 @@ class CppFrontendDispatcherImplementationGenerator(CppGenerator):
 
         lines.append('void %(domainName)sFrontendDispatcher::%(eventName)s(%(formalParameters)s)' % event_args)
         lines.append('{')
-        lines.append('    Ref<InspectorObject> jsonMessage = InspectorObject::create();')
+        lines.append('    Ref<JSON::Object> jsonMessage = JSON::Object::create();')
         lines.append('    jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("%(domainName)s.%(eventName)s"));' % event_args)
 
         if len(parameter_assignments) > 0:
-            lines.append('    Ref<InspectorObject> paramsObject = InspectorObject::create();')
+            lines.append('    Ref<JSON::Object> paramsObject = JSON::Object::create();')
             lines.extend(parameter_assignments)
             lines.append('    jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject));')
 
index b950565..12e0953 100755 (executable)
@@ -326,11 +326,11 @@ class CppProtocolTypesHeaderGenerator(CppGenerator):
         lines.append('    void set%(camelName)s(%(parameterType)s value)' % setter_args)
         lines.append('    {')
         if isinstance(type_member.type, EnumType):
-            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol::%(helpersNamespace)s::getEnumConstantValue(value));' % setter_args)
+            lines.append('        JSON::ObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol::%(helpersNamespace)s::getEnumConstantValue(value));' % setter_args)
         elif CppGenerator.should_use_references_for_type(type_member.type):
-            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), WTFMove(value));' % setter_args)
+            lines.append('        JSON::ObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), WTFMove(value));' % setter_args)
         else:
-            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), value);' % setter_args)
+            lines.append('        JSON::ObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), value);' % setter_args)
         lines.append('    }')
         return '\n'.join(lines)
 
index dd1d01f..3530ad7 100755 (executable)
@@ -201,7 +201,7 @@ class CppProtocolTypesImplementationGenerator(CppGenerator):
         lines.append('void BindingTraits<%s>::assertValueHasExpectedType(JSON::Value* value)' % (CppGenerator.cpp_protocol_type_for_type(object_declaration.type)))
         lines.append("""{
     ASSERT_ARG(value, value);
-    RefPtr<InspectorObject> object;
+    RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);""")
         for type_member in required_members:
@@ -211,7 +211,7 @@ class CppProtocolTypesImplementationGenerator(CppGenerator):
             }
 
             lines.append("""    {
-        InspectorObject::iterator %(memberName)sPos = object->find(ASCIILiteral("%(memberName)s"));
+        JSON::Object::iterator %(memberName)sPos = object->find(ASCIILiteral("%(memberName)s"));
         ASSERT(%(memberName)sPos != object->end());
         %(assertMethod)s(%(memberName)sPos->value.get());
     }""" % args)
@@ -227,7 +227,7 @@ class CppProtocolTypesImplementationGenerator(CppGenerator):
             }
 
             lines.append("""    {
-        InspectorObject::iterator %(memberName)sPos = object->find(ASCIILiteral("%(memberName)s"));
+        JSON::Object::iterator %(memberName)sPos = object->find(ASCIILiteral("%(memberName)s"));
         if (%(memberName)sPos != object->end()) {
             %(assertMethod)s(%(memberName)sPos->value.get());""" % args)
 
index 0b1055d..39bcae6 100755 (executable)
@@ -53,7 +53,7 @@ class ObjCBackendDispatcherImplementationGenerator(ObjCGenerator):
         secondary_headers = [
             '"%sInternal.h"' % self.protocol_name(),
             '"%sTypeConversions.h"' % self.protocol_name(),
-            '<JavaScriptCore/InspectorValues.h>',
+            '<wtf/JSONValues.h>',
         ]
 
         header_args = {
@@ -112,7 +112,7 @@ class ObjCBackendDispatcherImplementationGenerator(ObjCGenerator):
             lines.append('    id successCallback = ^{')
 
         if command.return_parameters:
-            lines.append('        Ref<InspectorObject> resultObject = InspectorObject::create();')
+            lines.append('        Ref<JSON::Object> resultObject = JSON::Object::create();')
 
             required_pointer_parameters = filter(lambda parameter: not parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), command.return_parameters)
             for parameter in required_pointer_parameters:
@@ -142,7 +142,7 @@ class ObjCBackendDispatcherImplementationGenerator(ObjCGenerator):
                     lines.append('            resultObject->%s(ASCIILiteral("%s"), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
             lines.append('        backendDispatcher()->sendResponse(requestId, WTFMove(resultObject));')
         else:
-            lines.append('        backendDispatcher()->sendResponse(requestId, InspectorObject::create());')
+            lines.append('        backendDispatcher()->sendResponse(requestId, JSON::Object::create());')
 
         lines.append('    };')
         return '\n'.join(lines)
index 722d5d3..be37efa 100755 (executable)
@@ -50,7 +50,7 @@ class ObjCFrontendDispatcherImplementationGenerator(ObjCGenerator):
     def generate_output(self):
         secondary_headers = [
             '"%sTypeConversions.h"' % self.protocol_name(),
-            '<JavaScriptCore/InspectorValues.h>',
+            '<wtf/JSONValues.h>',
         ]
 
         header_args = {
@@ -119,7 +119,7 @@ class ObjCFrontendDispatcherImplementationGenerator(ObjCGenerator):
         if required_pointer_parameters or optional_pointer_parameters:
             lines.append('')
 
-        lines.append('    Ref<InspectorObject> jsonMessage = InspectorObject::create();')
+        lines.append('    Ref<JSON::Object> jsonMessage = JSON::Object::create();')
         lines.append('    jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("%s.%s"));' % (domain.domain_name, event.event_name))
         if event.event_parameters:
             lines.extend(self._generate_event_out_parameters(domain, event))
@@ -139,7 +139,7 @@ class ObjCFrontendDispatcherImplementationGenerator(ObjCGenerator):
 
     def _generate_event_out_parameters(self, domain, event):
         lines = []
-        lines.append('    Ref<InspectorObject> paramsObject = InspectorObject::create();')
+        lines.append('    Ref<JSON::Object> paramsObject = JSON::Object::create();')
         for parameter in event.event_parameters:
             keyed_set_method = CppGenerator.cpp_setter_method_for_type(parameter.type)
             var_name = parameter.parameter_name
index 9f06ced..b6e4ad5 100755 (executable)
@@ -47,8 +47,8 @@ class ObjCInternalHeaderGenerator(ObjCGenerator):
         headers = set([
             '"%s.h"' % self.protocol_name(),
             '"%sJSONObjectPrivate.h"' % self.protocol_name(),
-            '<JavaScriptCore/InspectorValues.h>',
             '<JavaScriptCore/AugmentableInspectorController.h>',
+            '<wtf/JSONValues.h>',
         ])
 
         header_args = {
index 9977483..1a66488 100755 (executable)
@@ -57,8 +57,8 @@ class ObjCProtocolTypesImplementationGenerator(ObjCGenerator):
         secondary_headers = [
             '"%sTypeConversions.h"' % self.protocol_name(),
             Generator.string_for_file_include('%sJSONObjectPrivate.h' % ObjCGenerator.OBJC_STATIC_PREFIX, Frameworks.WebInspector, self.model().framework),
-            '<JavaScriptCore/InspectorValues.h>',
             '<wtf/Assertions.h>',
+            '<wtf/JSONValues.h>',
         ]
 
         # The FooProtocolInternal.h header is only needed to declare the backend-side event dispatcher bindings.
index a5cfc3c..fc24343 100755 (executable)
@@ -49,7 +49,7 @@ _ENUM_IDENTIFIER_RENAME_MAP = {
     'webrtc': 'WebRTC',  # Console.ChannelSource.webrtc
 }
 
-# These objects are built manually by creating and setting InspectorValues.
+# These objects are built manually by creating and setting JSON::Value instances.
 # Before sending these over the protocol, their shapes are checked against the specification.
 # So, any types referenced by these types require debug-only assertions that check values.
 # Calculating necessary assertions is annoying, and adds a lot of complexity to the generator.
index 3f783cd..d32a1d7 100644 (file)
@@ -154,7 +154,7 @@ public:
     static Ref<NetworkBackendDispatcher> create(BackendDispatcher&, NetworkBackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void loadResource(long requestId, RefPtr<InspectorObject>&& parameters);
+    void loadResource(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateNetworkBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -204,7 +204,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -241,7 +241,7 @@ void NetworkBackendDispatcher::dispatch(long requestId, const String& method, Re
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Network", '.', method, "' was not found"));
 }
 
-void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<InspectorObject>&&)
+void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -251,7 +251,7 @@ void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<InspectorObje
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource(error);
 
     if (!error.length())
@@ -298,7 +298,7 @@ void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<InspectorObje
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -357,7 +357,7 @@ namespace Inspector {
 
 void NetworkFrontendDispatcher::resourceLoaded()
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network.resourceLoaded"));
 
     m_frontendRouter.sendEvent(jsonMessage->toJSONString());
@@ -628,7 +628,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -640,7 +640,7 @@ void ObjCInspectorNetworkBackendDispatcher::loadResource(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResourceWithErrorCallback:errorCallback successCallback:successCallback];
@@ -823,7 +823,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -846,7 +846,7 @@ using namespace Inspector;
 {
     const FrontendRouter& router = _controller->frontendRouter();
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network.resourceLoaded"));
     router.sendEvent(jsonMessage->toJSONString());
 }
@@ -960,7 +960,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 @interface TestProtocolNetworkDomainEventDispatcher (Private)
 - (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
@@ -1135,8 +1135,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index a36729e..4c085e9 100644 (file)
@@ -180,10 +180,10 @@ public:
     static Ref<DatabaseBackendDispatcher> create(BackendDispatcher&, DatabaseBackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void executeSQLSyncOptionalReturnValues(long requestId, RefPtr<InspectorObject>&& parameters);
-    void executeSQLAsyncOptionalReturnValues(long requestId, RefPtr<InspectorObject>&& parameters);
-    void executeSQLSync(long requestId, RefPtr<InspectorObject>&& parameters);
-    void executeSQLAsync(long requestId, RefPtr<InspectorObject>&& parameters);
+    void executeSQLSyncOptionalReturnValues(long requestId, RefPtr<JSON::Object>&& parameters);
+    void executeSQLAsyncOptionalReturnValues(long requestId, RefPtr<JSON::Object>&& parameters);
+    void executeSQLSync(long requestId, RefPtr<JSON::Object>&& parameters);
+    void executeSQLAsync(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateDatabaseBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -233,7 +233,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -276,7 +276,7 @@ void DatabaseBackendDispatcher::dispatch(long requestId, const String& method, R
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Database", '.', method, "' was not found"));
 }
 
-void DatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long requestId, RefPtr<InspectorObject>&& parameters)
+void DatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long requestId, RefPtr<JSON::Object>&& parameters)
 {
     int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr);
     String in_query = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("query"), nullptr);
@@ -293,7 +293,7 @@ void DatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long requestI
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
     Inspector::Protocol::OptOutput<String> out_notes;
     Inspector::Protocol::OptOutput<double> out_timestamp;
@@ -362,7 +362,7 @@ void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallba
     CallbackBase::sendSuccess(WTFMove(jsonMessage));
 }
 
-void DatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long requestId, RefPtr<InspectorObject>&& parameters)
+void DatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long requestId, RefPtr<JSON::Object>&& parameters)
 {
     int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr);
     String in_query = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("query"), nullptr);
@@ -379,7 +379,7 @@ void DatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long request
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     Ref<DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback> callback = adoptRef(*new DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback(m_backendDispatcher.copyRef(), requestId));
     m_agent->executeSQLAsyncOptionalReturnValues(error, in_databaseId, in_query, callback.copyRef());
 
@@ -390,7 +390,7 @@ void DatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long request
     }
 }
 
-void DatabaseBackendDispatcher::executeSQLSync(long requestId, RefPtr<InspectorObject>&& parameters)
+void DatabaseBackendDispatcher::executeSQLSync(long requestId, RefPtr<JSON::Object>&& parameters)
 {
     int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr);
     String in_query = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("query"), nullptr);
@@ -407,7 +407,7 @@ void DatabaseBackendDispatcher::executeSQLSync(long requestId, RefPtr<InspectorO
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
     String out_notes;
     double out_timestamp;
@@ -456,7 +456,7 @@ void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuccess(RefP
     CallbackBase::sendSuccess(WTFMove(jsonMessage));
 }
 
-void DatabaseBackendDispatcher::executeSQLAsync(long requestId, RefPtr<InspectorObject>&& parameters)
+void DatabaseBackendDispatcher::executeSQLAsync(long requestId, RefPtr<JSON::Object>&& parameters)
 {
     int in_databaseId = m_backendDispatcher->getInteger(parameters.get(), ASCIILiteral("databaseId"), nullptr);
     String in_query = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("query"), nullptr);
@@ -473,7 +473,7 @@ void DatabaseBackendDispatcher::executeSQLAsync(long requestId, RefPtr<Inspector
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     Ref<DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback> callback = adoptRef(*new DatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback(m_backendDispatcher.copyRef(), requestId));
     m_agent->executeSQLAsync(error, in_databaseId, in_query, callback.copyRef());
 
@@ -522,7 +522,7 @@ void DatabaseBackendDispatcher::executeSQLAsync(long requestId, RefPtr<Inspector
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -910,7 +910,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -922,7 +922,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor *printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        Ref<JSON::Object> resultObject = JSON::Object::create();
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
@@ -966,7 +966,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor *printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        Ref<JSON::Object> resultObject = JSON::Object::create();
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
@@ -1010,7 +1010,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLSync(long requestId, int
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabasePrimaryColors screenColor, TestProtocolDatabaseExecuteSQLSyncPrintColor printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        Ref<JSON::Object> resultObject = JSON::Object::create();
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
@@ -1044,7 +1044,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsync(long requestId, int
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, TestProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabaseExecuteSQLAsyncPrintColor printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        Ref<JSON::Object> resultObject = JSON::Object::create();
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
@@ -1237,7 +1237,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -1381,7 +1381,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1712,8 +1712,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 630cb05..b1fa6a1 100644 (file)
@@ -163,8 +163,8 @@ public:
     static Ref<DatabaseBackendDispatcher> create(BackendDispatcher&, DatabaseBackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void executeAllOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters);
-    void executeNoOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters);
+    void executeAllOptionalParameters(long requestId, RefPtr<JSON::Object>&& parameters);
+    void executeNoOptionalParameters(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateDatabaseBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -214,7 +214,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -253,7 +253,7 @@ void DatabaseBackendDispatcher::dispatch(long requestId, const String& method, R
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Database", '.', method, "' was not found"));
 }
 
-void DatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters)
+void DatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, RefPtr<JSON::Object>&& parameters)
 {
     bool opt_in_columnNames_valueFound = false;
     RefPtr<JSON::Array> opt_in_columnNames = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("columnNames"), &opt_in_columnNames_valueFound);
@@ -288,7 +288,7 @@ void DatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, Ref
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
     Inspector::Protocol::OptOutput<String> out_notes;
     Inspector::Protocol::OptOutput<double> out_timestamp;
@@ -329,7 +329,7 @@ void DatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, Ref
         m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
 }
 
-void DatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, RefPtr<InspectorObject>&& parameters)
+void DatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, RefPtr<JSON::Object>&& parameters)
 {
     RefPtr<JSON::Array> in_columnNames = m_backendDispatcher->getArray(parameters.get(), ASCIILiteral("columnNames"), nullptr);
     String in_notes = m_backendDispatcher->getString(parameters.get(), ASCIILiteral("notes"), nullptr);
@@ -354,7 +354,7 @@ void DatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, RefP
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
     String out_notes;
     double out_timestamp;
@@ -423,7 +423,7 @@ void DatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, RefP
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -809,7 +809,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -821,7 +821,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long r
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, TestProtocolDatabaseError **sqlError, TestProtocolDatabasePrimaryColors *screenColor, NSArray/*<NSString>*/ **alternateColors, TestProtocolDatabaseExecuteAllOptionalParametersPrintColor *printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        Ref<JSON::Object> resultObject = JSON::Object::create();
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
@@ -893,7 +893,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long re
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, TestProtocolDatabaseError *sqlError, TestProtocolDatabasePrimaryColors screenColor, NSArray/*<NSString>*/ *alternateColors, TestProtocolDatabaseExecuteNoOptionalParametersPrintColor printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        Ref<JSON::Object> resultObject = JSON::Object::create();
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
@@ -1102,7 +1102,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -1244,7 +1244,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1575,8 +1575,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 63d7a15..1bc9070 100644 (file)
@@ -168,7 +168,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -218,7 +218,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -452,7 +452,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -601,7 +601,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -698,7 +698,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -857,8 +857,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 2bd40d4..129f586 100644 (file)
@@ -169,7 +169,7 @@ public:
     static Ref<DomainABackendDispatcher> create(BackendDispatcher&, DomainABackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void enable(long requestId, RefPtr<InspectorObject>&& parameters);
+    void enable(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateDomainABackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -186,7 +186,7 @@ public:
     static Ref<DomainBBackendDispatcher> create(BackendDispatcher&, DomainBBackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void enable(long requestId, RefPtr<InspectorObject>&& parameters);
+    void enable(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateDomainBBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -236,7 +236,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -274,7 +274,7 @@ void DomainABackendDispatcher::dispatch(long requestId, const String& method, Re
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "DomainA", '.', method, "' was not found"));
 }
 
-void DomainABackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
+void DomainABackendDispatcher::enable(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -284,7 +284,7 @@ void DomainABackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->enable(error);
 
     if (!error.length())
@@ -318,7 +318,7 @@ void DomainBBackendDispatcher::dispatch(long requestId, const String& method, Re
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "DomainB", '.', method, "' was not found"));
 }
 
-void DomainBBackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
+void DomainBBackendDispatcher::enable(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -328,7 +328,7 @@ void DomainBBackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->enable(error);
 
     if (!error.length())
@@ -375,7 +375,7 @@ void DomainBBackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -626,7 +626,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -638,7 +638,7 @@ void ObjCInspectorDomainABackendDispatcher::enable(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback];
@@ -653,7 +653,7 @@ void ObjCInspectorDomainBBackendDispatcher::enable(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback];
@@ -847,7 +847,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -952,7 +952,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1111,8 +1111,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 6f4b271..8279781 100644 (file)
@@ -187,7 +187,7 @@ public:
     static Ref<Network1BackendDispatcher> create(BackendDispatcher&, Network1BackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void loadResource1(long requestId, RefPtr<InspectorObject>&& parameters);
+    void loadResource1(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateNetwork1BackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -204,13 +204,13 @@ public:
     static Ref<Network3BackendDispatcher> create(BackendDispatcher&, Network3BackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void loadResource1(long requestId, RefPtr<InspectorObject>&& parameters);
-    void loadResource2(long requestId, RefPtr<InspectorObject>&& parameters);
-    void loadResource3(long requestId, RefPtr<InspectorObject>&& parameters);
-    void loadResource4(long requestId, RefPtr<InspectorObject>&& parameters);
-    void loadResource5(long requestId, RefPtr<InspectorObject>&& parameters);
-    void loadResource6(long requestId, RefPtr<InspectorObject>&& parameters);
-    void loadResource7(long requestId, RefPtr<InspectorObject>&& parameters);
+    void loadResource1(long requestId, RefPtr<JSON::Object>&& parameters);
+    void loadResource2(long requestId, RefPtr<JSON::Object>&& parameters);
+    void loadResource3(long requestId, RefPtr<JSON::Object>&& parameters);
+    void loadResource4(long requestId, RefPtr<JSON::Object>&& parameters);
+    void loadResource5(long requestId, RefPtr<JSON::Object>&& parameters);
+    void loadResource6(long requestId, RefPtr<JSON::Object>&& parameters);
+    void loadResource7(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateNetwork3BackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -260,7 +260,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -298,7 +298,7 @@ void Network1BackendDispatcher::dispatch(long requestId, const String& method, R
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Network1", '.', method, "' was not found"));
 }
 
-void Network1BackendDispatcher::loadResource1(long requestId, RefPtr<InspectorObject>&&)
+void Network1BackendDispatcher::loadResource1(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -308,7 +308,7 @@ void Network1BackendDispatcher::loadResource1(long requestId, RefPtr<InspectorOb
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource1(error);
 
     if (!error.length())
@@ -366,7 +366,7 @@ void Network3BackendDispatcher::dispatch(long requestId, const String& method, R
     ((*this).*findResult->value)(requestId, WTFMove(parameters));
 }
 
-void Network3BackendDispatcher::loadResource1(long requestId, RefPtr<InspectorObject>&&)
+void Network3BackendDispatcher::loadResource1(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -376,7 +376,7 @@ void Network3BackendDispatcher::loadResource1(long requestId, RefPtr<InspectorOb
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource1(error);
 
     if (!error.length())
@@ -385,7 +385,7 @@ void Network3BackendDispatcher::loadResource1(long requestId, RefPtr<InspectorOb
         m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
 }
 
-void Network3BackendDispatcher::loadResource2(long requestId, RefPtr<InspectorObject>&&)
+void Network3BackendDispatcher::loadResource2(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -395,7 +395,7 @@ void Network3BackendDispatcher::loadResource2(long requestId, RefPtr<InspectorOb
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource2(error);
 
     if (!error.length())
@@ -404,7 +404,7 @@ void Network3BackendDispatcher::loadResource2(long requestId, RefPtr<InspectorOb
         m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
 }
 
-void Network3BackendDispatcher::loadResource3(long requestId, RefPtr<InspectorObject>&&)
+void Network3BackendDispatcher::loadResource3(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -414,7 +414,7 @@ void Network3BackendDispatcher::loadResource3(long requestId, RefPtr<InspectorOb
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource3(error);
 
     if (!error.length())
@@ -423,7 +423,7 @@ void Network3BackendDispatcher::loadResource3(long requestId, RefPtr<InspectorOb
         m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
 }
 
-void Network3BackendDispatcher::loadResource4(long requestId, RefPtr<InspectorObject>&&)
+void Network3BackendDispatcher::loadResource4(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -433,7 +433,7 @@ void Network3BackendDispatcher::loadResource4(long requestId, RefPtr<InspectorOb
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource4(error);
 
     if (!error.length())
@@ -442,7 +442,7 @@ void Network3BackendDispatcher::loadResource4(long requestId, RefPtr<InspectorOb
         m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
 }
 
-void Network3BackendDispatcher::loadResource5(long requestId, RefPtr<InspectorObject>&&)
+void Network3BackendDispatcher::loadResource5(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -452,7 +452,7 @@ void Network3BackendDispatcher::loadResource5(long requestId, RefPtr<InspectorOb
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource5(error);
 
     if (!error.length())
@@ -461,7 +461,7 @@ void Network3BackendDispatcher::loadResource5(long requestId, RefPtr<InspectorOb
         m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
 }
 
-void Network3BackendDispatcher::loadResource6(long requestId, RefPtr<InspectorObject>&&)
+void Network3BackendDispatcher::loadResource6(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -471,7 +471,7 @@ void Network3BackendDispatcher::loadResource6(long requestId, RefPtr<InspectorOb
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource6(error);
 
     if (!error.length())
@@ -480,7 +480,7 @@ void Network3BackendDispatcher::loadResource6(long requestId, RefPtr<InspectorOb
         m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
 }
 
-void Network3BackendDispatcher::loadResource7(long requestId, RefPtr<InspectorObject>&&)
+void Network3BackendDispatcher::loadResource7(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -490,7 +490,7 @@ void Network3BackendDispatcher::loadResource7(long requestId, RefPtr<InspectorOb
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource7(error);
 
     if (!error.length())
@@ -537,7 +537,7 @@ void Network3BackendDispatcher::loadResource7(long requestId, RefPtr<InspectorOb
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -799,7 +799,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -811,7 +811,7 @@ void ObjCInspectorNetwork1BackendDispatcher::loadResource1(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResource1WithErrorCallback:errorCallback successCallback:successCallback];
@@ -826,7 +826,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource1(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResource1WithErrorCallback:errorCallback successCallback:successCallback];
@@ -840,7 +840,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource2(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResource2WithErrorCallback:errorCallback successCallback:successCallback];
@@ -854,7 +854,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource3(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResource3WithErrorCallback:errorCallback successCallback:successCallback];
@@ -868,7 +868,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource4(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResource4WithErrorCallback:errorCallback successCallback:successCallback];
@@ -882,7 +882,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource5(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResource5WithErrorCallback:errorCallback successCallback:successCallback];
@@ -896,7 +896,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource6(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResource6WithErrorCallback:errorCallback successCallback:successCallback];
@@ -910,7 +910,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource7(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResource7WithErrorCallback:errorCallback successCallback:successCallback];
@@ -1104,7 +1104,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -1215,7 +1215,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1388,8 +1388,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 1e1a9f2..29d15f4 100644 (file)
@@ -169,7 +169,7 @@ public:
     static Ref<CommandDomainBackendDispatcher> create(BackendDispatcher&, CommandDomainBackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void commandWithEnumReturnValue(long requestId, RefPtr<InspectorObject>&& parameters);
+    void commandWithEnumReturnValue(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateCommandDomainBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -219,7 +219,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -256,7 +256,7 @@ void CommandDomainBackendDispatcher::dispatch(long requestId, const String& meth
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "CommandDomain", '.', method, "' was not found"));
 }
 
-void CommandDomainBackendDispatcher::commandWithEnumReturnValue(long requestId, RefPtr<InspectorObject>&&)
+void CommandDomainBackendDispatcher::commandWithEnumReturnValue(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -266,7 +266,7 @@ void CommandDomainBackendDispatcher::commandWithEnumReturnValue(long requestId,
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     CommandDomainBackendDispatcherHandler::ReturnValue out_returnValue;
     m_agent->commandWithEnumReturnValue(error, &out_returnValue);
 
@@ -317,7 +317,7 @@ void CommandDomainBackendDispatcher::commandWithEnumReturnValue(long requestId,
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -382,9 +382,9 @@ namespace Inspector {
 
 void EventDomainFrontendDispatcher::eventWithEnumParameter(Parameter parameter)
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    Ref<JSON::Object> paramsObject = JSON::Object::create();
     paramsObject->setString(ASCIILiteral("parameter"), Inspector::Protocol::TestHelpers::getEnumConstantValue(parameter));
     jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject));
 
@@ -659,7 +659,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -671,7 +671,7 @@ void ObjCInspectorCommandDomainBackendDispatcher::commandWithEnumReturnValue(lon
     };
 
     id successCallback = ^(TestProtocolCommandDomainCommandWithEnumReturnValueReturnValue returnValue) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        Ref<JSON::Object> resultObject = JSON::Object::create();
         resultObject->setString(ASCIILiteral("returnValue"), toProtocolString(returnValue));
         backendDispatcher()->sendResponse(requestId, WTFMove(resultObject));
     };
@@ -856,7 +856,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -879,9 +879,9 @@ using namespace Inspector;
 {
     const FrontendRouter& router = _controller->frontendRouter();
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    Ref<JSON::Object> paramsObject = JSON::Object::create();
     paramsObject->setString(ASCIILiteral("parameter"), toProtocolString(parameter));
     jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject));
     router.sendEvent(jsonMessage->toJSONString());
@@ -994,7 +994,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 @interface TestProtocolEventDomainDomainEventDispatcher (Private)
 - (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
@@ -1198,8 +1198,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index ffb9fe4..7bfc244 100644 (file)
@@ -174,7 +174,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -224,7 +224,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -284,9 +284,9 @@ namespace Inspector {
 
 void DatabaseFrontendDispatcher::didExecuteOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String* const notes, const double* const timestamp, RefPtr<JSON::Object> values, RefPtr<JSON::Value> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors* const screenColor, RefPtr<Inspector::Protocol::Database::ColorList> alternateColors, const String* const printColor)
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteOptionalParameters"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    Ref<JSON::Object> paramsObject = JSON::Object::create();
     if (columnNames)
         paramsObject->setArray(ASCIILiteral("columnNames"), columnNames);
     if (notes)
@@ -312,9 +312,9 @@ void DatabaseFrontendDispatcher::didExecuteOptionalParameters(RefPtr<Inspector::
 
 void DatabaseFrontendDispatcher::didExecuteNoOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, RefPtr<JSON::Object> values, RefPtr<JSON::Value> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors& screenColor, RefPtr<Inspector::Protocol::Database::ColorList> alternateColors, const String& printColor)
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteNoOptionalParameters"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    Ref<JSON::Object> paramsObject = JSON::Object::create();
     paramsObject->setArray(ASCIILiteral("columnNames"), columnNames);
     paramsObject->setString(ASCIILiteral("notes"), notes);
     paramsObject->setDouble(ASCIILiteral("timestamp"), timestamp);
@@ -594,7 +594,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -753,7 +753,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -785,9 +785,9 @@ using namespace Inspector;
     THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(alternateColors, @"alternateColors");
     THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(printColor, @"printColor");
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteOptionalParameters"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    Ref<JSON::Object> paramsObject = JSON::Object::create();
     if (columnNames)
         paramsObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray((*columnNames)));
     if (notes)
@@ -823,9 +823,9 @@ using namespace Inspector;
     THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(alternateColors, @"alternateColors");
     THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(printColor, @"printColor");
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteNoOptionalParameters"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    Ref<JSON::Object> paramsObject = JSON::Object::create();
     paramsObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames));
     paramsObject->setString(ASCIILiteral("notes"), notes);
     paramsObject->setDouble(ASCIILiteral("timestamp"), timestamp);
@@ -946,7 +946,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 @interface TestProtocolDatabaseDomainEventDispatcher (Private)
 - (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
@@ -1142,8 +1142,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 687943c..f098302 100644 (file)
@@ -164,7 +164,7 @@ public:
     static Ref<Network1BackendDispatcher> create(BackendDispatcher&, Network1BackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void loadResource(long requestId, RefPtr<InspectorObject>&& parameters);
+    void loadResource(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateNetwork1BackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -215,7 +215,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -255,7 +255,7 @@ void Network1BackendDispatcher::dispatch(long requestId, const String& method, R
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Network1", '.', method, "' was not found"));
 }
 
-void Network1BackendDispatcher::loadResource(long requestId, RefPtr<InspectorObject>&&)
+void Network1BackendDispatcher::loadResource(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -265,7 +265,7 @@ void Network1BackendDispatcher::loadResource(long requestId, RefPtr<InspectorObj
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource(error);
 
     if (!error.length())
@@ -313,7 +313,7 @@ void Network1BackendDispatcher::loadResource(long requestId, RefPtr<InspectorObj
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -375,7 +375,7 @@ namespace Inspector {
 #if PLATFORM(WEB_EVENTS)
 void Network3FrontendDispatcher::resourceLoaded()
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network3.resourceLoaded"));
 
     m_frontendRouter.sendEvent(jsonMessage->toJSONString());
@@ -653,7 +653,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -666,7 +666,7 @@ void ObjCInspectorNetwork1BackendDispatcher::loadResource(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResourceWithErrorCallback:errorCallback successCallback:successCallback];
@@ -850,7 +850,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -873,7 +873,7 @@ using namespace Inspector;
 {
     const FrontendRouter& router = _controller->frontendRouter();
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network3.resourceLoaded"));
     router.sendEvent(jsonMessage->toJSONString());
 }
@@ -987,7 +987,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 @interface TestProtocolNetwork3DomainEventDispatcher (Private)
 - (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
@@ -1162,8 +1162,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 176ad11..6f9a75e 100644 (file)
@@ -168,7 +168,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -218,7 +218,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -462,7 +462,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -611,7 +611,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -708,7 +708,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -897,8 +897,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 62f4264..d110eec 100644 (file)
@@ -168,7 +168,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -218,7 +218,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -397,12 +397,12 @@ public:
 
     void setString(const String& value)
     {
-        InspectorObjectBase::setString(ASCIILiteral("string"), value);
+        JSON::ObjectBase::setString(ASCIILiteral("string"), value);
     }
 
     void setArray(RefPtr<Inspector::Protocol::Array<String>> value)
     {
-        InspectorObjectBase::setArray(ASCIILiteral("array"), WTFMove(value));
+        JSON::ObjectBase::setArray(ASCIILiteral("array"), WTFMove(value));
     }
 };
 
@@ -585,7 +585,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -734,7 +734,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -845,7 +845,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1041,8 +1041,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index b66a2c2..76005cf 100644 (file)
@@ -168,7 +168,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -218,7 +218,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -457,7 +457,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -606,7 +606,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -703,7 +703,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -876,8 +876,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 1fc6cae..2661b86 100644 (file)
@@ -172,7 +172,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -222,7 +222,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -536,7 +536,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -685,7 +685,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -787,7 +787,7 @@ typedef NS_ENUM(NSInteger, TestProtocolDebuggerReason) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1043,8 +1043,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index dd48acf..1738bc2 100644 (file)
@@ -173,7 +173,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -223,7 +223,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -556,7 +556,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -705,7 +705,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -815,7 +815,7 @@ typedef NS_ENUM(NSInteger, TestProtocolRuntimeTwoLeggedAnimals) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1054,8 +1054,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 62245d0..fb86bea 100644 (file)
@@ -174,7 +174,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -224,7 +224,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -477,47 +477,47 @@ public:
 
     void setColumnNames(RefPtr<Inspector::Protocol::Array<String>> value)
     {
-        InspectorObjectBase::setArray(ASCIILiteral("columnNames"), WTFMove(value));
+        JSON::ObjectBase::setArray(ASCIILiteral("columnNames"), WTFMove(value));
     }
 
     void setButtons(RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Database::MouseButton>> value)
     {
-        InspectorObjectBase::setArray(ASCIILiteral("buttons"), WTFMove(value));
+        JSON::ObjectBase::setArray(ASCIILiteral("buttons"), WTFMove(value));
     }
 
     void setDirectionality(Directionality value)
     {
-        InspectorObjectBase::setString(ASCIILiteral("directionality"), Inspector::Protocol::TestHelpers::getEnumConstantValue(value));
+        JSON::ObjectBase::setString(ASCIILiteral("directionality"), Inspector::Protocol::TestHelpers::getEnumConstantValue(value));
     }
 
     void setNotes(const String& value)
     {
-        InspectorObjectBase::setString(ASCIILiteral("notes"), value);
+        JSON::ObjectBase::setString(ASCIILiteral("notes"), value);
     }
 
     void setTimestamp(double value)
     {
-        InspectorObjectBase::setDouble(ASCIILiteral("timestamp"), value);
+        JSON::ObjectBase::setDouble(ASCIILiteral("timestamp"), value);
     }
 
     void setValues(RefPtr<JSON::Object> value)
     {
-        InspectorObjectBase::setObject(ASCIILiteral("values"), WTFMove(value));
+        JSON::ObjectBase::setObject(ASCIILiteral("values"), WTFMove(value));
     }
 
     void setPayload(RefPtr<JSON::Value> value)
     {
-        InspectorObjectBase::setValue(ASCIILiteral("payload"), WTFMove(value));
+        JSON::ObjectBase::setValue(ASCIILiteral("payload"), WTFMove(value));
     }
 
     void setError(RefPtr<Inspector::Protocol::Database::Error> value)
     {
-        InspectorObjectBase::setObject(ASCIILiteral("error"), WTFMove(value));
+        JSON::ObjectBase::setObject(ASCIILiteral("error"), WTFMove(value));
     }
 
     void setErrorList(RefPtr<Inspector::Protocol::Database::ErrorList> value)
     {
-        InspectorObjectBase::setArray(ASCIILiteral("errorList"), WTFMove(value));
+        JSON::ObjectBase::setArray(ASCIILiteral("errorList"), WTFMove(value));
     }
 };
 
@@ -1106,7 +1106,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -1255,7 +1255,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -1450,7 +1450,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1769,8 +1769,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 0e16866..b3600fc 100644 (file)
@@ -173,7 +173,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -223,7 +223,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -501,7 +501,7 @@ public:
 
     void setObj(RefPtr<Inspector::Protocol::Test::RecursiveObject2> value)
     {
-        InspectorObjectBase::setObject(ASCIILiteral("obj"), WTFMove(value));
+        JSON::ObjectBase::setObject(ASCIILiteral("obj"), WTFMove(value));
     }
 };
 
@@ -552,7 +552,7 @@ public:
 
     void setObj(RefPtr<Inspector::Protocol::Test::RecursiveObject1> value)
     {
-        InspectorObjectBase::setObject(ASCIILiteral("obj"), WTFMove(value));
+        JSON::ObjectBase::setObject(ASCIILiteral("obj"), WTFMove(value));
     }
 };
 
@@ -708,31 +708,31 @@ void BindingTraits<Inspector::Protocol::Test::CastedAnimals>::assertValueHasExpe
 void BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::assertValueHasExpectedType(JSON::Value* value)
 {
     ASSERT_ARG(value, value);
-    RefPtr<InspectorObject> object;
+    RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
     {
-        InspectorObject::iterator stringPos = object->find(ASCIILiteral("string"));
+        JSON::Object::iterator stringPos = object->find(ASCIILiteral("string"));
         ASSERT(stringPos != object->end());
         BindingTraits<String>::assertValueHasExpectedType(stringPos->value.get());
     }
     {
-        InspectorObject::iterator numberPos = object->find(ASCIILiteral("number"));
+        JSON::Object::iterator numberPos = object->find(ASCIILiteral("number"));
         ASSERT(numberPos != object->end());
         BindingTraits<int>::assertValueHasExpectedType(numberPos->value.get());
     }
     {
-        InspectorObject::iterator animalsPos = object->find(ASCIILiteral("animals"));
+        JSON::Object::iterator animalsPos = object->find(ASCIILiteral("animals"));
         ASSERT(animalsPos != object->end());
         BindingTraits<Inspector::Protocol::Test::CastedAnimals>::assertValueHasExpectedType(animalsPos->value.get());
     }
     {
-        InspectorObject::iterator idPos = object->find(ASCIILiteral("id"));
+        JSON::Object::iterator idPos = object->find(ASCIILiteral("id"));
         ASSERT(idPos != object->end());
         BindingTraits<int>::assertValueHasExpectedType(idPos->value.get());
     }
     {
-        InspectorObject::iterator treePos = object->find(ASCIILiteral("tree"));
+        JSON::Object::iterator treePos = object->find(ASCIILiteral("tree"));
         ASSERT(treePos != object->end());
         BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasExpectedType(treePos->value.get());
     }
@@ -760,13 +760,13 @@ RefPtr<Inspector::Protocol::Test::TypeNeedingCast> BindingTraits<Inspector::Prot
 void BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasExpectedType(JSON::Value* value)
 {
     ASSERT_ARG(value, value);
-    RefPtr<InspectorObject> object;
+    RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
     int foundPropertiesCount = 0;
     {
-        InspectorObject::iterator objPos = object->find(ASCIILiteral("obj"));
+        JSON::Object::iterator objPos = object->find(ASCIILiteral("obj"));
         if (objPos != object->end()) {
             BindingTraits<Inspector::Protocol::Test::RecursiveObject2>::assertValueHasExpectedType(objPos->value.get());
             ++foundPropertiesCount;
@@ -781,13 +781,13 @@ void BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasE
 void BindingTraits<Inspector::Protocol::Test::RecursiveObject2>::assertValueHasExpectedType(JSON::Value* value)
 {
     ASSERT_ARG(value, value);
-    RefPtr<InspectorObject> object;
+    RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
     int foundPropertiesCount = 0;
     {
-        InspectorObject::iterator objPos = object->find(ASCIILiteral("obj"));
+        JSON::Object::iterator objPos = object->find(ASCIILiteral("obj"));
         if (objPos != object->end()) {
             BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasExpectedType(objPos->value.get());
             ++foundPropertiesCount;
@@ -883,7 +883,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -1032,7 +1032,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -1169,7 +1169,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1443,8 +1443,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index e64cae7..b1439cf 100644 (file)
@@ -168,7 +168,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -218,7 +218,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -592,7 +592,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -741,7 +741,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -856,7 +856,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1036,8 +1036,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 52267a4..47c896f 100644 (file)
@@ -170,7 +170,7 @@ public:
     static Ref<DomainABackendDispatcher> create(BackendDispatcher&, DomainABackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void enable(long requestId, RefPtr<InspectorObject>&& parameters);
+    void enable(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateDomainABackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -187,7 +187,7 @@ public:
     static Ref<DomainBBackendDispatcher> create(BackendDispatcher&, DomainBBackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void enable(long requestId, RefPtr<InspectorObject>&& parameters);
+    void enable(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateDomainBBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -237,7 +237,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -275,7 +275,7 @@ void DomainABackendDispatcher::dispatch(long requestId, const String& method, Re
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "DomainA", '.', method, "' was not found"));
 }
 
-void DomainABackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
+void DomainABackendDispatcher::enable(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -285,7 +285,7 @@ void DomainABackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->enable(error);
 
     if (!error.length())
@@ -319,7 +319,7 @@ void DomainBBackendDispatcher::dispatch(long requestId, const String& method, Re
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "DomainB", '.', method, "' was not found"));
 }
 
-void DomainBBackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
+void DomainBBackendDispatcher::enable(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -329,7 +329,7 @@ void DomainBBackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->enable(error);
 
     if (!error.length())
@@ -376,7 +376,7 @@ void DomainBBackendDispatcher::enable(long requestId, RefPtr<InspectorObject>&&)
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -627,7 +627,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -639,7 +639,7 @@ void ObjCInspectorDomainABackendDispatcher::enable(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback];
@@ -654,7 +654,7 @@ void ObjCInspectorDomainBBackendDispatcher::enable(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback];
@@ -848,7 +848,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -953,7 +953,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -1112,8 +1112,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 63d7a15..1bc9070 100644 (file)
@@ -168,7 +168,7 @@ typedef String ErrorString;
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -218,7 +218,7 @@ namespace Inspector {
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -452,7 +452,7 @@ namespace Inspector {
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -601,7 +601,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -698,7 +698,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 
 
@@ -857,8 +857,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 3f783cd..d32a1d7 100644 (file)
@@ -154,7 +154,7 @@ public:
     static Ref<NetworkBackendDispatcher> create(BackendDispatcher&, NetworkBackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void loadResource(long requestId, RefPtr<InspectorObject>&& parameters);
+    void loadResource(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
     void setAlternateDispatcher(AlternateNetworkBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
@@ -204,7 +204,7 @@ private:
 #include "TestBackendDispatchers.h"
 
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
@@ -241,7 +241,7 @@ void NetworkBackendDispatcher::dispatch(long requestId, const String& method, Re
         m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, makeString('\'', "Network", '.', method, "' was not found"));
 }
 
-void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<InspectorObject>&&)
+void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
@@ -251,7 +251,7 @@ void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<InspectorObje
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    Ref<JSON::Object> result = JSON::Object::create();
     m_agent->loadResource(error);
 
     if (!error.length())
@@ -298,7 +298,7 @@ void NetworkBackendDispatcher::loadResource(long requestId, RefPtr<InspectorObje
 #pragma once
 
 #include "TestProtocolObjects.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -357,7 +357,7 @@ namespace Inspector {
 
 void NetworkFrontendDispatcher::resourceLoaded()
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network.resourceLoaded"));
 
     m_frontendRouter.sendEvent(jsonMessage->toJSONString());
@@ -628,7 +628,7 @@ private:
 
 #include "TestProtocolInternal.h"
 #include "TestProtocolTypeConversions.h"
-#include <JavaScriptCore/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -640,7 +640,7 @@ void ObjCInspectorNetworkBackendDispatcher::loadResource(long requestId)
     };
 
     id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, InspectorObject::create());
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create());
     };
 
     [m_delegate loadResourceWithErrorCallback:errorCallback successCallback:successCallback];
@@ -823,7 +823,7 @@ using namespace Inspector;
 #import "TestProtocolInternal.h"
 
 #import "TestProtocolTypeConversions.h"
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -846,7 +846,7 @@ using namespace Inspector;
 {
     const FrontendRouter& router = _controller->frontendRouter();
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network.resourceLoaded"));
     router.sendEvent(jsonMessage->toJSONString());
 }
@@ -960,7 +960,7 @@ __attribute__((visibility ("default")))
 #import "TestProtocol.h"
 #import "TestProtocolJSONObjectPrivate.h"
 #import <JavaScriptCore/AugmentableInspectorController.h>
-#import <JavaScriptCore/InspectorValues.h>
+#import <wtf/JSONValues.h>
 
 @interface TestProtocolNetworkDomainEventDispatcher (Private)
 - (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
@@ -1135,8 +1135,8 @@ using namespace Inspector;
 
 #import "TestProtocolTypeConversions.h"
 #import <WebInspector/RWIProtocolJSONObjectPrivate.h>
-#import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
 
 using namespace Inspector;
 
index 7617dbb..b59a5be 100644 (file)
@@ -1,3 +1,64 @@
+2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
+        https://bugs.webkit.org/show_bug.cgi?id=173793
+
+        Reviewed by Brian Burg.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+        * wtf/JSONValues.cpp: Renamed from Source/JavaScriptCore/inspector/InspectorValues.cpp.
+        (JSON::Value::null):
+        (JSON::Value::create):
+        (JSON::Value::asValue):
+        (JSON::Value::asObject):
+        (JSON::Value::asArray):
+        (JSON::Value::parseJSON):
+        (JSON::Value::toJSONString const):
+        (JSON::Value::asBoolean const):
+        (JSON::Value::asDouble const):
+        (JSON::Value::asInteger const):
+        (JSON::Value::asString const):
+        (JSON::Value::writeJSON const):
+        (JSON::Value::memoryCost const):
+        (JSON::ObjectBase::~ObjectBase):
+        (JSON::ObjectBase::asObject):
+        (JSON::ObjectBase::openAccessors):
+        (JSON::ObjectBase::memoryCost const):
+        (JSON::ObjectBase::getBoolean const):
+        (JSON::ObjectBase::getString const):
+        (JSON::ObjectBase::getObject const):
+        (JSON::ObjectBase::getArray const):
+        (JSON::ObjectBase::getValue const):
+        (JSON::ObjectBase::remove):
+        (JSON::ObjectBase::writeJSON const):
+        (JSON::ObjectBase::ObjectBase):
+        (JSON::ArrayBase::~ArrayBase):
+        (JSON::ArrayBase::asArray):
+        (JSON::ArrayBase::writeJSON const):
+        (JSON::ArrayBase::ArrayBase):
+        (JSON::ArrayBase::get const):
+        (JSON::Object::create):
+        (JSON::Array::create):
+        (JSON::ArrayBase::memoryCost const):
+        * wtf/JSONValues.h: Renamed from Source/JavaScriptCore/inspector/InspectorValues.h.
+        (JSON::ObjectBase::find):
+        (JSON::ObjectBase::find const):
+        (JSON::ObjectBase::setBoolean):
+        (JSON::ObjectBase::setInteger):
+        (JSON::ObjectBase::setDouble):
+        (JSON::ObjectBase::setString):
+        (JSON::ObjectBase::setValue):
+        (JSON::ObjectBase::setObject):
+        (JSON::ObjectBase::setArray):
+        (JSON::ArrayBase::pushBoolean):
+        (JSON::ArrayBase::pushInteger):
+        (JSON::ArrayBase::pushDouble):
+        (JSON::ArrayBase::pushString):
+        (JSON::ArrayBase::pushValue):
+        (JSON::ArrayBase::pushObject):
+        (JSON::ArrayBase::pushArray):
+
 2017-11-14  Alex Christensen  <achristensen@webkit.org>
 
         Remove Cocoa CFURLConnection loading code
index 0b559a1..96ed91d 100644 (file)
@@ -73,6 +73,7 @@
                53534F2A1EC0E10E00141B2F /* MachExceptions.defs in Sources */ = {isa = PBXBuildFile; fileRef = 53534F291EC0E10E00141B2F /* MachExceptions.defs */; settings = {ATTRIBUTES = (Client, Server, ); }; };
                70A993FE1AD7151300FA615B /* SymbolRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70A993FC1AD7151300FA615B /* SymbolRegistry.cpp */; };
                70ECA60D1B02426800449739 /* AtomicStringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70ECA60A1B02426800449739 /* AtomicStringImpl.cpp */; };
+               7A05093F1FB9DCC500B33FB8 /* JSONValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A05093E1FB9DCC500B33FB8 /* JSONValues.cpp */; };
                7AFEC6B11EB22B5900DADE36 /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AFEC6B01EB22B5900DADE36 /* UUID.cpp */; };
                8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; };
                93934BD318A1E8C300D0D6A1 /* StringViewObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93934BD218A1E8C300D0D6A1 /* StringViewObjC.mm */; };
                70ECA60C1B02426800449739 /* UniquedStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniquedStringImpl.h; sourceTree = "<group>"; };
                7936D6A91C99F8AE000D1AED /* SmallPtrSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallPtrSet.h; sourceTree = "<group>"; };
                795212021F42588800BD6421 /* SingleRootGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleRootGraph.h; sourceTree = "<group>"; };
+               7A05093D1FB9DCC500B33FB8 /* JSONValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONValues.h; sourceTree = "<group>"; };
+               7A05093E1FB9DCC500B33FB8 /* JSONValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONValues.cpp; sourceTree = "<group>"; };
                7AFEC6AE1EB22AC600DADE36 /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UUID.h; sourceTree = "<group>"; };
                7AFEC6B01EB22B5900DADE36 /* UUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UUID.cpp; sourceTree = "<group>"; };
                7C3F72391D78811900674E26 /* Brigand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Brigand.h; sourceTree = "<group>"; };
                                7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */,
                                7CDD7FF9186D2A54007433CD /* IteratorRange.h */,
                                7C9692941F66306E00267A9E /* KeyValuePair.h */,
+                               7A05093E1FB9DCC500B33FB8 /* JSONValues.cpp */,
+                               7A05093D1FB9DCC500B33FB8 /* JSONValues.h */,
                                C2BCFC3E1F61D13000C9222C /* Language.cpp */,
                                C2BCFC3F1F61D13000C9222C /* Language.h */,
                                539EB0621D55284200C82EF7 /* LEBDecoder.h */,
                                0F5BF1761F23D49A0029D91D /* Gigacage.cpp in Sources */,
                                0F30BA901E78708E002CA847 /* GlobalVersion.cpp in Sources */,
                                2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */,
+                               7A05093F1FB9DCC500B33FB8 /* JSONValues.cpp in Sources */,
                                A8A473D8151A825B004123FF /* HashTable.cpp in Sources */,
                                C2BCFC401F61D13000C9222C /* Language.cpp in Sources */,
                                C2BCFC421F61D61600C9222C /* LanguageCF.cpp in Sources */,
index 4c52548..1d17062 100644 (file)
@@ -60,6 +60,7 @@ set(WTF_HEADERS
     IndexedContainerIterator.h
     IteratorAdaptors.h
     IteratorRange.h
+    JSONValues.h
     Language.h
     ListHashSet.h
     Liveness.h
@@ -230,6 +231,7 @@ set(WTF_SOURCES
     GlobalVersion.cpp
     GregorianDateTime.cpp
     HashTable.cpp
+    JSONValues.cpp
     Language.cpp
     Lock.cpp
     LockedPrintStream.cpp
similarity index 72%
rename from Source/JavaScriptCore/inspector/InspectorValues.cpp
rename to Source/WTF/wtf/JSONValues.cpp
index e4e1d11..eec3b03 100644 (file)
  */
 
 #include "config.h"
-#include "InspectorValues.h"
+#include "JSONValues.h"
 
 #include <wtf/DecimalNumber.h>
 #include <wtf/dtoa.h>
 #include <wtf/text/StringBuilder.h>
 
-namespace Inspector {
+namespace JSON {
 
 namespace {
 
 static const int stackLimit = 1000;
 
-enum Token {
-    OBJECT_BEGIN,
-    OBJECT_END,
-    ARRAY_BEGIN,
-    ARRAY_END,
-    STRING,
-    NUMBER,
-    BOOL_TRUE,
-    BOOL_FALSE,
-    NULL_TOKEN,
-    LIST_SEPARATOR,
-    OBJECT_PAIR_SEPARATOR,
-    INVALID_TOKEN,
+enum class Token {
+    ObjectBegin,
+    ObjectEnd,
+    ArrayBegin,
+    ArrayEnd,
+    String,
+    Number,
+    BoolTrue,
+    BoolFalse,
+    Null,
+    ListSeparator,
+    ObjectPairSeparator,
+    Invalid,
 };
 
 const char* const nullString = "null";
@@ -97,7 +97,7 @@ bool readInt(const UChar* start, const UChar* end, const UChar** tokenEnd, bool
 
 bool parseNumberToken(const UChar* start, const UChar* end, const UChar** tokenEnd)
 {
-    // We just grab the number here.  We validate the size in DecodeNumber.
+    // We just grab the number here. We validate the size in DecodeNumber.
     // According   to RFC4627, a valid number is: [minus] int [frac] [exp]
     if (start == end)
         return false;
@@ -204,41 +204,41 @@ Token parseToken(const UChar* start, const UChar* end, const UChar** tokenStart,
         ++start;
 
     if (start == end)
-        return INVALID_TOKEN;
+        return Token::Invalid;
 
     *tokenStart = start;
 
     switch (*start) {
     case 'n':
         if (parseConstToken(start, end, tokenEnd, nullString))
-            return NULL_TOKEN;
+            return Token::Null;
         break;
     case 't':
         if (parseConstToken(start, end, tokenEnd, trueString))
-            return BOOL_TRUE;
+            return Token::BoolTrue;
         break;
     case 'f':
         if (parseConstToken(start, end, tokenEnd, falseString))
-            return BOOL_FALSE;
+            return Token::BoolFalse;
         break;
     case '[':
         *tokenEnd = start + 1;
-        return ARRAY_BEGIN;
+        return Token::ArrayBegin;
     case ']':
         *tokenEnd = start + 1;
-        return ARRAY_END;
+        return Token::ArrayEnd;
     case ',':
         *tokenEnd = start + 1;
-        return LIST_SEPARATOR;
+        return Token::ListSeparator;
     case '{':
         *tokenEnd = start + 1;
-        return OBJECT_BEGIN;
+        return Token::ObjectBegin;
     case '}':
         *tokenEnd = start + 1;
-        return OBJECT_END;
+        return Token::ObjectEnd;
     case ':':
         *tokenEnd = start + 1;
-        return OBJECT_PAIR_SEPARATOR;
+        return Token::ObjectPairSeparator;
     case '0':
     case '1':
     case '2':
@@ -251,15 +251,15 @@ Token parseToken(const UChar* start, const UChar* end, const UChar** tokenStart,
     case '9':
     case '-':
         if (parseNumberToken(start, end, tokenEnd))
-            return NUMBER;
+            return Token::Number;
         break;
     case '"':
         if (parseStringToken(start + 1, end, tokenEnd))
-            return STRING;
+            return Token::String;
         break;
     }
 
-    return INVALID_TOKEN;
+    return Token::Invalid;
 }
 
 bool decodeString(const UChar* start, const UChar* end, StringBuilder& output)
@@ -330,49 +330,49 @@ bool decodeString(const UChar* start, const UChar* end, String& output)
     return true;
 }
 
-RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UChar** valueTokenEnd, int depth)
+RefPtr<JSON::Value> buildValue(const UChar* start, const UChar* end, const UChar** valueTokenEnd, int depth)
 {
     if (depth > stackLimit)
         return nullptr;
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     const UChar* tokenStart;
     const UChar* tokenEnd;
     Token token = parseToken(start, end, &tokenStart, &tokenEnd);
     switch (token) {
-    case INVALID_TOKEN:
+    case Token::Invalid:
         return nullptr;
-    case NULL_TOKEN:
-        result = InspectorValue::null();
+    case Token::Null:
+        result = JSON::Value::null();
         break;
-    case BOOL_TRUE:
-        result = InspectorValue::create(true);
+    case Token::BoolTrue:
+        result = JSON::Value::create(true);
         break;
-    case BOOL_FALSE:
-        result = InspectorValue::create(false);
+    case Token::BoolFalse:
+        result = JSON::Value::create(false);
         break;
-    case NUMBER: {
+    case Token::Number: {
         bool ok;
         double value = charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok);
         if (!ok)
             return nullptr;
-        result = InspectorValue::create(value);
+        result = JSON::Value::create(value);
         break;
     }
-    case STRING: {
+    case Token::String: {
         String value;
         bool ok = decodeString(tokenStart + 1, tokenEnd - 1, value);
         if (!ok)
             return nullptr;
-        result = InspectorValue::create(value);
+        result = JSON::Value::create(value);
         break;
     }
-    case ARRAY_BEGIN: {
-        Ref<InspectorArray> array = InspectorArray::create();
+    case Token::ArrayBegin: {
+        Ref<JSON::Array> array = JSON::Array::create();
         start = tokenEnd;
         token = parseToken(start, end, &tokenStart, &tokenEnd);
-        while (token != ARRAY_END) {
-            RefPtr<InspectorValue> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
+        while (token != Token::ArrayEnd) {
+            RefPtr<JSON::Value> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
             if (!arrayNode)
                 return nullptr;
             array->pushValue(WTFMove(arrayNode));
@@ -380,27 +380,27 @@ RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UC
             // After a list value, we expect a comma or the end of the list.
             start = tokenEnd;
             token = parseToken(start, end, &tokenStart, &tokenEnd);
-            if (token == LIST_SEPARATOR) {
+            if (token == Token::ListSeparator) {
                 start = tokenEnd;
                 token = parseToken(start, end, &tokenStart, &tokenEnd);
-                if (token == ARRAY_END)
+                if (token == Token::ArrayEnd)
                     return nullptr;
-            } else if (token != ARRAY_END) {
-                // Unexpected value after list value.  Bail out.
+            } else if (token != Token::ArrayEnd) {
+                // Unexpected value after list value. Bail out.
                 return nullptr;
             }
         }
-        if (token != ARRAY_END)
+        if (token != Token::ArrayEnd)
             return nullptr;
         result = WTFMove(array);
         break;
     }
-    case OBJECT_BEGIN: {
-        Ref<InspectorObject> object = InspectorObject::create();
+    case Token::ObjectBegin: {
+        Ref<JSON::Object> object = JSON::Object::create();
         start = tokenEnd;
         token = parseToken(start, end, &tokenStart, &tokenEnd);
-        while (token != OBJECT_END) {
-            if (token != STRING)
+        while (token != Token::ObjectEnd) {
+            if (token != Token::String)
                 return nullptr;
             String key;
             if (!decodeString(tokenStart + 1, tokenEnd - 1, key))
@@ -408,11 +408,11 @@ RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UC
             start = tokenEnd;
 
             token = parseToken(start, end, &tokenStart, &tokenEnd);
-            if (token != OBJECT_PAIR_SEPARATOR)
+            if (token != Token::ObjectPairSeparator)
                 return nullptr;
             start = tokenEnd;
 
-            RefPtr<InspectorValue> value = buildValue(start, end, &tokenEnd, depth + 1);
+            RefPtr<JSON::Value> value = buildValue(start, end, &tokenEnd, depth + 1);
             if (!value)
                 return nullptr;
             object->setValue(key, WTFMove(value));
@@ -421,17 +421,17 @@ RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UC
             // After a key/value pair, we expect a comma or the end of the
             // object.
             token = parseToken(start, end, &tokenStart, &tokenEnd);
-            if (token == LIST_SEPARATOR) {
+            if (token == Token::ListSeparator) {
                 start = tokenEnd;
                 token = parseToken(start, end, &tokenStart, &tokenEnd);
-                 if (token == OBJECT_END)
+                if (token == Token::ObjectEnd)
                     return nullptr;
-            } else if (token != OBJECT_END) {
-                // Unexpected value after last object value.  Bail out.
+            } else if (token != Token::ObjectEnd) {
+                // Unexpected value after last object value. Bail out.
                 return nullptr;
             }
         }
-        if (token != OBJECT_END)
+        if (token != Token::ObjectEnd)
             return nullptr;
         result = WTFMove(object);
         break;
@@ -470,7 +470,7 @@ inline void doubleQuoteString(const String& str, StringBuilder& dst)
             if (c < 32 || c > 126 || c == '<' || c == '>') {
                 // 1. Escaping <, > to prevent script execution.
                 // 2. Technically, we could also pass through c > 126 as UTF8, but this
-                //    is also optional.  It would also be a pain to implement here.
+                //    is also optional. It would also be a pain to implement here.
                 dst.append(String::format("\\u%04X", c));
             } else
                 dst.append(c);
@@ -481,53 +481,53 @@ inline void doubleQuoteString(const String& str, StringBuilder& dst)
 
 } // anonymous namespace
 
-Ref<InspectorValue> InspectorValue::null()
+Ref<Value> Value::null()
 {
-    return adoptRef(*new InspectorValue);
+    return adoptRef(*new Value);
 }
 
-Ref<InspectorValue> InspectorValue::create(bool value)
+Ref<Value> Value::create(bool value)
 {
-    return adoptRef(*new InspectorValue(value));
+    return adoptRef(*new Value(value));
 }
 
-Ref<InspectorValue> InspectorValue::create(int value)
+Ref<Value> Value::create(int value)
 {
-    return adoptRef(*new InspectorValue(value));
+    return adoptRef(*new Value(value));
 }
 
-Ref<InspectorValue> InspectorValue::create(double value)
+Ref<Value> Value::create(double value)
 {
-    return adoptRef(*new InspectorValue(value));
+    return adoptRef(*new Value(value));
 }
 
-Ref<InspectorValue> InspectorValue::create(const String& value)
+Ref<Value> Value::create(const String& value)
 {
-    return adoptRef(*new InspectorValue(value));
+    return adoptRef(*new Value(value));
 }
 
-Ref<InspectorValue> InspectorValue::create(const char* value)
+Ref<Value> Value::create(const char* value)
 {
-    return adoptRef(*new InspectorValue(value));
+    return adoptRef(*new Value(value));
 }
 
-bool InspectorValue::asValue(RefPtr<Inspector::InspectorValue> & value)
+bool Value::asValue(RefPtr<Value> & value)
 {
     value = this;
     return true;
 }
 
-bool InspectorValue::asObject(RefPtr<InspectorObject>&)
+bool Value::asObject(RefPtr<Object>&)
 {
     return false;
 }
 
-bool InspectorValue::asArray(RefPtr<InspectorArray>&)
+bool Value::asArray(RefPtr<Array>&)
 {
     return false;
 }
 
-bool InspectorValue::parseJSON(const String& jsonInput, RefPtr<InspectorValue>& output)
+bool Value::parseJSON(const String& jsonInput, RefPtr<Value>& output)
 {
     // FIXME: This whole file should just use StringView instead of UChar/length and avoid upconverting.
     auto characters = StringView(jsonInput).upconvertedCharacters();
@@ -542,7 +542,7 @@ bool InspectorValue::parseJSON(const String& jsonInput, RefPtr<InspectorValue>&
     return true;
 }
 
-String InspectorValue::toJSONString() const
+String Value::toJSONString() const
 {
     StringBuilder result;
     result.reserveCapacity(512);
@@ -550,7 +550,7 @@ String InspectorValue::toJSONString() const
     return result.toString();
 }
 
-bool InspectorValue::asBoolean(bool& output) const
+bool Value::asBoolean(bool& output) const
 {
     if (type() != Type::Boolean)
         return false;
@@ -559,7 +559,7 @@ bool InspectorValue::asBoolean(bool& output) const
     return true;
 }
 
-bool InspectorValue::asDouble(double& output) const
+bool Value::asDouble(double& output) const
 {
     if (type() != Type::Double)
         return false;
@@ -568,7 +568,7 @@ bool InspectorValue::asDouble(double& output) const
     return true;
 }
 
-bool InspectorValue::asDouble(float& output) const
+bool Value::asDouble(float& output) const
 {
     if (type() != Type::Double)
         return false;
@@ -577,7 +577,7 @@ bool InspectorValue::asDouble(float& output) const
     return true;
 }
 
-bool InspectorValue::asInteger(int& output) const
+bool Value::asInteger(int& output) const
 {
     if (type() != Type::Integer && type() != Type::Double)
         return false;
@@ -586,7 +586,7 @@ bool InspectorValue::asInteger(int& output) const
     return true;
 }
 
-bool InspectorValue::asInteger(unsigned& output) const
+bool Value::asInteger(unsigned& output) const
 {
     if (type() != Type::Integer && type() != Type::Double)
         return false;
@@ -595,7 +595,7 @@ bool InspectorValue::asInteger(unsigned& output) const
     return true;
 }
 
-bool InspectorValue::asInteger(long& output) const
+bool Value::asInteger(long& output) const
 {
     if (type() != Type::Integer && type() != Type::Double)
         return false;
@@ -604,7 +604,7 @@ bool InspectorValue::asInteger(long& output) const
     return true;
 }
 
-bool InspectorValue::asInteger(long long& output) const
+bool Value::asInteger(long long& output) const
 {
     if (type() != Type::Integer && type() != Type::Double)
         return false;
@@ -613,7 +613,7 @@ bool InspectorValue::asInteger(long long& output) const
     return true;
 }
 
-bool InspectorValue::asInteger(unsigned long& output) const
+bool Value::asInteger(unsigned long& output) const
 {
     if (type() != Type::Integer && type() != Type::Double)
         return false;
@@ -622,7 +622,7 @@ bool InspectorValue::asInteger(unsigned long& output) const
     return true;
 }
 
-bool InspectorValue::asInteger(unsigned long long& output) const
+bool Value::asInteger(unsigned long long& output) const
 {
     if (type() != Type::Integer && type() != Type::Double)
         return false;
@@ -631,7 +631,7 @@ bool InspectorValue::asInteger(unsigned long long& output) const
     return true;
 }
 
-bool InspectorValue::asString(String& output) const
+bool Value::asString(String& output) const
 {
     if (type() != Type::String)
         return false;
@@ -640,7 +640,7 @@ bool InspectorValue::asString(String& output) const
     return true;
 }
 
-void InspectorValue::writeJSON(StringBuilder& output) const
+void Value::writeJSON(StringBuilder& output) const
 {
     switch (m_type) {
     case Type::Null:
@@ -682,7 +682,7 @@ void InspectorValue::writeJSON(StringBuilder& output) const
     }
 }
 
-size_t InspectorValue::memoryCost() const
+size_t Value::memoryCost() const
 {
     size_t memoryCost = sizeof(this);
     if (m_type == Type::String && m_value.string)
@@ -690,28 +690,28 @@ size_t InspectorValue::memoryCost() const
     return memoryCost;
 }
 
-InspectorObjectBase::~InspectorObjectBase()
+ObjectBase::~ObjectBase()
 {
 }
 
-bool InspectorObjectBase::asObject(RefPtr<InspectorObject>& output)
+bool ObjectBase::asObject(RefPtr<Object>& output)
 {
-    COMPILE_ASSERT(sizeof(InspectorObject) == sizeof(InspectorObjectBase), cannot_cast);
+    COMPILE_ASSERT(sizeof(Object) == sizeof(ObjectBase), cannot_cast);
 
-    output = static_cast<InspectorObject*>(this);
+    output = static_cast<Object*>(this);
     return true;
 }
 
-InspectorObject* InspectorObjectBase::openAccessors()
+Object* ObjectBase::openAccessors()
 {
-    COMPILE_ASSERT(sizeof(InspectorObject) == sizeof(InspectorObjectBase), cannot_cast);
+    COMPILE_ASSERT(sizeof(Object) == sizeof(ObjectBase), cannot_cast);
 
-    return static_cast<InspectorObject*>(this);
+    return static_cast<Object*>(this);
 }
 
-size_t InspectorObjectBase::memoryCost() const
+size_t ObjectBase::memoryCost() const
 {
-    size_t memoryCost = InspectorValue::memoryCost();
+    size_t memoryCost = Value::memoryCost();
     for (const auto& entry : m_map) {
         memoryCost += entry.key.sizeInBytes();
         if (entry.value)
@@ -720,43 +720,43 @@ size_t InspectorObjectBase::memoryCost() const
     return memoryCost;
 }
 
-bool InspectorObjectBase::getBoolean(const String& name, bool& output) const
+bool ObjectBase::getBoolean(const String& name, bool& output) const
 {
-    RefPtr<InspectorValue> value;
+    RefPtr<Value> value;
     if (!getValue(name, value))
         return false;
 
     return value->asBoolean(output);
 }
 
-bool InspectorObjectBase::getString(const String& name, String& output) const
+bool ObjectBase::getString(const String& name, String& output) const
 {
-    RefPtr<InspectorValue> value;
+    RefPtr<Value> value;
     if (!getValue(name, value))
         return false;
 
     return value->asString(output);
 }
 
-bool InspectorObjectBase::getObject(const String& name, RefPtr<InspectorObject>& output) const
+bool ObjectBase::getObject(const String& name, RefPtr<Object>& output) const
 {
-    RefPtr<InspectorValue> value;
+    RefPtr<Value> value;
     if (!getValue(name, value))
         return false;
 
     return value->asObject(output);
 }
 
-bool InspectorObjectBase::getArray(const String& name, RefPtr<InspectorArray>& output) const
+bool ObjectBase::getArray(const String& name, RefPtr<Array>& output) const
 {
-    RefPtr<InspectorValue> value;
+    RefPtr<Value> value;
     if (!getValue(name, value))
         return false;
 
     return value->asArray(output);
 }
 
-bool InspectorObjectBase::getValue(const String& name, RefPtr<InspectorValue>& output) const
+bool ObjectBase::getValue(const String& name, RefPtr<Value>& output) const
 {
     Dictionary::const_iterator findResult = m_map.find(name);
     if (findResult == m_map.end())
@@ -766,13 +766,13 @@ bool InspectorObjectBase::getValue(const String& name, RefPtr<InspectorValue>& o
     return true;
 }
 
-void InspectorObjectBase::remove(const String& name)
+void ObjectBase::remove(const String& name)
 {
     m_map.remove(name);
     m_order.removeFirst(name);
 }
 
-void InspectorObjectBase::writeJSON(StringBuilder& output) const
+void ObjectBase::writeJSON(StringBuilder& output) const
 {
     output.append('{');
     for (size_t i = 0; i < m_order.size(); ++i) {
@@ -787,28 +787,28 @@ void InspectorObjectBase::writeJSON(StringBuilder& output) const
     output.append('}');
 }
 
-InspectorObjectBase::InspectorObjectBase()
-    : Inspector::InspectorValue(Type::Object)
+ObjectBase::ObjectBase()
+    : Value(Type::Object)
     , m_map()
     , m_order()
 {
 }
 
-InspectorArrayBase::~InspectorArrayBase()
+ArrayBase::~ArrayBase()
 {
 }
 
-bool InspectorArrayBase::asArray(RefPtr<InspectorArray>& output)
+bool ArrayBase::asArray(RefPtr<Array>& output)
 {
-    COMPILE_ASSERT(sizeof(InspectorArrayBase) == sizeof(InspectorArray), cannot_cast);
-    output = static_cast<InspectorArray*>(this);
+    COMPILE_ASSERT(sizeof(ArrayBase) == sizeof(Array), cannot_cast);
+    output = static_cast<Array*>(this);
     return true;
 }
 
-void InspectorArrayBase::writeJSON(StringBuilder& output) const
+void ArrayBase::writeJSON(StringBuilder& output) const
 {
     output.append('[');
-    for (Vector<RefPtr<InspectorValue>>::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {
+    for (Vector<RefPtr<Value>>::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {
         if (it != m_map.begin())
             output.append(',');
         (*it)->writeJSON(output);
@@ -816,31 +816,31 @@ void InspectorArrayBase::writeJSON(StringBuilder& output) const
     output.append(']');
 }
 
-InspectorArrayBase::InspectorArrayBase()
-    : InspectorValue(Type::Array)
+ArrayBase::ArrayBase()
+    : Value(Type::Array)
     , m_map()
 {
 }
 
-RefPtr<InspectorValue> InspectorArrayBase::get(size_t index) const
+RefPtr<Value> ArrayBase::get(size_t index) const
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(index < m_map.size());
+    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(index < m_map.size());
     return m_map[index];
 }
 
-Ref<InspectorObject> InspectorObject::create()
+Ref<Object> Object::create()
 {
-    return adoptRef(*new InspectorObject);
+    return adoptRef(*new Object);
 }
 
-Ref<InspectorArray> InspectorArray::create()
+Ref<Array> Array::create()
 {
-    return adoptRef(*new InspectorArray);
+    return adoptRef(*new Array);
 }
 
-size_t InspectorArrayBase::memoryCost() const
+size_t ArrayBase::memoryCost() const
 {
-    size_t memoryCost = InspectorValue::memoryCost();
+    size_t memoryCost = Value::memoryCost();
     for (const auto& item : m_map) {
         if (item)
             memoryCost += item->memoryCost();
@@ -848,4 +848,4 @@ size_t InspectorArrayBase::memoryCost() const
     return memoryCost;
 }
 
-} // namespace Inspector
+} // namespace JSON
similarity index 52%
rename from Source/JavaScriptCore/inspector/InspectorValues.h
rename to Source/WTF/wtf/JSONValues.h
index 14a5cf7..35aef42 100644 (file)
 
 #pragma once
 
-#include "JSExportMacros.h"
-#include <wtf/Assertions.h>
 #include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
 #include <wtf/text/StringHash.h>
 #include <wtf/text/WTFString.h>
 
-
-namespace Inspector {
-class InspectorArray;
-class InspectorArrayBase;
-class InspectorObject;
-class InspectorObjectBase;
-class InspectorValue;
-}
-
 namespace JSON {
-typedef Inspector::InspectorArray Array;
-typedef Inspector::InspectorObject Object;
-typedef Inspector::InspectorValue Value;
-
-
-// Not to be used except for protocol object subclasses.
-typedef Inspector::InspectorArrayBase ArrayBase;
-typedef Inspector::InspectorObjectBase ObjectBase;
-}
 
-namespace Inspector {
+class Array;
+class ArrayBase;
+class Object;
+class ObjectBase;
 
-class JS_EXPORT_PRIVATE InspectorValue : public RefCounted<InspectorValue> {
+class WTF_EXPORT_PRIVATE Value : public RefCounted<Value> {
 public:
     static const int maxDepth = 1000;
 
-    virtual ~InspectorValue()
+    virtual ~Value()
     {
         switch (m_type) {
         case Type::Null:
@@ -84,12 +65,12 @@ public:
         }
     }
 
-    static Ref<InspectorValue> null();
-    static Ref<InspectorValue> create(bool);
-    static Ref<InspectorValue> create(int);
-    static Ref<InspectorValue> create(double);
-    static Ref<InspectorValue> create(const String&);
-    static Ref<InspectorValue> create(const char*);
+    static Ref<Value> null();
+    static Ref<Value> create(bool);
+    static Ref<Value> create(int);
+    static Ref<Value> create(double);
+    static Ref<Value> create(const String&);
+    static Ref<Value> create(const char*);
 
     enum class Type {
         Null = 0,
@@ -114,12 +95,12 @@ public:
     bool asDouble(double&) const;
     bool asDouble(float&) const;
     bool asString(String&) const;
-    bool asValue(RefPtr<InspectorValue>&);
+    bool asValue(RefPtr<Value>&);
 
-    virtual bool asObject(RefPtr<InspectorObject>&);
-    virtual bool asArray(RefPtr<InspectorArray>&);
+    virtual bool asObject(RefPtr<Object>&);
+    virtual bool asArray(RefPtr<Array>&);
 
-    static bool parseJSON(const String& jsonInput, RefPtr<InspectorValue>& output);
+    static bool parseJSON(const String& jsonInput, RefPtr<Value>& output);
 
     String toJSONString() const;
     virtual void writeJSON(StringBuilder& output) const;
@@ -127,31 +108,31 @@ public:
     virtual size_t memoryCost() const;
 
 protected:
-    InspectorValue()
+    Value()
         : m_type(Type::Null) { }
 
-    explicit InspectorValue(Type type)
+    explicit Value(Type type)
         : m_type(type) { }
 
-    explicit InspectorValue(bool value)
+    explicit Value(bool value)
         : m_type(Type::Boolean)
     {
         m_value.boolean = value;
     }
 
-    explicit InspectorValue(int value)
+    explicit Value(int value)
         : m_type(Type::Integer)
     {
         m_value.number = static_cast<double>(value);
     }
 
-    explicit InspectorValue(double value)
+    explicit Value(double value)
         : m_type(Type::Double)
     {
         m_value.number = value;
     }
 
-    explicit InspectorValue(const String& value)
+    explicit Value(const String& value)
         : m_type(Type::String)
     {
         m_value.string = value.impl();
@@ -159,7 +140,7 @@ protected:
             m_value.string->ref();
     }
 
-    explicit InspectorValue(const char* value)
+    explicit Value(const char* value)
         : m_type(Type::String)
     {
         String wrapper(value);
@@ -177,31 +158,31 @@ private:
     } m_value;
 };
 
-class JS_EXPORT_PRIVATE InspectorObjectBase : public InspectorValue {
+class WTF_EXPORT_PRIVATE ObjectBase : public Value {
 private:
-    typedef HashMap<String, RefPtr<InspectorValue>> Dictionary;
+    typedef HashMap<String, RefPtr<Value>> Dictionary;
 
 public:
     typedef Dictionary::iterator iterator;
     typedef Dictionary::const_iterator const_iterator;
 
-    InspectorObject* openAccessors();
+    Object* openAccessors();
 
     size_t memoryCost() const final;
 
 protected:
-    virtual ~InspectorObjectBase();
+    virtual ~ObjectBase();
 
-    bool asObject(RefPtr<InspectorObject>& output) override;
+    bool asObject(RefPtr<Object>& output) override;
 
     // FIXME: use templates to reduce the amount of duplicated set*() methods.
     void setBoolean(const String& name, bool);
     void setInteger(const String& name, int);
     void setDouble(const String& name, double);
     void setString(const String& name, const String&);
-    void setValue(const String& name, RefPtr<InspectorValue>&&);
-    void setObject(const String& name, RefPtr<InspectorObjectBase>&&);
-    void setArray(const String& name, RefPtr<InspectorArrayBase>&&);
+    void setValue(const String& name, RefPtr<Value>&&);
+    void setObject(const String& name, RefPtr<ObjectBase>&&);
+    void setArray(const String& name, RefPtr<ArrayBase>&&);
 
     iterator find(const String& name);
     const_iterator find(const String& name) const;
@@ -210,7 +191,7 @@ protected:
     bool getBoolean(const String& name, bool& output) const;
     template<class T> bool getDouble(const String& name, T& output) const
     {
-        RefPtr<InspectorValue> value;
+        RefPtr<Value> value;
         if (!getValue(name, value))
             return false;
 
@@ -218,7 +199,7 @@ protected:
     }
     template<class T> bool getInteger(const String& name, T& output) const
     {
-        RefPtr<InspectorValue> value;
+        RefPtr<Value> value;
         if (!getValue(name, value))
             return false;
 
@@ -226,9 +207,9 @@ protected:
     }
 
     bool getString(const String& name, String& output) 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;
+    bool getObject(const String& name, RefPtr<Object>&) const;
+    bool getArray(const String& name, RefPtr<Array>&) const;
+    bool getValue(const String& name, RefPtr<Value>&) const;
 
     void remove(const String& name);
 
@@ -242,69 +223,69 @@ protected:
     int size() const { return m_map.size(); }
 
 protected:
-    InspectorObjectBase();
+    ObjectBase();
 
 private:
     Dictionary m_map;
     Vector<String> m_order;
 };
 
-class InspectorObject : public InspectorObjectBase {
+class Object : public ObjectBase {
 public:
-    static JS_EXPORT_PRIVATE Ref<InspectorObject> create();
+    static WTF_EXPORT_PRIVATE Ref<Object> create();
 
-    using InspectorObjectBase::asObject;
+    using ObjectBase::asObject;
 
     // This class expected non-cyclic values, as we cannot serialize cycles in JSON.
-    using InspectorObjectBase::setBoolean;
-    using InspectorObjectBase::setInteger;
-    using InspectorObjectBase::setDouble;
-    using InspectorObjectBase::setString;
-    using InspectorObjectBase::setValue;
-    using InspectorObjectBase::setObject;
-    using InspectorObjectBase::setArray;
-
-    using InspectorObjectBase::find;
-    using InspectorObjectBase::getBoolean;
-    using InspectorObjectBase::getInteger;
-    using InspectorObjectBase::getDouble;
-    using InspectorObjectBase::getString;
-    using InspectorObjectBase::getObject;
-    using InspectorObjectBase::getArray;
-    using InspectorObjectBase::getValue;
-
-    using InspectorObjectBase::remove;
-
-    using InspectorObjectBase::begin;
-    using InspectorObjectBase::end;
-
-    using InspectorObjectBase::size;
+    using ObjectBase::setBoolean;
+    using ObjectBase::setInteger;
+    using ObjectBase::setDouble;
+    using ObjectBase::setString;
+    using ObjectBase::setValue;
+    using ObjectBase::setObject;
+    using ObjectBase::setArray;
+
+    using ObjectBase::find;
+    using ObjectBase::getBoolean;
+    using ObjectBase::getInteger;
+    using ObjectBase::getDouble;
+    using ObjectBase::getString;
+    using ObjectBase::getObject;
+    using ObjectBase::getArray;
+    using ObjectBase::getValue;
+
+    using ObjectBase::remove;
+
+    using ObjectBase::begin;
+    using ObjectBase::end;
+
+    using ObjectBase::size;
 };
 
 
-class JS_EXPORT_PRIVATE InspectorArrayBase : public InspectorValue {
+class WTF_EXPORT_PRIVATE ArrayBase : public Value {
 public:
-    typedef Vector<RefPtr<InspectorValue>>::iterator iterator;
-    typedef Vector<RefPtr<InspectorValue>>::const_iterator const_iterator;
+    typedef Vector<RefPtr<Value>>::iterator iterator;
+    typedef Vector<RefPtr<Value>>::const_iterator const_iterator;
 
     unsigned length() const { return static_cast<unsigned>(m_map.size()); }
 
-    RefPtr<InspectorValue> get(size_t index) const;
+    RefPtr<Value> get(size_t index) const;
 
     size_t memoryCost() const final;
 
 protected:
-    virtual ~InspectorArrayBase();
+    virtual ~ArrayBase();
 
-    bool asArray(RefPtr<InspectorArray>&) override;
+    bool asArray(RefPtr<Array>&) override;
 
     void pushBoolean(bool);
     void pushInteger(int);
     void pushDouble(double);
     void pushString(const String&);
-    void pushValue(RefPtr<InspectorValue>&&);
-    void pushObject(RefPtr<InspectorObjectBase>&&);
-    void pushArray(RefPtr<InspectorArrayBase>&&);
+    void pushValue(RefPtr<Value>&&);
+    void pushObject(RefPtr<ObjectBase>&&);
+    void pushArray(RefPtr<ArrayBase>&&);
 
     void writeJSON(StringBuilder& output) const override;
 
@@ -314,121 +295,121 @@ protected:
     const_iterator end() const { return m_map.end(); }
 
 protected:
-    InspectorArrayBase();
+    ArrayBase();
 
 private:
-    Vector<RefPtr<InspectorValue>> m_map;
+    Vector<RefPtr<Value>> m_map;
 };
 
-class InspectorArray : public InspectorArrayBase {
+class Array : public ArrayBase {
 public:
-    static JS_EXPORT_PRIVATE Ref<InspectorArray> create();
+    static WTF_EXPORT_PRIVATE Ref<Array> create();
 
-    using InspectorArrayBase::asArray;
+    using ArrayBase::asArray;
 
     // This class expected non-cyclic values, as we cannot serialize cycles in JSON.
-    using InspectorArrayBase::pushBoolean;
-    using InspectorArrayBase::pushInteger;
-    using InspectorArrayBase::pushDouble;
-    using InspectorArrayBase::pushString;
-    using InspectorArrayBase::pushValue;
-    using InspectorArrayBase::pushObject;
-    using InspectorArrayBase::pushArray;
-
-    using InspectorArrayBase::get;
-
-    using InspectorArrayBase::begin;
-    using InspectorArrayBase::end;
+    using ArrayBase::pushBoolean;
+    using ArrayBase::pushInteger;
+    using ArrayBase::pushDouble;
+    using ArrayBase::pushString;
+    using ArrayBase::pushValue;
+    using ArrayBase::pushObject;
+    using ArrayBase::pushArray;
+
+    using ArrayBase::get;
+
+    using ArrayBase::begin;
+    using ArrayBase::end;
 };
 
 
-inline InspectorObjectBase::iterator InspectorObjectBase::find(const String& name)
+inline ObjectBase::iterator ObjectBase::find(const String& name)
 {
     return m_map.find(name);
 }
 
-inline InspectorObjectBase::const_iterator InspectorObjectBase::find(const String& name) const
+inline ObjectBase::const_iterator ObjectBase::find(const String& name) const
 {
     return m_map.find(name);
 }
 
-inline void InspectorObjectBase::setBoolean(const String& name, bool value)
+inline void ObjectBase::setBoolean(const String& name, bool value)
 {
-    setValue(name, InspectorValue::create(value));
+    setValue(name, Value::create(value));
 }
 
-inline void InspectorObjectBase::setInteger(const String& name, int value)
+inline void ObjectBase::setInteger(const String& name, int value)
 {
-    setValue(name, InspectorValue::create(value));
+    setValue(name, Value::create(value));
 }
 
-inline void InspectorObjectBase::setDouble(const String& name, double value)
+inline void ObjectBase::setDouble(const String& name, double value)
 {
-    setValue(name, InspectorValue::create(value));
+    setValue(name, Value::create(value));
 }
 
-inline void InspectorObjectBase::setString(const String& name, const String& value)
+inline void ObjectBase::setString(const String& name, const String& value)
 {
-    setValue(name, InspectorValue::create(value));
+    setValue(name, Value::create(value));
 }
 
-inline void InspectorObjectBase::setValue(const String& name, RefPtr<InspectorValue>&& value)
+inline void ObjectBase::setValue(const String& name, RefPtr<Value>&& value)
 {
     ASSERT(value);
     if (m_map.set(name, WTFMove(value)).isNewEntry)
         m_order.append(name);
 }
 
-inline void InspectorObjectBase::setObject(const String& name, RefPtr<InspectorObjectBase>&& value)
+inline void ObjectBase::setObject(const String& name, RefPtr<ObjectBase>&& value)
 {
     ASSERT(value);
     if (m_map.set(name, WTFMove(value)).isNewEntry)
         m_order.append(name);
 }
 
-inline void InspectorObjectBase::setArray(const String& name, RefPtr<InspectorArrayBase>&& value)
+inline void ObjectBase::setArray(const String& name, RefPtr<ArrayBase>&& value)
 {
     ASSERT(value);
     if (m_map.set(name, WTFMove(value)).isNewEntry)
         m_order.append(name);
 }
 
-inline void InspectorArrayBase::pushBoolean(bool value)
+inline void ArrayBase::pushBoolean(bool value)
 {
-    m_map.append(InspectorValue::create(value));
+    m_map.append(Value::create(value));
 }
 
-inline void InspectorArrayBase::pushInteger(int value)
+inline void ArrayBase::pushInteger(int value)
 {
-    m_map.append(InspectorValue::create(value));
+    m_map.append(Value::create(value));
 }
 
-inline void InspectorArrayBase::pushDouble(double value)
+inline void ArrayBase::pushDouble(double value)
 {
-    m_map.append(InspectorValue::create(value));
+    m_map.append(Value::create(value));
 }
 
-inline void InspectorArrayBase::pushString(const String& value)
+inline void ArrayBase::pushString(const String& value)
 {
-    m_map.append(InspectorValue::create(value));
+    m_map.append(Value::create(value));
 }
 
-inline void InspectorArrayBase::pushValue(RefPtr<InspectorValue>&& value)
+inline void ArrayBase::pushValue(RefPtr<Value>&& value)
 {
     ASSERT(value);
     m_map.append(WTFMove(value));
 }
 
-inline void InspectorArrayBase::pushObject(RefPtr<InspectorObjectBase>&& value)
+inline void ArrayBase::pushObject(RefPtr<ObjectBase>&& value)
 {
     ASSERT(value);
     m_map.append(WTFMove(value));
 }
 
-inline void InspectorArrayBase::pushArray(RefPtr<InspectorArrayBase>&& value)
+inline void ArrayBase::pushArray(RefPtr<ArrayBase>&& value)
 {
     ASSERT(value);
     m_map.append(WTFMove(value));
 }
 
-} // namespace Inspector
+} // namespace JSON
index 9fa6be4..df7601a 100644 (file)
@@ -1,3 +1,136 @@
+2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
+        https://bugs.webkit.org/show_bug.cgi?id=173793
+
+        Reviewed by Brian Burg.
+
+        Based on patch by Brian Burg.
+
+        * ForwardingHeaders/inspector/InspectorValues.h: Removed.
+        * Modules/encryptedmedia/InitDataRegistry.cpp:
+        (WebCore::extractKeyIDsKeyids):
+        (WebCore::sanitizeKeyids):
+        * html/parser/XSSAuditorDelegate.cpp:
+        (WebCore::XSSAuditorDelegate::generateViolationReport):
+        * inspector/CommandLineAPIHost.cpp:
+        (WebCore::CommandLineAPIHost::inspect):
+        * inspector/CommandLineAPIHost.h:
+        * inspector/InspectorCanvas.cpp:
+        (WebCore::InspectorCanvas::recordAction):
+        (WebCore::InspectorCanvas::releaseData):
+        (WebCore::InspectorCanvas::indexForData):
+        (WebCore::buildArrayForVector):
+        (WebCore::InspectorCanvas::buildInitialState):
+        (WebCore::InspectorCanvas::buildAction):
+        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
+        (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
+        (WebCore::InspectorCanvas::buildArrayForImageData):
+        (WebCore::InspectorCanvas::buildArrayForImageBitmap):
+        * inspector/InspectorCanvas.h:
+        * inspector/InspectorDatabaseResource.cpp:
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::evaluateCommandInOverlay):
+        (WebCore::InspectorOverlay::evaluateInOverlay):
+        * inspector/InspectorOverlay.h:
+        * inspector/InspectorShaderProgram.h:
+        * inspector/InspectorStyleSheet.h:
+        (WebCore::InspectorCSSId::InspectorCSSId):
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createGenericRecord):
+        (WebCore::TimelineRecordFactory::createFunctionCallData):
+        (WebCore::TimelineRecordFactory::createConsoleProfileData):
+        (WebCore::TimelineRecordFactory::createProbeSampleData):
+        (WebCore::TimelineRecordFactory::createEventDispatchData):
+        (WebCore::TimelineRecordFactory::createGenericTimerData):
+        (WebCore::TimelineRecordFactory::createTimerInstallData):
+        (WebCore::TimelineRecordFactory::createEvaluateScriptData):
+        (WebCore::TimelineRecordFactory::createTimeStampData):
+        (WebCore::TimelineRecordFactory::createAnimationFrameData):
+        (WebCore::createQuad):
+        (WebCore::TimelineRecordFactory::createPaintData):
+        (WebCore::TimelineRecordFactory::appendLayoutRoot):
+        * inspector/TimelineRecordFactory.h:
+        * inspector/agents/InspectorApplicationCacheAgent.cpp:
+        * inspector/agents/InspectorApplicationCacheAgent.h:
+        * inspector/agents/InspectorCSSAgent.cpp:
+        (WebCore::computePseudoClassMask):
+        (WebCore::InspectorCSSAgent::setStyleText):
+        (WebCore::InspectorCSSAgent::setRuleSelector):
+        (WebCore::InspectorCSSAgent::forcePseudoState):
+        * inspector/agents/InspectorCSSAgent.h:
+        * inspector/agents/InspectorDOMAgent.cpp:
+        (WebCore::parseColor):
+        (WebCore::parseConfigColor):
+        (WebCore::parseQuad):
+        (WebCore::InspectorDOMAgent::performSearch):
+        (WebCore::InspectorDOMAgent::setSearchingForNode):
+        (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
+        (WebCore::InspectorDOMAgent::setInspectModeEnabled):
+        (WebCore::InspectorDOMAgent::highlightRect):
+        (WebCore::InspectorDOMAgent::highlightQuad):
+        (WebCore::InspectorDOMAgent::innerHighlightQuad):
+        (WebCore::InspectorDOMAgent::highlightSelector):
+        (WebCore::InspectorDOMAgent::highlightNode):
+        (WebCore::InspectorDOMAgent::highlightNodeList):
+        (WebCore::InspectorDOMAgent::highlightFrame):
+        * inspector/agents/InspectorDOMAgent.h:
+        * inspector/agents/InspectorDOMDebuggerAgent.cpp:
+        (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
+        (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
+        (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
+        (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
+        (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
+        (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
+        (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
+        * inspector/agents/InspectorDOMDebuggerAgent.h:
+        * inspector/agents/InspectorDOMStorageAgent.cpp:
+        (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
+        (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
+        (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
+        (WebCore::InspectorDOMStorageAgent::findStorageArea):
+        * inspector/agents/InspectorDOMStorageAgent.h:
+        * inspector/agents/InspectorDatabaseAgent.cpp:
+        * inspector/agents/InspectorIndexedDBAgent.cpp:
+        (WebCore::Inspector::idbKeyFromInspectorObject):
+        (WebCore::Inspector::idbKeyRangeFromKeyRange):
+        (WebCore::InspectorIndexedDBAgent::requestData):
+        * inspector/agents/InspectorIndexedDBAgent.h:
+        * inspector/agents/InspectorNetworkAgent.cpp:
+        (WebCore::buildObjectForHeaders):
+        (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
+        (WebCore::InspectorNetworkAgent::setExtraHTTPHeaders):
+        * inspector/agents/InspectorNetworkAgent.h:
+        * inspector/agents/InspectorPageAgent.cpp:
+        * inspector/agents/InspectorPageAgent.h:
+        * inspector/agents/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::setInstruments):
+        (WebCore::InspectorTimelineAgent::internalStart):
+        (WebCore::InspectorTimelineAgent::didInvalidateLayout):
+        (WebCore::InspectorTimelineAgent::willLayout):
+        (WebCore::InspectorTimelineAgent::didScheduleStyleRecalculation):
+        (WebCore::InspectorTimelineAgent::willRecalculateStyle):
+        (WebCore::InspectorTimelineAgent::willComposite):
+        (WebCore::InspectorTimelineAgent::willPaint):
+        (WebCore::InspectorTimelineAgent::addRecordToTimeline):
+        (WebCore::InspectorTimelineAgent::setFrameIdentifier):
+        (WebCore::InspectorTimelineAgent::appendRecord):
+        (WebCore::InspectorTimelineAgent::sendEvent):
+        (WebCore::InspectorTimelineAgent::createRecordEntry):
+        (WebCore::InspectorTimelineAgent::pushCurrentRecord):
+        * inspector/agents/InspectorTimelineAgent.h:
+        * page/csp/ContentSecurityPolicy.cpp:
+        (WebCore::ContentSecurityPolicy::reportViolation const):
+        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
+        (WebCore::parseJSONObject):
+        (WebCore::parseLicenseFormat):
+        (WebCore::parseLicenseReleaseAcknowledgementFormat):
+        (WebCore::CDMInstanceClearKey::updateLicense):
+        (WebCore::CDMInstanceClearKey::removeSessionData):
+        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
+        (WebCore::extractSinfData):
+        * testing/Internals.cpp:
+
 2017-11-14  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Unreviewed, fix CMake debug builds after r224707
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InspectorValues.h b/Source/WebCore/ForwardingHeaders/inspector/InspectorValues.h
deleted file mode 100644 (file)
index bd985f6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WebCore_FWD_InspectorValues_h
-#define WebCore_FWD_InspectorValues_h
-#include <JavaScriptCore/InspectorValues.h>
-#endif
index 9083a01..c29b038 100644 (file)
 
 #include "NotImplemented.h"
 #include "SharedBuffer.h"
-#include "inspector/InspectorValues.h"
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/Base64.h>
 
 
 namespace WebCore {
-using namespace Inspector;
 
 static Vector<Ref<SharedBuffer>> extractKeyIDsKeyids(const SharedBuffer& buffer)
 {
@@ -46,15 +45,15 @@ static Vector<Ref<SharedBuffer>> extractKeyIDsKeyids(const SharedBuffer& buffer)
         return { };
     String json { buffer.data(), static_cast<unsigned>(buffer.size()) };
 
-    RefPtr<InspectorValue> value;
-    if (!InspectorValue::parseJSON(json, value))
+    RefPtr<JSON::Value> value;
+    if (!JSON::Value::parseJSON(json, value))
         return { };
 
-    RefPtr<InspectorObject> object;
+    RefPtr<JSON::Object> object;
     if (!value->asObject(object))
         return { };
 
-    RefPtr<InspectorArray> kidsArray;
+    RefPtr<JSON::Array> kidsArray;
     if (!object->getArray("kids", kidsArray))
         return { };
 
@@ -83,8 +82,8 @@ static RefPtr<SharedBuffer> sanitizeKeyids(const SharedBuffer& buffer)
     if (keyIDBuffer.isEmpty())
         return nullptr;
 
-    auto object = InspectorObject::create();
-    auto kidsArray = InspectorArray::create();
+    auto object = JSON::Object::create();
+    auto kidsArray = JSON::Array::create();
     for (auto& buffer : keyIDBuffer)
         kidsArray->pushString(WTF::base64URLEncode(buffer->data(), buffer->size()));
     object->setArray("kids", WTFMove(kidsArray));
index 85266a4..80b4213 100644 (file)
@@ -36,7 +36,7 @@
 #include "HTMLParserIdioms.h"
 #include "NavigationScheduler.h"
 #include "PingLoader.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/CString.h>
 
@@ -80,11 +80,11 @@ Ref<FormData> XSSAuditorDelegate::generateViolationReport(const XSSInfo& xssInfo
             httpBody = formData->flattenToString();
     }
 
-    auto reportDetails = InspectorObject::create();
+    auto reportDetails = JSON::Object::create();
     reportDetails->setString("request-url", xssInfo.m_originalURL);
     reportDetails->setString("request-body", httpBody);
 
-    auto reportObject = InspectorObject::create();
+    auto reportObject = JSON::Object::create();
     reportObject->setObject("xss-report", WTFMove(reportDetails));
 
     return FormData::create(reportObject->toJSONString().utf8().data());
index 7a8f95c..6ff5225 100644 (file)
 #include "Pasteboard.h"
 #include "Storage.h"
 #include <bindings/ScriptValue.h>
-#include <inspector/InspectorValues.h>
 #include <inspector/agents/InspectorAgent.h>
 #include <inspector/agents/InspectorConsoleAgent.h>
 #include <runtime/JSCInlines.h>
 #include <runtime/JSLock.h>
+#include <wtf/JSONValues.h>
 #include <wtf/RefPtr.h>
 #include <wtf/StdLibExtras.h>
 
@@ -81,7 +81,7 @@ void CommandLineAPIHost::inspect(JSC::ExecState& state, JSC::JSValue valueToInsp
     if (!m_inspectorAgent)
         return;
 
-    RefPtr<InspectorObject> hintsObject;
+    RefPtr<JSON::Object> hintsObject;
     if (!Inspector::toInspectorValue(state, hintsValue)->asObject(hintsObject))
         return;
 
index 29e6018..1c0b3ba 100644 (file)
@@ -38,11 +38,14 @@ namespace JSC {
 class JSValue;
 }
 
+namespace JSON {
+class Object;
+class Value;
+}
+
 namespace Inspector {
 class InspectorAgent;
 class InspectorConsoleAgent;
-class InspectorObject;
-class InspectorValue;
 }
 
 namespace WebCore {
index 0e1e843..a68e5c1 100644 (file)
@@ -136,7 +136,7 @@ void InspectorCanvas::recordAction(const String& name, Vector<RecordCanvasAction
         m_frames = Inspector::Protocol::Array<Inspector::Protocol::Recording::Frame>::create();
 
     if (!m_currentActions) {
-        m_currentActions = Inspector::Protocol::Array<InspectorValue>::create();
+        m_currentActions = Inspector::Protocol::Array<JSON::Value>::create();
 
         auto frame = Inspector::Protocol::Recording::Frame::create()
             .setActions(m_currentActions)
@@ -171,7 +171,7 @@ RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Recording::Frame>>&& Insp
     return WTFMove(m_frames);
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>>&& InspectorCanvas::releaseData()
+RefPtr<Inspector::Protocol::Array<JSON::Value>>&& InspectorCanvas::releaseData()
 {
     m_indexedDuplicateData.clear();
     return WTFMove(m_serializedDuplicateData);
@@ -321,9 +321,9 @@ int InspectorCanvas::indexForData(DuplicateDataVariant data)
     }
 
     if (!m_serializedDuplicateData)
-        m_serializedDuplicateData = Inspector::Protocol::Array<InspectorValue>::create();
+        m_serializedDuplicateData = Inspector::Protocol::Array<JSON::Value>::create();
 
-    RefPtr<InspectorValue> item;
+    RefPtr<JSON::Value> item;
     WTF::switchOn(data,
         [&] (const HTMLImageElement* imageElement) {
             String dataURL = ASCIILiteral("data:,");
@@ -337,7 +337,7 @@ int InspectorCanvas::indexForData(DuplicateDataVariant data)
                 }
             }
 
-            item = InspectorValue::create(dataURL);
+            item = JSON::Value::create(dataURL);
         },
 #if ENABLE(VIDEO)
         [&] (HTMLVideoElement* videoElement) {
@@ -351,7 +351,7 @@ int InspectorCanvas::indexForData(DuplicateDataVariant data)
                 dataURL = imageBuffer->toDataURL("image/png");
             }
 
-            item = InspectorValue::create(dataURL);
+            item = JSON::Value::create(dataURL);
         },
 #endif
         [&] (HTMLCanvasElement* canvasElement) {
@@ -361,7 +361,7 @@ int InspectorCanvas::indexForData(DuplicateDataVariant data)
             if (!result.hasException())
                 dataURL = result.releaseReturnValue().string;
 
-            item = InspectorValue::create(dataURL);
+            item = JSON::Value::create(dataURL);
         },
         [&] (const CanvasGradient* canvasGradient) { item = buildArrayForCanvasGradient(*canvasGradient); },
         [&] (const CanvasPattern* canvasPattern) { item = buildArrayForCanvasPattern(*canvasPattern); },
@@ -375,7 +375,7 @@ int InspectorCanvas::indexForData(DuplicateDataVariant data)
             array->addItem(static_cast<int>(scriptCallFrame.columnNumber()));
             item = WTFMove(array);
         },
-        [&] (const String& value) { item = InspectorValue::create(value); }
+        [&] (const String& value) { item = JSON::Value::create(value); }
     );
 
     m_bufferUsed += item->memoryCost();
@@ -401,9 +401,9 @@ static RefPtr<Inspector::Protocol::Array<double>> buildArrayForAffineTransform(c
 }
 
 template <typename T>
-static RefPtr<Inspector::Protocol::Array<InspectorValue>> buildArrayForVector(const Vector<T>& vector)
+static RefPtr<Inspector::Protocol::Array<JSON::Value>> buildArrayForVector(const Vector<T>& vector)
 {
-    RefPtr<Inspector::Protocol::Array<InspectorValue>> array = Inspector::Protocol::Array<InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> array = Inspector::Protocol::Array<JSON::Value>::create();
     for (auto& item : vector)
         array->addItem(item);
     return array;
@@ -414,11 +414,11 @@ RefPtr<Inspector::Protocol::Recording::InitialState> InspectorCanvas::buildIniti
     RefPtr<Inspector::Protocol::Recording::InitialState> initialState = Inspector::Protocol::Recording::InitialState::create()
         .release();
 
-    auto attributes = InspectorObject::create();
+    auto attributes = JSON::Object::create();
     attributes->setInteger(ASCIILiteral("width"), canvas().width());
     attributes->setInteger(ASCIILiteral("height"), canvas().height());
 
-    auto parameters = Inspector::Protocol::Array<InspectorValue>::create();
+    auto parameters = Inspector::Protocol::Array<JSON::Value>::create();
 
     CanvasRenderingContext* canvasRenderingContext = canvas().renderingContext();
     if (is<CanvasRenderingContext2D>(canvasRenderingContext)) {
@@ -439,7 +439,7 @@ RefPtr<Inspector::Protocol::Recording::InitialState> InspectorCanvas::buildIniti
 
         // The parameter to `setLineDash` is itself an array, so we need to wrap the parameters
         // list in an array to allow spreading.
-        auto setLineDash = Inspector::Protocol::Array<InspectorValue>::create();
+        auto setLineDash = Inspector::Protocol::Array<JSON::Value>::create();
         setLineDash->addItem(buildArrayForVector(state.lineDash));
         attributes->setArray(ASCIILiteral("setLineDash"), WTFMove(setLineDash));
 
@@ -470,7 +470,7 @@ RefPtr<Inspector::Protocol::Recording::InitialState> InspectorCanvas::buildIniti
         attributes->setBoolean(ASCIILiteral("imageSmoothingEnabled"), context2d->imageSmoothingEnabled());
         attributes->setInteger(ASCIILiteral("imageSmoothingQuality"), indexForData(convertEnumerationToString(context2d->imageSmoothingQuality())));
 
-        auto setPath = Inspector::Protocol::Array<InspectorValue>::create();
+        auto setPath = Inspector::Protocol::Array<JSON::Value>::create();
         setPath->addItem(indexForData(buildStringFromPath(context2d->getPath()->path())));
         attributes->setArray(ASCIILiteral("setPath"), WTFMove(setPath));
     }
@@ -478,7 +478,7 @@ RefPtr<Inspector::Protocol::Recording::InitialState> InspectorCanvas::buildIniti
     else if (is<WebGLRenderingContextBase>(canvasRenderingContext)) {
         WebGLRenderingContextBase* contextWebGLBase = downcast<WebGLRenderingContextBase>(canvasRenderingContext);
         if (std::optional<WebGLContextAttributes> attributes = contextWebGLBase->getContextAttributes()) {
-            RefPtr<InspectorObject> contextAttributes = InspectorObject::create();
+            RefPtr<JSON::Object> contextAttributes = JSON::Object::create();
             contextAttributes->setBoolean(ASCIILiteral("alpha"), attributes->alpha);
             contextAttributes->setBoolean(ASCIILiteral("depth"), attributes->depth);
             contextAttributes->setBoolean(ASCIILiteral("stencil"), attributes->stencil);
@@ -501,12 +501,12 @@ RefPtr<Inspector::Protocol::Recording::InitialState> InspectorCanvas::buildIniti
     return initialState;
 }
 
-RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> InspectorCanvas::buildAction(const String& name, Vector<RecordCanvasActionVariant>&& parameters)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildAction(const String& name, Vector<RecordCanvasActionVariant>&& parameters)
 {
-    RefPtr<Inspector::Protocol::Array<InspectorValue>> action = Inspector::Protocol::Array<InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> action = Inspector::Protocol::Array<JSON::Value>::create();
     action->addItem(indexForData(name));
 
-    RefPtr<Inspector::Protocol::Array<InspectorValue>> parametersData = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> parametersData = Inspector::Protocol::Array<JSON::Value>::create();
     RefPtr<Inspector::Protocol::Array<int>> swizzleTypes = Inspector::Protocol::Array<int>::create();
 
     auto addParameter = [&parametersData, &swizzleTypes] (auto value, RecordingSwizzleTypes swizzleType) {
@@ -589,7 +589,7 @@ RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> InspectorCanvas::b
     return action;
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayForCanvasGradient(const CanvasGradient& canvasGradient)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildArrayForCanvasGradient(const CanvasGradient& canvasGradient)
 {
     const Gradient& gradient = canvasGradient.gradient();
     bool isRadial = gradient.isRadial();
@@ -606,22 +606,22 @@ RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayFo
     if (isRadial)
         parameters->addItem(gradient.endRadius());
 
-    RefPtr<Inspector::Protocol::Array<InspectorValue>> stops = Inspector::Protocol::Array<InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> stops = Inspector::Protocol::Array<JSON::Value>::create();
     for (const Gradient::ColorStop& colorStop : gradient.stops()) {
-        RefPtr<Inspector::Protocol::Array<InspectorValue>> stop = Inspector::Protocol::Array<InspectorValue>::create();
+        RefPtr<Inspector::Protocol::Array<JSON::Value>> stop = Inspector::Protocol::Array<JSON::Value>::create();
         stop->addItem(colorStop.offset);
         stop->addItem(indexForData(colorStop.color.cssText()));
         stops->addItem(WTFMove(stop));
     }
 
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> array = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> array = Inspector::Protocol::Array<JSON::Value>::create();
     array->addItem(indexForData(type));
     array->addItem(WTFMove(parameters));
     array->addItem(WTFMove(stops));
     return array;
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayForCanvasPattern(const CanvasPattern& canvasPattern)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildArrayForCanvasPattern(const CanvasPattern& canvasPattern)
 {
     Image& tileImage = canvasPattern.pattern().tileImage();
     std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(tileImage.size(), RenderingMode::Unaccelerated);
@@ -639,29 +639,29 @@ RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayFo
     else
         repeat = ASCIILiteral("no-repeat");
 
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> array = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> array = Inspector::Protocol::Array<JSON::Value>::create();
     array->addItem(indexForData(imageBuffer->toDataURL("image/png")));
     array->addItem(indexForData(repeat));
     return array;
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayForImageData(const ImageData& imageData)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildArrayForImageData(const ImageData& imageData)
 {
     RefPtr<Inspector::Protocol::Array<int>> data = Inspector::Protocol::Array<int>::create();
     for (size_t i = 0; i < imageData.data()->length(); ++i)
         data->addItem(imageData.data()->item(i));
 
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> array = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> array = Inspector::Protocol::Array<JSON::Value>::create();
     array->addItem(WTFMove(data));
     array->addItem(imageData.width());
     array->addItem(imageData.height());
     return array;
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayForImageBitmap(const ImageBitmap& imageBitmap)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildArrayForImageBitmap(const ImageBitmap& imageBitmap)
 {
     // FIXME: Needs to include the data somehow.
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> array = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> array = Inspector::Protocol::Array<JSON::Value>::create();
     array->addItem(static_cast<int>(imageBitmap.width()));
     array->addItem(static_cast<int>(imageBitmap.height()));
     return array;
index 01faabd..2974098 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "CallTracerTypes.h"
 #include <inspector/InspectorProtocolObjects.h>
-#include <inspector/InspectorValues.h>
 #include <inspector/ScriptCallFrame.h>
 #include <wtf/HashMap.h>
 #include <wtf/Ref.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
+namespace JSON {
+class Value;
+}
+
 namespace WebCore {
 
 class CanvasGradient;
@@ -64,7 +67,7 @@ public:
 
     RefPtr<Inspector::Protocol::Recording::InitialState>&& releaseInitialState();
     RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Recording::Frame>>&& releaseFrames();
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>>&& releaseData();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>>&& releaseData();
 
     void finalizeFrame();
     void markCurrentFrameIncomplete();
@@ -101,11 +104,11 @@ private:
 
     int indexForData(DuplicateDataVariant);
     RefPtr<Inspector::Protocol::Recording::InitialState> buildInitialState();
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildAction(const String&, Vector<RecordCanvasActionVariant>&& = { });
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForCanvasGradient(const CanvasGradient&);
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForCanvasPattern(const CanvasPattern&);
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForImageData(const ImageData&);
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForImageBitmap(const ImageBitmap&);
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildAction(const String&, Vector<RecordCanvasActionVariant>&& = { });
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildArrayForCanvasGradient(const CanvasGradient&);
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildArrayForCanvasPattern(const CanvasPattern&);
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildArrayForImageData(const ImageData&);
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildArrayForImageBitmap(const ImageBitmap&);
 
     String m_identifier;
     HTMLCanvasElement& m_canvas;
@@ -113,9 +116,9 @@ private:
 
     RefPtr<Inspector::Protocol::Recording::InitialState> m_initialState;
     RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Recording::Frame>> m_frames;
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> m_currentActions;
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> m_actionNeedingSnapshot;
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> m_serializedDuplicateData;
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> m_currentActions;
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> m_actionNeedingSnapshot;
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> m_serializedDuplicateData;
     Vector<DuplicateDataVariant> m_indexedDuplicateData;
     double m_currentFrameStartTime { NAN };
     size_t m_bufferLimit { 100 * 1024 * 1024 };
index b06fa09..6ec893c 100644 (file)
@@ -32,7 +32,6 @@
 #include "InspectorDatabaseResource.h"
 
 #include "Database.h"
-#include <inspector/InspectorValues.h>
 
 
 namespace WebCore {
index cc06d03..9ad68b3 100644 (file)
@@ -57,7 +57,7 @@
 #include "SocketProvider.h"
 #include "StyledElement.h"
 #include <inspector/InspectorProtocolObjects.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 
 namespace WebCore {
@@ -749,14 +749,14 @@ void InspectorOverlay::reset(const IntSize& viewportSize, const IntSize& frameVi
     evaluateInOverlay("reset", WTFMove(configObject));
 }
 
-static void evaluateCommandInOverlay(Page* page, Ref<InspectorArray>&& command)
+static void evaluateCommandInOverlay(Page* page, Ref<JSON::Array>&& command)
 {
     page->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')')));
 }
 
 void InspectorOverlay::evaluateInOverlay(const String& method)
 {
-    Ref<InspectorArray> command = InspectorArray::create();
+    Ref<JSON::Array> command = JSON::Array::create();
     command->pushString(method);
 
     evaluateCommandInOverlay(overlayPage(), WTFMove(command));
@@ -764,16 +764,16 @@ void InspectorOverlay::evaluateInOverlay(const String& method)
 
 void InspectorOverlay::evaluateInOverlay(const String& method, const String& argument)
 {
-    Ref<InspectorArray> command = InspectorArray::create();
+    Ref<JSON::Array> command = JSON::Array::create();
     command->pushString(method);
     command->pushString(argument);
 
     evaluateCommandInOverlay(overlayPage(), WTFMove(command));
 }
 
-void InspectorOverlay::evaluateInOverlay(const String& method, RefPtr<InspectorValue>&& argument)
+void InspectorOverlay::evaluateInOverlay(const String& method, RefPtr<JSON::Value>&& argument)
 {
-    Ref<InspectorArray> command = InspectorArray::create();
+    Ref<JSON::Array> command = JSON::Array::create();
     command->pushString(method);
     command->pushValue(WTFMove(argument));
 
index a8af0d2..85b0804 100644 (file)
@@ -39,9 +39,9 @@
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
-namespace Inspector {
-class InspectorObject;
-class InspectorValue;
+namespace JSON {
+class Object;
+class Value;
 
 namespace Protocol {
 namespace OverlayTypes {
@@ -151,7 +151,7 @@ private:
     void reset(const IntSize& viewportSize, const IntSize& frameViewFullSize);
     void evaluateInOverlay(const String& method);
     void evaluateInOverlay(const String& method, const String& argument);
-    void evaluateInOverlay(const String& method, RefPtr<Inspector::InspectorValue>&& argument);
+    void evaluateInOverlay(const String& method, RefPtr<JSON::Value>&& argument);
 
     Page& m_page;
     InspectorClient* m_client;
index 6ba56ad..50256df 100644 (file)
@@ -26,7 +26,6 @@
 #pragma once
 
 #include <inspector/InspectorProtocolObjects.h>
-#include <inspector/InspectorValues.h>
 
 namespace WebCore {