32
32
#include " config.h"
33
33
#include " InjectedScript.h"
34
34
35
+ #include " InspectorValues.h"
35
36
#include " JSCInlines.h"
36
37
#include " ScriptFunctionCall.h"
37
38
#include " ScriptObject.h"
38
- #include < wtf/JSONValues.h>
39
39
#include < wtf/text/WTFString.h>
40
40
41
41
using Inspector::Protocol::Array;
@@ -98,9 +98,9 @@ void InjectedScript::getFunctionDetails(ErrorString& errorString, const String&
98
98
Deprecated::ScriptFunctionCall function (injectedScriptObject (), ASCIILiteral (" getFunctionDetails" ), inspectorEnvironment ()->functionCallHandler ());
99
99
function.appendArgument (functionId);
100
100
101
- RefPtr<JSON::Value > resultValue;
101
+ RefPtr<InspectorValue > resultValue;
102
102
makeCall (function, &resultValue);
103
- if (!resultValue || resultValue->type () != JSON::Value ::Type::Object) {
103
+ if (!resultValue || resultValue->type () != InspectorValue ::Type::Object) {
104
104
if (!resultValue->asString (errorString))
105
105
errorString = ASCIILiteral (" Internal error" );
106
106
return ;
@@ -114,9 +114,9 @@ void InjectedScript::functionDetails(ErrorString& errorString, JSC::JSValue valu
114
114
Deprecated::ScriptFunctionCall function (injectedScriptObject (), ASCIILiteral (" functionDetails" ), inspectorEnvironment ()->functionCallHandler ());
115
115
function.appendArgument (value);
116
116
117
- RefPtr<JSON::Value > resultValue;
117
+ RefPtr<InspectorValue > resultValue;
118
118
makeCall (function, &resultValue);
119
- if (!resultValue || resultValue->type () != JSON::Value ::Type::Object) {
119
+ if (!resultValue || resultValue->type () != InspectorValue ::Type::Object) {
120
120
if (!resultValue->asString (errorString))
121
121
errorString = ASCIILiteral (" Internal error" );
122
122
return ;
@@ -130,9 +130,9 @@ void InjectedScript::getPreview(ErrorString& errorString, const String& objectId
130
130
Deprecated::ScriptFunctionCall function (injectedScriptObject (), ASCIILiteral (" getPreview" ), inspectorEnvironment ()->functionCallHandler ());
131
131
function.appendArgument (objectId);
132
132
133
- RefPtr<JSON::Value > resultValue;
133
+ RefPtr<InspectorValue > resultValue;
134
134
makeCall (function, &resultValue);
135
- if (!resultValue || resultValue->type () != JSON::Value ::Type::Object) {
135
+ if (!resultValue || resultValue->type () != InspectorValue ::Type::Object) {
136
136
if (!resultValue->asString (errorString))
137
137
errorString = ASCIILiteral (" Internal error" );
138
138
return ;
@@ -148,9 +148,9 @@ void InjectedScript::getProperties(ErrorString& errorString, const String& objec
148
148
function.appendArgument (ownProperties);
149
149
function.appendArgument (generatePreview);
150
150
151
- RefPtr<JSON::Value > result;
151
+ RefPtr<InspectorValue > result;
152
152
makeCall (function, &result);
153
- if (!result || result->type () != JSON::Value ::Type::Array) {
153
+ if (!result || result->type () != InspectorValue ::Type::Array) {
154
154
errorString = ASCIILiteral (" Internal error" );
155
155
return ;
156
156
}
@@ -164,9 +164,9 @@ void InjectedScript::getDisplayableProperties(ErrorString& errorString, const St
164
164
function.appendArgument (objectId);
165
165
function.appendArgument (generatePreview);
166
166
167
- RefPtr<JSON::Value > result;
167
+ RefPtr<InspectorValue > result;
168
168
makeCall (function, &result);
169
- if (!result || result->type () != JSON::Value ::Type::Array) {
169
+ if (!result || result->type () != InspectorValue ::Type::Array) {
170
170
errorString = ASCIILiteral (" Internal error" );
171
171
return ;
172
172
}
@@ -180,9 +180,9 @@ void InjectedScript::getInternalProperties(ErrorString& errorString, const Strin
180
180
function.appendArgument (objectId);
181
181
function.appendArgument (generatePreview);
182
182
183
- RefPtr<JSON::Value > result;
183
+ RefPtr<InspectorValue > result;
184
184
makeCall (function, &result);
185
- if (!result || result->type () != JSON::Value ::Type::Array) {
185
+ if (!result || result->type () != InspectorValue ::Type::Array) {
186
186
errorString = ASCIILiteral (" Internal error" );
187
187
return ;
188
188
}
@@ -199,9 +199,9 @@ void InjectedScript::getCollectionEntries(ErrorString& errorString, const String
199
199
function.appendArgument (startIndex);
200
200
function.appendArgument (numberToFetch);
201
201
202
- RefPtr<JSON::Value > result;
202
+ RefPtr<InspectorValue > result;
203
203
makeCall (function, &result);
204
- if (!result || result->type () != JSON::Value ::Type::Array) {
204
+ if (!result || result->type () != InspectorValue ::Type::Array) {
205
205
errorString = ASCIILiteral (" Internal error" );
206
206
return ;
207
207
}
@@ -214,9 +214,9 @@ void InjectedScript::saveResult(ErrorString& errorString, const String& callArgu
214
214
Deprecated::ScriptFunctionCall function (injectedScriptObject (), ASCIILiteral (" saveResult" ), inspectorEnvironment ()->functionCallHandler ());
215
215
function.appendArgument (callArgumentJSON);
216
216
217
- RefPtr<JSON::Value > result;
217
+ RefPtr<InspectorValue > result;
218
218
makeCall (function, &result);
219
- if (!result || result->type () != JSON::Value ::Type::Integer) {
219
+ if (!result || result->type () != InspectorValue ::Type::Integer) {
220
220
errorString = ASCIILiteral (" Internal error" );
221
221
return ;
222
222
}
@@ -237,8 +237,8 @@ Ref<Array<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFra
237
237
if (!callFramesValue)
238
238
return Array<Inspector::Protocol::Debugger ::CallFrame>::create ();
239
239
ASSERT (!hadException);
240
- RefPtr<JSON::Value > result = toInspectorValue (*scriptState (), callFramesValue);
241
- if (result->type () == JSON::Value ::Type::Array)
240
+ RefPtr<InspectorValue > result = toInspectorValue (*scriptState (), callFramesValue);
241
+ if (result->type () == InspectorValue ::Type::Array)
242
242
return BindingTraits<Array<Inspector::Protocol::Debugger ::CallFrame>>::runtimeCast (WTFMove (result)).releaseNonNull ();
243
243
244
244
return Array<Inspector::Protocol::Debugger ::CallFrame>::create ();
@@ -258,7 +258,7 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(JS
258
258
if (hadException)
259
259
return nullptr ;
260
260
261
- RefPtr<JSON::Object > resultObject;
261
+ RefPtr<InspectorObject > resultObject;
262
262
bool castSucceeded = toInspectorValue (*scriptState (), r)->asObject (resultObject);
263
263
ASSERT_UNUSED (castSucceeded, castSucceeded);
264
264
@@ -281,7 +281,7 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapTable(JSC
281
281
if (hadException)
282
282
return nullptr ;
283
283
284
- RefPtr<JSON::Object > resultObject;
284
+ RefPtr<InspectorObject > resultObject;
285
285
bool castSucceeded = toInspectorValue (*scriptState (), r)->asObject (resultObject);
286
286
ASSERT_UNUSED (castSucceeded, castSucceeded);
287
287
@@ -299,7 +299,7 @@ RefPtr<Inspector::Protocol::Runtime::ObjectPreview> InjectedScript::previewValue
299
299
if (hadException)
300
300
return nullptr ;
301
301
302
- RefPtr<JSON::Object > resultObject;
302
+ RefPtr<InspectorObject > resultObject;
303
303
bool castSucceeded = toInspectorValue (*scriptState (), r)->asObject (resultObject);
304
304
ASSERT_UNUSED (castSucceeded, castSucceeded);
305
305
@@ -311,15 +311,15 @@ void InjectedScript::setExceptionValue(JSC::JSValue value)
311
311
ASSERT (!hasNoValue ());
312
312
Deprecated::ScriptFunctionCall function (injectedScriptObject (), ASCIILiteral (" setExceptionValue" ), inspectorEnvironment ()->functionCallHandler ());
313
313
function.appendArgument (value);
314
- RefPtr<JSON::Value > result;
314
+ RefPtr<InspectorValue > result;
315
315
makeCall (function, &result);
316
316
}
317
317
318
318
void InjectedScript::clearExceptionValue ()
319
319
{
320
320
ASSERT (!hasNoValue ());
321
321
Deprecated::ScriptFunctionCall function (injectedScriptObject (), ASCIILiteral (" clearExceptionValue" ), inspectorEnvironment ()->functionCallHandler ());
322
- RefPtr<JSON::Value > result;
322
+ RefPtr<InspectorValue > result;
323
323
makeCall (function, &result);
324
324
}
325
325
@@ -341,15 +341,15 @@ void InjectedScript::inspectObject(JSC::JSValue value)
341
341
ASSERT (!hasNoValue ());
342
342
Deprecated::ScriptFunctionCall function (injectedScriptObject (), ASCIILiteral (" inspectObject" ), inspectorEnvironment ()->functionCallHandler ());
343
343
function.appendArgument (value);
344
- RefPtr<JSON::Value > result;
344
+ RefPtr<InspectorValue > result;
345
345
makeCall (function, &result);
346
346
}
347
347
348
348
void InjectedScript::releaseObject (const String& objectId)
349
349
{
350
350
Deprecated::ScriptFunctionCall function (injectedScriptObject (), ASCIILiteral (" releaseObject" ), inspectorEnvironment ()->functionCallHandler ());
351
351
function.appendArgument (objectId);
352
- RefPtr<JSON::Value > result;
352
+ RefPtr<InspectorValue > result;
353
353
makeCall (function, &result);
354
354
}
355
355
0 commit comments