Skip to content

Commit df53e2a

Browse files
committed
Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
https://bugs.webkit.org/show_bug.cgi?id=173662 Reviewed by Joseph Pecoraro. Source/JavaScriptCore: Adopt new type names. Fix protocol generator to use correct type names. * inspector/ConsoleMessage.cpp: (Inspector::ConsoleMessage::addToFrontend): Improve namings and use 'auto' when the type is obvious and repeated. * inspector/ContentSearchUtilities.cpp: (Inspector::ContentSearchUtilities::searchInTextByLines): * inspector/ContentSearchUtilities.h: * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): (Inspector::InjectedScript::getInternalProperties): (Inspector::InjectedScript::getCollectionEntries): (Inspector::InjectedScript::wrapCallFrames const): * inspector/InjectedScript.h: * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::runtimeCast): (Inspector::Protocol::Array::Array): Deleted. (Inspector::Protocol::Array::openAccessors): Deleted. (Inspector::Protocol::Array::addItem): Deleted. (Inspector::Protocol::Array::create): Deleted. (Inspector::Protocol::BindingTraits<Protocol::Array<T>>::runtimeCast): Deleted. (Inspector::Protocol::BindingTraits<Protocol::Array<T>>::assertValueHasExpectedType): Deleted. Move the implementation out of this file. * inspector/ScriptCallStack.cpp: (Inspector::ScriptCallStack::buildInspectorArray const): * inspector/ScriptCallStack.h: * inspector/agents/InspectorAgent.cpp: (Inspector::InspectorAgent::activateExtraDomain): (Inspector::InspectorAgent::activateExtraDomains): * inspector/agents/InspectorAgent.h: * inspector/agents/InspectorConsoleAgent.cpp: (Inspector::InspectorConsoleAgent::getLoggingChannels): * inspector/agents/InspectorConsoleAgent.h: * inspector/agents/InspectorDebuggerAgent.cpp: (Inspector::InspectorDebuggerAgent::setBreakpointByUrl): (Inspector::InspectorDebuggerAgent::searchInContent): (Inspector::InspectorDebuggerAgent::currentCallFrames): * inspector/agents/InspectorDebuggerAgent.h: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): (Inspector::InspectorRuntimeAgent::getDisplayableProperties): (Inspector::InspectorRuntimeAgent::getCollectionEntries): (Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets): (Inspector::InspectorRuntimeAgent::getBasicBlocks): * inspector/agents/InspectorRuntimeAgent.h: * inspector/agents/InspectorScriptProfilerAgent.cpp: (Inspector::buildSamples): Use more 'auto' and rename a variable. * inspector/scripts/codegen/cpp_generator.py: (CppGenerator.cpp_protocol_type_for_type): Adopt new type names. This exposed a latent bug where we should have been unwrapping an AliasedType prior to generating a C++ type for it. The aliased type may be an array, in which case we would have generated the wrong type. * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: (_generate_typedefs_for_domain.JSON): (_generate_typedefs_for_domain.Inspector): Deleted. * inspector/scripts/codegen/objc_generator.py: (ObjCGenerator.protocol_type_for_type): (ObjCGenerator.objc_protocol_export_expression_for_variable): * 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/events-with-optional-parameters.json-result: * inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result: * inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result: * inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result: Rebaseline. * runtime/TypeSet.cpp: (JSC::TypeSet::allStructureRepresentations const): (JSC::StructureShape::inspectorRepresentation): * runtime/TypeSet.h: Source/WebCore: Adopt new type names. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::releaseFrames): (WebCore::InspectorCanvas::releaseData): (WebCore::InspectorCanvas::indexForData): (WebCore::buildArrayForAffineTransform): (WebCore::buildArrayForVector): (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): (WebCore::InspectorCanvas::buildArrayForCanvasGradient): (WebCore::InspectorCanvas::buildArrayForCanvasPattern): (WebCore::InspectorCanvas::buildArrayForImageData): (WebCore::InspectorCanvas::buildArrayForImageBitmap): * inspector/InspectorCanvas.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::buildObjectForHighlightedNodes const): * inspector/InspectorController.h: * inspector/InspectorOverlay.cpp: (WebCore::buildObjectForHighlight): (WebCore::InspectorOverlay::drawPaintRects): (WebCore::buildArrayForRendererFragments): (WebCore::buildObjectForElementData): (WebCore::InspectorOverlay::buildHighlightObjectForNode const): (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): * inspector/InspectorOverlay.h: * inspector/InspectorStyleSheet.cpp: (WebCore::fillMediaListChain): (WebCore::InspectorStyle::buildArrayForComputedStyle const): (WebCore::InspectorStyle::styleWithProperties const): (WebCore::buildObjectForSelectorHelper): (WebCore::selectorsFromSource): (WebCore::InspectorStyleSheet::buildObjectForSelectorList): (WebCore::InspectorStyleSheet::buildObjectForRule): (WebCore::InspectorStyleSheet::buildObjectForStyle): (WebCore::InspectorStyleSheet::buildArrayForRuleList): * inspector/InspectorStyleSheet.h: * inspector/agents/InspectorApplicationCacheAgent.cpp: (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests): (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources): * inspector/agents/InspectorApplicationCacheAgent.h: * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getMatchedStylesForNode): (WebCore::InspectorCSSAgent::getComputedStyleForNode): (WebCore::InspectorCSSAgent::getAllStyleSheets): (WebCore::InspectorCSSAgent::getSupportedCSSProperties): (WebCore::InspectorCSSAgent::getSupportedSystemFontFamilyNames): (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList): * inspector/agents/InspectorCSSAgent.h: * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): * inspector/agents/InspectorCanvasAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::querySelectorAll): (WebCore::InspectorDOMAgent::pushNodePathToFrontend): (WebCore::InspectorDOMAgent::getEventListenersForNode): (WebCore::InspectorDOMAgent::getSearchResults): (WebCore::InspectorDOMAgent::getAttributes): (WebCore::InspectorDOMAgent::buildObjectForNode): (WebCore::InspectorDOMAgent::buildArrayForElementAttributes): (WebCore::InspectorDOMAgent::buildArrayForContainerChildren): (WebCore::InspectorDOMAgent::buildArrayForPseudoElements): (WebCore::InspectorDOMAgent::processAccessibilityChildren): (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): (WebCore::InspectorDOMAgent::styleAttributeInvalidated): * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::getDOMStorageItems): * inspector/agents/InspectorDOMStorageAgent.h: * inspector/agents/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::getDatabaseTableNames): * inspector/agents/InspectorDatabaseAgent.h: * inspector/agents/InspectorIndexedDBAgent.cpp: (WebCore::Inspector::keyPathFromIDBKeyPath): (WebCore::InspectorIndexedDBAgent::requestDatabaseNames): * inspector/agents/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::layersForNode): (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy): (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy): * inspector/agents/InspectorLayerTreeAgent.h: * inspector/agents/InspectorMemoryAgent.cpp: (WebCore::InspectorMemoryAgent::collectSample): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::searchOtherRequests): (WebCore::InspectorNetworkAgent::searchInRequest): * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::buildArrayForCookies): (WebCore::InspectorPageAgent::getCookies): (WebCore::InspectorPageAgent::searchInResource): (WebCore::InspectorPageAgent::searchInResources): (WebCore::InspectorPageAgent::buildObjectForFrameTree): * inspector/agents/InspectorPageAgent.h: * inspector/agents/WebConsoleAgent.cpp: (WebCore::WebConsoleAgent::getLoggingChannels): * inspector/agents/WebConsoleAgent.h: Source/WebKit: Adopt new type names. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::getNextContext): (WebKit::WebAutomationSession::getBrowsingContexts): (WebKit::buildArrayForCookies): (WebKit::WebAutomationSession::getSessionPermissions): * UIProcess/Automation/WebAutomationSession.h: Source/WTF: Move Inspector::Protocol::Array<T> to JSON::ArrayOf<T>. * wtf/JSONValues.h: (WTF::JSONImpl::ArrayOf::ArrayOf): (WTF::JSONImpl::ArrayOf::openAccessors): (WTF::JSONImpl::ArrayOf::addItem): (WTF::JSONImpl::ArrayOf::create): Tools: Add duplicate test cases for JSON::ArrayOf<T> based on JSON::Array. * TestWebKitAPI/Tests/WTF/JSONValue.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/196270@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent bdd767a commit df53e2a

