| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #if ENABLE(INSPECTOR) | |
| 34 | 33 |
| 35 #include "InjectedScript.h" | 34 #include "InjectedScript.h" |
| 36 | 35 |
| 37 #include "InjectedScriptHost.h" | 36 #include "InjectedScriptHost.h" |
| 38 #include "InjectedScriptModule.h" | 37 #include "InjectedScriptModule.h" |
| 39 #include "InspectorValues.h" | 38 #include "InspectorValues.h" |
| 40 #include "Node.h" | 39 #include "Node.h" |
| 41 #include "ScriptFunctionCall.h" | 40 #include "ScriptFunctionCall.h" |
| 42 #include "SerializedScriptValue.h" | 41 #include "SerializedScriptValue.h" |
| 43 #include <wtf/text/WTFString.h> | 42 #include <wtf/text/WTFString.h> |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 206 } |
| 208 | 207 |
| 209 void InjectedScript::releaseObject(const String& objectId) | 208 void InjectedScript::releaseObject(const String& objectId) |
| 210 { | 209 { |
| 211 ScriptFunctionCall function(injectedScriptObject(), "releaseObject"); | 210 ScriptFunctionCall function(injectedScriptObject(), "releaseObject"); |
| 212 function.appendArgument(objectId); | 211 function.appendArgument(objectId); |
| 213 RefPtr<InspectorValue> result; | 212 RefPtr<InspectorValue> result; |
| 214 makeCall(function, &result); | 213 makeCall(function, &result); |
| 215 } | 214 } |
| 216 | 215 |
| 217 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
| 218 PassRefPtr<Array<CallFrame> > InjectedScript::wrapCallFrames(const ScriptValue&
callFrames) | 216 PassRefPtr<Array<CallFrame> > InjectedScript::wrapCallFrames(const ScriptValue&
callFrames) |
| 219 { | 217 { |
| 220 ASSERT(!hasNoValue()); | 218 ASSERT(!hasNoValue()); |
| 221 ScriptFunctionCall function(injectedScriptObject(), "wrapCallFrames"); | 219 ScriptFunctionCall function(injectedScriptObject(), "wrapCallFrames"); |
| 222 function.appendArgument(callFrames); | 220 function.appendArgument(callFrames); |
| 223 bool hadException = false; | 221 bool hadException = false; |
| 224 ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadExcep
tion); | 222 ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadExcep
tion); |
| 225 ASSERT(!hadException); | 223 ASSERT(!hadException); |
| 226 RefPtr<InspectorValue> result = callFramesValue.toInspectorValue(scriptState
()); | 224 RefPtr<InspectorValue> result = callFramesValue.toInspectorValue(scriptState
()); |
| 227 if (result->type() == InspectorValue::TypeArray) | 225 if (result->type() == InspectorValue::TypeArray) |
| 228 return Array<CallFrame>::runtimeCast(result); | 226 return Array<CallFrame>::runtimeCast(result); |
| 229 return Array<CallFrame>::create(); | 227 return Array<CallFrame>::create(); |
| 230 } | 228 } |
| 231 #endif | |
| 232 | 229 |
| 233 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapObject(const
ScriptValue& value, const String& groupName, bool generatePreview) const | 230 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapObject(const
ScriptValue& value, const String& groupName, bool generatePreview) const |
| 234 { | 231 { |
| 235 ASSERT(!hasNoValue()); | 232 ASSERT(!hasNoValue()); |
| 236 ScriptFunctionCall wrapFunction(injectedScriptObject(), "wrapObject"); | 233 ScriptFunctionCall wrapFunction(injectedScriptObject(), "wrapObject"); |
| 237 wrapFunction.appendArgument(value); | 234 wrapFunction.appendArgument(value); |
| 238 wrapFunction.appendArgument(groupName); | 235 wrapFunction.appendArgument(groupName); |
| 239 wrapFunction.appendArgument(canAccessInspectedWindow()); | 236 wrapFunction.appendArgument(canAccessInspectedWindow()); |
| 240 wrapFunction.appendArgument(generatePreview); | 237 wrapFunction.appendArgument(generatePreview); |
| 241 bool hadException = false; | 238 bool hadException = false; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 ASSERT(!hadException); | 297 ASSERT(!hadException); |
| 301 } | 298 } |
| 302 | 299 |
| 303 ScriptValue InjectedScript::nodeAsScriptValue(Node* node) | 300 ScriptValue InjectedScript::nodeAsScriptValue(Node* node) |
| 304 { | 301 { |
| 305 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node); | 302 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node); |
| 306 } | 303 } |
| 307 | 304 |
| 308 } // namespace WebCore | 305 } // namespace WebCore |
| 309 | 306 |
| 310 #endif // ENABLE(INSPECTOR) | |
| OLD | NEW |