| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } | 319 } |
| 320 | 320 |
| 321 std::unique_ptr<protocol::Runtime::ExceptionDetails> InjectedScript::createExcep
tionDetails(v8::Local<v8::Message> message) | 321 std::unique_ptr<protocol::Runtime::ExceptionDetails> InjectedScript::createExcep
tionDetails(v8::Local<v8::Message> message) |
| 322 { | 322 { |
| 323 std::unique_ptr<protocol::Runtime::ExceptionDetails> exceptionDetailsObject
= protocol::Runtime::ExceptionDetails::create().setText(toProtocolString(message
->Get())).build(); | 323 std::unique_ptr<protocol::Runtime::ExceptionDetails> exceptionDetailsObject
= protocol::Runtime::ExceptionDetails::create().setText(toProtocolString(message
->Get())).build(); |
| 324 exceptionDetailsObject->setUrl(toProtocolStringWithTypeCheck(message->GetScr
iptResourceName())); | 324 exceptionDetailsObject->setUrl(toProtocolStringWithTypeCheck(message->GetScr
iptResourceName())); |
| 325 exceptionDetailsObject->setScriptId(String16::number(message->GetScriptOrigi
n().ScriptID()->Value())); | 325 exceptionDetailsObject->setScriptId(String16::number(message->GetScriptOrigi
n().ScriptID()->Value())); |
| 326 | 326 |
| 327 v8::Maybe<int> lineNumber = message->GetLineNumber(m_context->context()); | 327 v8::Maybe<int> lineNumber = message->GetLineNumber(m_context->context()); |
| 328 if (lineNumber.IsJust()) | 328 if (lineNumber.IsJust()) |
| 329 exceptionDetailsObject->setLine(lineNumber.FromJust()); | 329 exceptionDetailsObject->setLineNumber(lineNumber.FromJust() - 1); |
| 330 v8::Maybe<int> columnNumber = message->GetStartColumn(m_context->context()); | 330 v8::Maybe<int> columnNumber = message->GetStartColumn(m_context->context()); |
| 331 if (columnNumber.IsJust()) | 331 if (columnNumber.IsJust()) |
| 332 exceptionDetailsObject->setColumn(columnNumber.FromJust()); | 332 exceptionDetailsObject->setColumnNumber(columnNumber.FromJust()); |
| 333 | 333 |
| 334 v8::Local<v8::StackTrace> stackTrace = message->GetStackTrace(); | 334 v8::Local<v8::StackTrace> stackTrace = message->GetStackTrace(); |
| 335 if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0) | 335 if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0) |
| 336 exceptionDetailsObject->setStack(m_context->debugger()->createStackTrace
(stackTrace)->buildInspectorObject()); | 336 exceptionDetailsObject->setStack(m_context->debugger()->createStackTrace
(stackTrace)->buildInspectorObject()); |
| 337 return exceptionDetailsObject; | 337 return exceptionDetailsObject; |
| 338 } | 338 } |
| 339 | 339 |
| 340 void InjectedScript::wrapEvaluateResult(ErrorString* errorString, v8::MaybeLocal
<v8::Value> maybeResultValue, const v8::TryCatch& tryCatch, const String16& obje
ctGroup, bool returnByValue, bool generatePreview, std::unique_ptr<protocol::Run
time::RemoteObject>* result, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::Ex
ceptionDetails>* exceptionDetails) | 340 void InjectedScript::wrapEvaluateResult(ErrorString* errorString, v8::MaybeLocal
<v8::Value> maybeResultValue, const v8::TryCatch& tryCatch, const String16& obje
ctGroup, bool returnByValue, bool generatePreview, std::unique_ptr<protocol::Run
time::RemoteObject>* result, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::Ex
ceptionDetails>* exceptionDetails) |
| 341 { | 341 { |
| 342 v8::Local<v8::Value> resultValue; | 342 v8::Local<v8::Value> resultValue; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) | 505 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) |
| 506 { | 506 { |
| 507 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); | 507 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); |
| 508 if (!remoteId) | 508 if (!remoteId) |
| 509 return; | 509 return; |
| 510 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); | 510 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); |
| 511 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); | 511 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); |
| 512 } | 512 } |
| 513 | 513 |
| 514 } // namespace blink | 514 } // namespace blink |
| OLD | NEW |