67 files changed

Lines changed: 678 additions & 356 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,87 @@
1+
2017-12-01 Brian Burg <bburg@apple.com>
2+
3+
Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
4+
https://bugs.webkit.org/show_bug.cgi?id=173662
5+
6+
Reviewed by Joseph Pecoraro.
7+
8+
Adopt new type names. Fix protocol generator to use correct type names.
9+
10+
* inspector/ConsoleMessage.cpp:
11+
(Inspector::ConsoleMessage::addToFrontend):
12+
Improve namings and use 'auto' when the type is obvious and repeated.
13+
14+
* inspector/ContentSearchUtilities.cpp:
15+
(Inspector::ContentSearchUtilities::searchInTextByLines):
16+
* inspector/ContentSearchUtilities.h:
17+
* inspector/InjectedScript.cpp:
18+
(Inspector::InjectedScript::getProperties):
19+
(Inspector::InjectedScript::getDisplayableProperties):
20+
(Inspector::InjectedScript::getInternalProperties):
21+
(Inspector::InjectedScript::getCollectionEntries):
22+
(Inspector::InjectedScript::wrapCallFrames const):
23+
* inspector/InjectedScript.h:
24+
* inspector/InspectorProtocolTypes.h:
25+
(Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::runtimeCast):
26+
(Inspector::Protocol::Array::Array): Deleted.
27+
(Inspector::Protocol::Array::openAccessors): Deleted.
28+
(Inspector::Protocol::Array::addItem): Deleted.
29+
(Inspector::Protocol::Array::create): Deleted.
30+
(Inspector::Protocol::BindingTraits<Protocol::Array<T>>::runtimeCast): Deleted.
31+
(Inspector::Protocol::BindingTraits<Protocol::Array<T>>::assertValueHasExpectedType): Deleted.
32+
Move the implementation out of this file.
33+
34+
* inspector/ScriptCallStack.cpp:
35+
(Inspector::ScriptCallStack::buildInspectorArray const):
36+
* inspector/ScriptCallStack.h:
37+
* inspector/agents/InspectorAgent.cpp:
38+
(Inspector::InspectorAgent::activateExtraDomain):
39+
(Inspector::InspectorAgent::activateExtraDomains):
40+
* inspector/agents/InspectorAgent.h:
41+
* inspector/agents/InspectorConsoleAgent.cpp:
42+
(Inspector::InspectorConsoleAgent::getLoggingChannels):
43+
* inspector/agents/InspectorConsoleAgent.h:
44+
* inspector/agents/InspectorDebuggerAgent.cpp:
45+
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
46+
(Inspector::InspectorDebuggerAgent::searchInContent):
47+
(Inspector::InspectorDebuggerAgent::currentCallFrames):
48+
* inspector/agents/InspectorDebuggerAgent.h:
49+
* inspector/agents/InspectorRuntimeAgent.cpp:
50+
(Inspector::InspectorRuntimeAgent::getProperties):
51+
(Inspector::InspectorRuntimeAgent::getDisplayableProperties):
52+
(Inspector::InspectorRuntimeAgent::getCollectionEntries):
53+
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
54+
(Inspector::InspectorRuntimeAgent::getBasicBlocks):
55+
* inspector/agents/InspectorRuntimeAgent.h:
56+
* inspector/agents/InspectorScriptProfilerAgent.cpp:
57+
(Inspector::buildSamples):
58+
Use more 'auto' and rename a variable.
59+
60+
* inspector/scripts/codegen/cpp_generator.py:
61+
(CppGenerator.cpp_protocol_type_for_type):
62+
Adopt new type names. This exposed a latent bug where we should have been
63+
unwrapping an AliasedType prior to generating a C++ type for it. The aliased
64+
type may be an array, in which case we would have generated the wrong type.
65+
66+
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
67+
(_generate_typedefs_for_domain.JSON):
68+
(_generate_typedefs_for_domain.Inspector): Deleted.
69+
* inspector/scripts/codegen/objc_generator.py:
70+
(ObjCGenerator.protocol_type_for_type):
71+
(ObjCGenerator.objc_protocol_export_expression_for_variable):
72+
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
73+
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
74+
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
75+
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
76+
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
77+
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
78+
Rebaseline.
79+
80+
* runtime/TypeSet.cpp:
81+
(JSC::TypeSet::allStructureRepresentations const):
82+
(JSC::StructureShape::inspectorRepresentation):
83+
* runtime/TypeSet.h:
84+
185
2017-12-01 Saam Barati <sbarati@apple.com>
286

