| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 resultValue->asString(errorString); | 181 resultValue->asString(errorString); |
| 182 } else { | 182 } else { |
| 183 bool value; | 183 bool value; |
| 184 ASSERT_UNUSED(value, resultValue->asBoolean(&value) && value); | 184 ASSERT_UNUSED(value, resultValue->asBoolean(&value) && value); |
| 185 } | 185 } |
| 186 return; | 186 return; |
| 187 } | 187 } |
| 188 *errorString = "Internal error"; | 188 *errorString = "Internal error"; |
| 189 } | 189 } |
| 190 | 190 |
| 191 void InjectedScript::getStepInPositions(ErrorString* errorString, v8::Local<v8::
Object> callFrames, const String16& callFrameId, Maybe<Array<protocol::Debugger:
:Location>>* positions) | |
| 192 { | |
| 193 v8::HandleScope handles(m_isolate); | |
| 194 V8FunctionCall function(m_client, context(), v8Value(), "getStepInPositions"
); | |
| 195 function.appendArgument(callFrames); | |
| 196 function.appendArgument(callFrameId); | |
| 197 OwnPtr<protocol::Value> resultValue = makeCall(function); | |
| 198 if (resultValue) { | |
| 199 if (resultValue->type() == protocol::Value::TypeString) { | |
| 200 resultValue->asString(errorString); | |
| 201 return; | |
| 202 } | |
| 203 if (resultValue->type() == protocol::Value::TypeArray) { | |
| 204 protocol::ErrorSupport errors(errorString); | |
| 205 *positions = Array<protocol::Debugger::Location>::parse(resultValue.
get(), &errors); | |
| 206 return; | |
| 207 } | |
| 208 } | |
| 209 *errorString = "Internal error"; | |
| 210 } | |
| 211 | |
| 212 void InjectedScript::setVariableValue(ErrorString* errorString, | 191 void InjectedScript::setVariableValue(ErrorString* errorString, |
| 213 v8::Local<v8::Object> callFrames, | 192 v8::Local<v8::Object> callFrames, |
| 214 const protocol::Maybe<String16>& callFrameIdOpt, | 193 const protocol::Maybe<String16>& callFrameIdOpt, |
| 215 const protocol::Maybe<String16>& functionObjectIdOpt, | 194 const protocol::Maybe<String16>& functionObjectIdOpt, |
| 216 int scopeNumber, | 195 int scopeNumber, |
| 217 const String16& variableName, | 196 const String16& variableName, |
| 218 const String16& newValueStr) | 197 const String16& newValueStr) |
| 219 { | 198 { |
| 220 v8::HandleScope handles(m_isolate); | 199 v8::HandleScope handles(m_isolate); |
| 221 V8FunctionCall function(m_client, context(), v8Value(), "setVariableValue"); | 200 V8FunctionCall function(m_client, context(), v8Value(), "setVariableValue"); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 } | 505 } |
| 527 return result.release(); | 506 return result.release(); |
| 528 } | 507 } |
| 529 | 508 |
| 530 void InjectedScript::dispose() | 509 void InjectedScript::dispose() |
| 531 { | 510 { |
| 532 m_manager->discardInjectedScript(m_contextId); | 511 m_manager->discardInjectedScript(m_contextId); |
| 533 } | 512 } |
| 534 | 513 |
| 535 } // namespace blink | 514 } // namespace blink |
| OLD | NEW |