OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 ASSERT(!isEmpty()); | 291 ASSERT(!isEmpty()); |
292 ScriptFunctionCall function(injectedScriptObject(), "findObjectById"); | 292 ScriptFunctionCall function(injectedScriptObject(), "findObjectById"); |
293 function.appendArgument(objectId); | 293 function.appendArgument(objectId); |
294 | 294 |
295 bool hadException = false; | 295 bool hadException = false; |
296 ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException
); | 296 ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException
); |
297 ASSERT(!hadException); | 297 ASSERT(!hadException); |
298 return resultValue; | 298 return resultValue; |
299 } | 299 } |
300 | 300 |
301 ScriptValue InjectedScript::findCallFrameById(ErrorString* errorString, const Sc
riptValue& topCallFrame, const String& callFrameId) | |
302 { | |
303 ScriptFunctionCall function(injectedScriptObject(), "callFrameForId"); | |
304 function.appendArgument(topCallFrame); | |
305 function.appendArgument(callFrameId); | |
306 bool hadException = false; | |
307 ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException
); | |
308 ASSERT(!hadException); | |
309 if (hadException || resultValue.isEmpty() || !resultValue.isObject()) { | |
310 *errorString = "Internal error"; | |
311 return ScriptValue(); | |
312 } | |
313 return resultValue; | |
314 } | |
315 | |
316 void InjectedScript::inspectNode(Node* node) | 301 void InjectedScript::inspectNode(Node* node) |
317 { | 302 { |
318 ASSERT(!isEmpty()); | 303 ASSERT(!isEmpty()); |
319 ScriptFunctionCall function(injectedScriptObject(), "inspectNode"); | 304 ScriptFunctionCall function(injectedScriptObject(), "inspectNode"); |
320 function.appendArgument(nodeAsScriptValue(node)); | 305 function.appendArgument(nodeAsScriptValue(node)); |
321 RefPtr<JSONValue> result; | 306 RefPtr<JSONValue> result; |
322 makeCall(function, &result); | 307 makeCall(function, &result); |
323 } | 308 } |
324 | 309 |
325 void InjectedScript::releaseObjectGroup(const String& objectGroup) | 310 void InjectedScript::releaseObjectGroup(const String& objectGroup) |
326 { | 311 { |
327 ASSERT(!isEmpty()); | 312 ASSERT(!isEmpty()); |
328 ScriptFunctionCall releaseFunction(injectedScriptObject(), "releaseObjectGro
up"); | 313 ScriptFunctionCall releaseFunction(injectedScriptObject(), "releaseObjectGro
up"); |
329 releaseFunction.appendArgument(objectGroup); | 314 releaseFunction.appendArgument(objectGroup); |
330 bool hadException = false; | 315 bool hadException = false; |
331 callFunctionWithEvalEnabled(releaseFunction, hadException); | 316 callFunctionWithEvalEnabled(releaseFunction, hadException); |
332 ASSERT(!hadException); | 317 ASSERT(!hadException); |
333 } | 318 } |
334 | 319 |
335 ScriptValue InjectedScript::nodeAsScriptValue(Node* node) | 320 ScriptValue InjectedScript::nodeAsScriptValue(Node* node) |
336 { | 321 { |
337 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node); | 322 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node); |
338 } | 323 } |
339 | 324 |
340 } // namespace WebCore | 325 } // namespace WebCore |
341 | 326 |
OLD | NEW |