387
Having a bad time needs to handle ArrayClass indexing type as well

‎Source/JavaScriptCore/inspector/ConsoleMessage.cpp‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,26 +172,26 @@ static Inspector::Protocol::Console::ConsoleMessage::Level messageLevelValue(Mes
172172

173173
void ConsoleMessage::addToFrontend(ConsoleFrontendDispatcher& consoleFrontendDispatcher, InjectedScriptManager& injectedScriptManager, bool generatePreview)
174174
{
175-
Ref<Inspector::Protocol::Console::ConsoleMessage> jsonObj = Inspector::Protocol::Console::ConsoleMessage::create()
175+
auto messageObject = Inspector::Protocol::Console::ConsoleMessage::create()
176176
.setSource(messageSourceValue(m_source))
177177
.setLevel(messageLevelValue(m_level))
178178
.setText(m_message)
179179
.release();
180180

181181
// FIXME: only send out type for ConsoleAPI source messages.
182-
jsonObj->setType(messageTypeValue(m_type));
183-
jsonObj->setLine(static_cast<int>(m_line));
184-
jsonObj->setColumn(static_cast<int>(m_column));
185-
jsonObj->setUrl(m_url);
186-
jsonObj->setRepeatCount(static_cast<int>(m_repeatCount));
182+
messageObject->setType(messageTypeValue(m_type));
183+
messageObject->setLine(static_cast<int>(m_line));
184+
messageObject->setColumn(static_cast<int>(m_column));
185+
messageObject->setUrl(m_url);
186+
messageObject->setRepeatCount(static_cast<int>(m_repeatCount));
187187

188188
if (m_source == MessageSource::Network && !m_requestId.isEmpty())
189-
jsonObj->setNetworkRequestId(m_requestId);
189+
messageObject->setNetworkRequestId(m_requestId);
190190

191191
if (m_arguments && m_arguments->argumentCount()) {
192192
InjectedScript injectedScript = injectedScriptManager.injectedScriptFor(m_arguments->globalState());
193193
if (!injectedScript.hasNoValue()) {
194-
Ref<Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>> jsonArgs = Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>::create();
194+
auto argumentsObject = JSON::ArrayOf<Inspector::Protocol::Runtime::RemoteObject>::create();
195195
if (m_type == MessageType::Table && generatePreview && m_arguments->argumentCount()) {
196196
Deprecated::ScriptValue table = m_arguments->argumentAt(0);
197197
Deprecated::ScriptValue columns = m_arguments->argumentCount() > 1 ? m_arguments->argumentAt(1) : Deprecated::ScriptValue();
@@ -200,27 +200,27 @@ void ConsoleMessage::addToFrontend(ConsoleFrontendDispatcher& consoleFrontendDis
200200
ASSERT_NOT_REACHED();
201201
return;
202202
}
203-
jsonArgs->addItem(inspectorValue.copyRef());
203+
argumentsObject->addItem(inspectorValue.copyRef());
204204
if (m_arguments->argumentCount() > 1)
205-
jsonArgs->addItem(injectedScript.wrapObject(columns, ASCIILiteral("console"), true));
205+
argumentsObject->addItem(injectedScript.wrapObject(columns, ASCIILiteral("console"), true));
206206
} else {
207207
for (unsigned i = 0; i < m_arguments->argumentCount(); ++i) {
208208
RefPtr<Inspector::Protocol::Runtime::RemoteObject> inspectorValue = injectedScript.wrapObject(m_arguments->argumentAt(i), ASCIILiteral("console"), generatePreview);
209209
if (!inspectorValue) {
210210
ASSERT_NOT_REACHED();
211211
return;
212212
}
213-
jsonArgs->addItem(inspectorValue.copyRef());
213+
argumentsObject->addItem(inspectorValue.copyRef());
214214
}
215215
}
216-
jsonObj->setParameters(WTFMove(jsonArgs));
216+
messageObject->setParameters(WTFMove(argumentsObject));
217217
}
218218
}
219219

220220
if (m_callStack)
221-
jsonObj->setStackTrace(m_callStack->buildInspectorArray());
221+
messageObject->setStackTrace(m_callStack->buildInspectorArray());
222222

223-
consoleFrontendDispatcher.messageAdded(WTFMove(jsonObj));
223+
consoleFrontendDispatcher.messageAdded(WTFMove(messageObject));
224224
}
225225

226226
void ConsoleMessage::updateRepeatCountInConsole(ConsoleFrontendDispatcher& consoleFrontendDispatcher)

‎Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ int countRegularExpressionMatches(const RegularExpression& regex, const String&
151151
return result;
152152
}
153153

154-
Ref<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex)
154+
Ref<JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex)
155155
{
156-
Ref<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> result = Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>::create();
156+
auto result = JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>::create();
157157

158158
RegularExpression regex = ContentSearchUtilities::createSearchRegex(query, caseSensitive, isRegex);
159159
Vector<std::pair<size_t, String>> matches = getRegularExpressionMatchesByLines(regex, text);

‎Source/JavaScriptCore/inspector/ContentSearchUtilities.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace ContentSearchUtilities {
4343

4444
JS_EXPORT_PRIVATE JSC::Yarr::RegularExpression createSearchRegex(const String& query, bool caseSensitive, bool isRegex);
4545
JS_EXPORT_PRIVATE int countRegularExpressionMatches(const JSC::Yarr::RegularExpression&, const String&);
46-
JS_EXPORT_PRIVATE Ref<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex);
46+
JS_EXPORT_PRIVATE Ref<JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex);
4747
JS_EXPORT_PRIVATE TextPosition textPositionFromOffset(size_t offset, const Vector<size_t>& lineEndings);
4848
JS_EXPORT_PRIVATE std::unique_ptr<Vector<size_t>> lineEndings(const String&);
4949

