OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 26 matching lines...) Expand all Loading... |
37 #include "PlatformString.h" | 37 #include "PlatformString.h" |
38 #include "ScriptFunctionCall.h" | 38 #include "ScriptFunctionCall.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 InjectedScript::InjectedScript(ScriptObject injectedScriptObject) | 42 InjectedScript::InjectedScript(ScriptObject injectedScriptObject) |
43 : m_injectedScriptObject(injectedScriptObject) | 43 : m_injectedScriptObject(injectedScriptObject) |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 void InjectedScript::evaluate(const String& expression, const String& objectGrou
p, RefPtr<InspectorValue>* result) | 47 void InjectedScript::evaluate(const String& expression, const String& objectGrou
p, bool includeCommandLineAPI, RefPtr<InspectorValue>* result) |
48 { | 48 { |
49 ScriptFunctionCall function(m_injectedScriptObject, "evaluate"); | 49 ScriptFunctionCall function(m_injectedScriptObject, "evaluate"); |
50 function.appendArgument(expression); | 50 function.appendArgument(expression); |
51 function.appendArgument(objectGroup); | 51 function.appendArgument(objectGroup); |
| 52 function.appendArgument(includeCommandLineAPI); |
52 makeCall(function, result); | 53 makeCall(function, result); |
53 } | 54 } |
54 | 55 |
55 void InjectedScript::evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId
, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* r
esult) | 56 void InjectedScript::evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId
, const String& expression, const String& objectGroup, bool includeCommandLineAP
I, RefPtr<InspectorValue>* result) |
56 { | 57 { |
57 ScriptFunctionCall function(m_injectedScriptObject, "evaluateOnCallFrame"); | 58 ScriptFunctionCall function(m_injectedScriptObject, "evaluateOnCallFrame"); |
58 function.appendArgument(callFrameId->toJSONString()); | 59 function.appendArgument(callFrameId->toJSONString()); |
59 function.appendArgument(expression); | 60 function.appendArgument(expression); |
60 function.appendArgument(objectGroup); | 61 function.appendArgument(objectGroup); |
| 62 function.appendArgument(includeCommandLineAPI); |
61 makeCall(function, result); | 63 makeCall(function, result); |
62 } | 64 } |
63 | 65 |
64 void InjectedScript::evaluateOnSelf(const String& functionBody, PassRefPtr<Inspe
ctorArray> argumentsArray, RefPtr<InspectorValue>* result) | 66 void InjectedScript::evaluateOnSelf(const String& functionBody, PassRefPtr<Inspe
ctorArray> argumentsArray, RefPtr<InspectorValue>* result) |
65 { | 67 { |
66 ScriptFunctionCall function(m_injectedScriptObject, "evaluateOnSelf"); | 68 ScriptFunctionCall function(m_injectedScriptObject, "evaluateOnSelf"); |
67 function.appendArgument(functionBody); | 69 function.appendArgument(functionBody); |
68 function.appendArgument(argumentsArray->toJSONString()); | 70 function.appendArgument(argumentsArray->toJSONString()); |
69 makeCall(function, result); | 71 makeCall(function, result); |
70 } | 72 } |
71 | 73 |
72 void InjectedScript::getCompletions(const String& expression, bool includeInspec
torCommandLineAPI, RefPtr<InspectorValue>* result) | 74 void InjectedScript::getCompletions(const String& expression, bool includeComman
dLineAPI, RefPtr<InspectorValue>* result) |
73 { | 75 { |
74 ScriptFunctionCall function(m_injectedScriptObject, "getCompletions"); | 76 ScriptFunctionCall function(m_injectedScriptObject, "getCompletions"); |
75 function.appendArgument(expression); | 77 function.appendArgument(expression); |
76 function.appendArgument(includeInspectorCommandLineAPI); | 78 function.appendArgument(includeCommandLineAPI); |
77 makeCall(function, result); | 79 makeCall(function, result); |
78 } | 80 } |
79 | 81 |
80 void InjectedScript::getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callF
rameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<In
spectorValue>* result) | 82 void InjectedScript::getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callF
rameId, const String& expression, bool includeCommandLineAPI, RefPtr<InspectorVa
lue>* result) |
81 { | 83 { |
82 ScriptFunctionCall function(m_injectedScriptObject, "getCompletionsOnCallFra
me"); | 84 ScriptFunctionCall function(m_injectedScriptObject, "getCompletionsOnCallFra
me"); |
83 function.appendArgument(callFrameId->toJSONString()); | 85 function.appendArgument(callFrameId->toJSONString()); |
84 function.appendArgument(expression); | 86 function.appendArgument(expression); |
85 function.appendArgument(includeInspectorCommandLineAPI); | 87 function.appendArgument(includeCommandLineAPI); |
86 makeCall(function, result); | 88 makeCall(function, result); |
87 } | 89 } |
88 | 90 |
89 void InjectedScript::getProperties(PassRefPtr<InspectorObject> objectId, bool ig
noreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result) | 91 void InjectedScript::getProperties(PassRefPtr<InspectorObject> objectId, bool ig
noreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result) |
90 { | 92 { |
91 ScriptFunctionCall function(m_injectedScriptObject, "getProperties"); | 93 ScriptFunctionCall function(m_injectedScriptObject, "getProperties"); |
92 String objectIdString = objectId->toJSONString(); | 94 String objectIdString = objectId->toJSONString(); |
93 function.appendArgument(objectIdString); | 95 function.appendArgument(objectIdString); |
94 function.appendArgument(ignoreHasOwnProperty); | 96 function.appendArgument(ignoreHasOwnProperty); |
95 function.appendArgument(abbreviate); | 97 function.appendArgument(abbreviate); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 ASSERT(!hadException); | 185 ASSERT(!hadException); |
184 if (!hadException) | 186 if (!hadException) |
185 *result = resultValue.toInspectorValue(m_injectedScriptObject.scriptStat
e()); | 187 *result = resultValue.toInspectorValue(m_injectedScriptObject.scriptStat
e()); |
186 else | 188 else |
187 *result = InspectorValue::null(); | 189 *result = InspectorValue::null(); |
188 } | 190 } |
189 | 191 |
190 } // namespace WebCore | 192 } // namespace WebCore |
191 | 193 |
192 #endif // ENABLE(INSPECTOR) | 194 #endif // ENABLE(INSPECTOR) |
OLD | NEW |