‎Source/JavaScriptCore/inspector/InjectedScript.cpp‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#include <wtf/JSONValues.h>
3939
#include <wtf/text/WTFString.h>
4040

41-
using Inspector::Protocol::Array;
42-
4341
namespace Inspector {
4442

4543
InjectedScript::InjectedScript()
@@ -141,7 +139,7 @@ void InjectedScript::getPreview(ErrorString& errorString, const String& objectId
141139
*result = BindingTraits<Inspector::Protocol::Runtime::ObjectPreview>::runtimeCast(WTFMove(resultValue));
142140
}
143141

144-
void InjectedScript::getProperties(ErrorString& errorString, const String& objectId, bool ownProperties, bool generatePreview, RefPtr<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>* properties)
142+
void InjectedScript::getProperties(ErrorString& errorString, const String& objectId, bool ownProperties, bool generatePreview, RefPtr<JSON::ArrayOf<Inspector::Protocol::Runtime::PropertyDescriptor>>* properties)
145143
{
146144
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getProperties"), inspectorEnvironment()->functionCallHandler());
147145
function.appendArgument(objectId);
@@ -155,10 +153,10 @@ void InjectedScript::getProperties(ErrorString& errorString, const String& objec
155153
return;
156154
}
157155

158-
*properties = BindingTraits<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>::runtimeCast(WTFMove(result));
156+
*properties = BindingTraits<JSON::ArrayOf<Inspector::Protocol::Runtime::PropertyDescriptor>>::runtimeCast(WTFMove(result));
159157
}
160158

161-
void InjectedScript::getDisplayableProperties(ErrorString& errorString, const String& objectId, bool generatePreview, RefPtr<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>* properties)
159+
void InjectedScript::getDisplayableProperties(ErrorString& errorString, const String& objectId, bool generatePreview, RefPtr<JSON::ArrayOf<Inspector::Protocol::Runtime::PropertyDescriptor>>* properties)
162160
{
163161
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getDisplayableProperties"), inspectorEnvironment()->functionCallHandler());
164162
function.appendArgument(objectId);
@@ -171,10 +169,10 @@ void InjectedScript::getDisplayableProperties(ErrorString& errorString, const St
171169
return;
172170
}
173171

174-
*properties = BindingTraits<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>::runtimeCast(WTFMove(result));
172+
*properties = BindingTraits<JSON::ArrayOf<Inspector::Protocol::Runtime::PropertyDescriptor>>::runtimeCast(WTFMove(result));
175173
}
176174

177-
void InjectedScript::getInternalProperties(ErrorString& errorString, const String& objectId, bool generatePreview, RefPtr<Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>* properties)
175+
void InjectedScript::getInternalProperties(ErrorString& errorString, const String& objectId, bool generatePreview, RefPtr<JSON::ArrayOf<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>* properties)
178176
{
179177
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getInternalProperties"), inspectorEnvironment()->functionCallHandler());
180178
function.appendArgument(objectId);
@@ -187,11 +185,11 @@ void InjectedScript::getInternalProperties(ErrorString& errorString, const Strin
187185
return;
188186
}
189187

190-
auto array = BindingTraits<Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>::runtimeCast(WTFMove(result));
188+
auto array = BindingTraits<JSON::ArrayOf<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>::runtimeCast(WTFMove(result));
191189
*properties = array->length() > 0 ? array : nullptr;
192190
}
193191

194-
void InjectedScript::getCollectionEntries(ErrorString& errorString, const String& objectId, const String& objectGroup, int startIndex, int numberToFetch, RefPtr<Protocol::Array<Protocol::Runtime::CollectionEntry>>* entries)
192+
void InjectedScript::getCollectionEntries(ErrorString& errorString, const String& objectId, const String& objectGroup, int startIndex, int numberToFetch, RefPtr<JSON::ArrayOf<Protocol::Runtime::CollectionEntry>>* entries)
195193
{
196194
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getCollectionEntries"), inspectorEnvironment()->functionCallHandler());
197195
function.appendArgument(objectId);
@@ -206,7 +204,7 @@ void InjectedScript::getCollectionEntries(ErrorString& errorString, const String
206204
return;
207205
}
208206

209-
*entries = BindingTraits<Array<Protocol::Runtime::CollectionEntry>>::runtimeCast(WTFMove(result));
207+
*entries = BindingTraits<JSON::ArrayOf<Protocol::Runtime::CollectionEntry>>::runtimeCast(WTFMove(result));
210208
}
211209

212210
void InjectedScript::saveResult(ErrorString& errorString, const String& callArgumentJSON, Inspector::Protocol::OptOutput<int>* savedResultIndex)
@@ -226,7 +224,7 @@ void InjectedScript::saveResult(ErrorString& errorString, const String& callArgu
226224
*savedResultIndex = savedResultIndexInt;
227225
}
228226

229-
Ref<Array<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFrames(JSC::JSValue callFrames) const
227+
Ref<JSON::ArrayOf<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFrames(JSC::JSValue callFrames) const
230228
{
231229
ASSERT(!hasNoValue());
232230
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("wrapCallFrames"), inspectorEnvironment()->functionCallHandler());
@@ -235,13 +233,13 @@ Ref<Array<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFra
235233
bool hadException = false;
236234
auto callFramesValue = callFunctionWithEvalEnabled(function, hadException);
237235
if (!callFramesValue)
238-
return Array<Inspector::Protocol::Debugger::CallFrame>::create();
236+
return JSON::ArrayOf<Inspector::Protocol::Debugger::CallFrame>::create();
239237
ASSERT(!hadException);
240238
RefPtr<JSON::Value> result = toInspectorValue(*scriptState(), callFramesValue);
241239
if (result->type() == JSON::Value::Type::Array)
242-
return BindingTraits<Array<Inspector::Protocol::Debugger::CallFrame>>::runtimeCast(WTFMove(result)).releaseNonNull();
240+
return BindingTraits<JSON::ArrayOf<Inspector::Protocol::Debugger::CallFrame>>::runtimeCast(WTFMove(result)).releaseNonNull();
243241

244-
return Array<Inspector::Protocol::Debugger::CallFrame>::create();
242+
return JSON::ArrayOf<Inspector::Protocol::Debugger::CallFrame>::create();
245243
}
246244

247245
RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(JSC::JSValue value, const String& groupName, bool generatePreview) const

‎Source/JavaScriptCore/inspector/InjectedScript.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ class JS_EXPORT_PRIVATE InjectedScript : public InjectedScriptBase {
5656
void getFunctionDetails(ErrorString&, const String& functionId, RefPtr<Protocol::Debugger::FunctionDetails>* result);
5757
void functionDetails(ErrorString&, JSC::JSValue, RefPtr<Protocol::Debugger::FunctionDetails>* result);
5858
void getPreview(ErrorString&, const String& objectId, RefPtr<Protocol::Runtime::ObjectPreview>* result);
59-
void getProperties(ErrorString&, const String& objectId, bool ownProperties, bool generatePreview, RefPtr<Protocol::Array<Protocol::Runtime::PropertyDescriptor>>* result);
60-
void getDisplayableProperties(ErrorString&, const String& objectId, bool generatePreview, RefPtr<Protocol::Array<Protocol::Runtime::PropertyDescriptor>>* result);
61-
void getInternalProperties(ErrorString&, const String& objectId, bool generatePreview, RefPtr<Protocol::Array<Protocol::Runtime::InternalPropertyDescriptor>>* result);
62-
void getCollectionEntries(ErrorString&, const String& objectId, const String& objectGroup, int startIndex, int numberToFetch, RefPtr<Protocol::Array<Protocol::Runtime::CollectionEntry>>* entries);
59+
void getProperties(ErrorString&, const String& objectId, bool ownProperties, bool generatePreview, RefPtr<JSON::ArrayOf<Protocol::Runtime::PropertyDescriptor>>* result);
60+
void getDisplayableProperties(ErrorString&, const String& objectId, bool generatePreview, RefPtr<JSON::ArrayOf<Protocol::Runtime::PropertyDescriptor>>* result);
61+
void getInternalProperties(ErrorString&, const String& objectId, bool generatePreview, RefPtr<JSON::ArrayOf<Protocol::Runtime::InternalPropertyDescriptor>>* result);
62+
void getCollectionEntries(ErrorString&, const String& objectId, const String& objectGroup, int startIndex, int numberToFetch, RefPtr<JSON::ArrayOf<Protocol::Runtime::CollectionEntry>>* entries);
6363
void saveResult(ErrorString&, const String& callArgumentJSON, Inspector::Protocol::OptOutput<int>* savedResultIndex);
6464

65-
Ref<Protocol::Array<Protocol::Debugger::CallFrame>> wrapCallFrames(JSC::JSValue) const;
65+
Ref<JSON::ArrayOf<Protocol::Debugger::CallFrame>> wrapCallFrames(JSC::JSValue) const;
6666
RefPtr<Protocol::Runtime::RemoteObject> wrapObject(JSC::JSValue, const String& groupName, bool generatePreview = false) const;
6767
RefPtr<Protocol::Runtime::RemoteObject> wrapTable(JSC::JSValue table, JSC::JSValue columns) const;
6868
RefPtr<Protocol::Runtime::ObjectPreview> previewValue(JSC::JSValue) const;

0 commit comments

Comments
 (0)