| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/v8_inspector/V8ConsoleMessage.h" | 5 #include "platform/v8_inspector/V8ConsoleMessage.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/InspectedContext.h" | 7 #include "platform/v8_inspector/InspectedContext.h" |
| 8 #include "platform/v8_inspector/V8ConsoleAgentImpl.h" | 8 #include "platform/v8_inspector/V8ConsoleAgentImpl.h" |
| 9 #include "platform/v8_inspector/V8DebuggerImpl.h" | 9 #include "platform/v8_inspector/V8DebuggerImpl.h" |
| 10 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 10 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 protocol::Console::ConsoleMessage::create() | 236 protocol::Console::ConsoleMessage::create() |
| 237 .setSource(messageSourceValue(m_source)) | 237 .setSource(messageSourceValue(m_source)) |
| 238 .setLevel(messageLevelValue(m_level)) | 238 .setLevel(messageLevelValue(m_level)) |
| 239 .setText(m_message) | 239 .setText(m_message) |
| 240 .setTimestamp(m_timestamp / 1000) // TODO(dgozman): migrate this to mill
iseconds. | 240 .setTimestamp(m_timestamp / 1000) // TODO(dgozman): migrate this to mill
iseconds. |
| 241 .build(); | 241 .build(); |
| 242 result->setType(consoleAPITypeValue(m_type)); | 242 result->setType(consoleAPITypeValue(m_type)); |
| 243 result->setLine(static_cast<int>(m_lineNumber)); | 243 result->setLine(static_cast<int>(m_lineNumber)); |
| 244 result->setColumn(static_cast<int>(m_columnNumber)); | 244 result->setColumn(static_cast<int>(m_columnNumber)); |
| 245 if (m_scriptId) | 245 if (m_scriptId) |
| 246 result->setScriptId(String16::number(m_scriptId)); | 246 result->setScriptId(String16::fromInteger(m_scriptId)); |
| 247 result->setUrl(m_url); | 247 result->setUrl(m_url); |
| 248 if (m_source == NetworkMessageSource && !m_requestIdentifier.isEmpty()) | 248 if (m_source == NetworkMessageSource && !m_requestIdentifier.isEmpty()) |
| 249 result->setNetworkRequestId(m_requestIdentifier); | 249 result->setNetworkRequestId(m_requestIdentifier); |
| 250 if (m_contextId) | 250 if (m_contextId) |
| 251 result->setExecutionContextId(m_contextId); | 251 result->setExecutionContextId(m_contextId); |
| 252 std::unique_ptr<protocol::Array<protocol::Runtime::RemoteObject>> args = wra
pArguments(session, generatePreview); | 252 std::unique_ptr<protocol::Array<protocol::Runtime::RemoteObject>> args = wra
pArguments(session, generatePreview); |
| 253 if (args) | 253 if (args) |
| 254 result->setParameters(std::move(args)); | 254 result->setParameters(std::move(args)); |
| 255 if (m_stackTrace) | 255 if (m_stackTrace) |
| 256 result->setStack(m_stackTrace->buildInspectorObject()); | 256 result->setStack(m_stackTrace->buildInspectorObject()); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 { | 297 { |
| 298 if (m_origin == V8MessageOrigin::kException) { | 298 if (m_origin == V8MessageOrigin::kException) { |
| 299 // TODO(dgozman): unify with InjectedScript::createExceptionDetails. | 299 // TODO(dgozman): unify with InjectedScript::createExceptionDetails. |
| 300 std::unique_ptr<protocol::Runtime::ExceptionDetails> details = protocol:
:Runtime::ExceptionDetails::create().setText(m_message).build(); | 300 std::unique_ptr<protocol::Runtime::ExceptionDetails> details = protocol:
:Runtime::ExceptionDetails::create().setText(m_message).build(); |
| 301 details->setUrl(m_url); | 301 details->setUrl(m_url); |
| 302 if (m_lineNumber) | 302 if (m_lineNumber) |
| 303 details->setLineNumber(static_cast<int>(m_lineNumber) - 1); | 303 details->setLineNumber(static_cast<int>(m_lineNumber) - 1); |
| 304 if (m_columnNumber) | 304 if (m_columnNumber) |
| 305 details->setColumnNumber(static_cast<int>(m_columnNumber) - 1); | 305 details->setColumnNumber(static_cast<int>(m_columnNumber) - 1); |
| 306 if (m_scriptId) | 306 if (m_scriptId) |
| 307 details->setScriptId(String16::number(m_scriptId)); | 307 details->setScriptId(String16::fromInteger(m_scriptId)); |
| 308 if (m_stackTrace) | 308 if (m_stackTrace) |
| 309 details->setStack(m_stackTrace->buildInspectorObject()); | 309 details->setStack(m_stackTrace->buildInspectorObject()); |
| 310 | 310 |
| 311 std::unique_ptr<protocol::Runtime::RemoteObject> exception = wrapExcepti
on(session, generatePreview); | 311 std::unique_ptr<protocol::Runtime::RemoteObject> exception = wrapExcepti
on(session, generatePreview); |
| 312 | 312 |
| 313 if (exception) | 313 if (exception) |
| 314 frontend->exceptionThrown(m_exceptionId, m_timestamp, std::move(deta
ils), std::move(exception), m_contextId); | 314 frontend->exceptionThrown(m_exceptionId, m_timestamp, std::move(deta
ils), std::move(exception), m_contextId); |
| 315 else | 315 else |
| 316 frontend->exceptionThrown(m_exceptionId, m_timestamp, std::move(deta
ils)); | 316 frontend->exceptionThrown(m_exceptionId, m_timestamp, std::move(deta
ils)); |
| 317 return; | 317 return; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 | 477 |
| 478 void V8ConsoleMessageStorage::contextDestroyed(int contextId) | 478 void V8ConsoleMessageStorage::contextDestroyed(int contextId) |
| 479 { | 479 { |
| 480 for (size_t i = 0; i < m_messages.size(); ++i) | 480 for (size_t i = 0; i < m_messages.size(); ++i) |
| 481 m_messages[i]->contextDestroyed(contextId); | 481 m_messages[i]->contextDestroyed(contextId); |
| 482 } | 482 } |
| 483 | 483 |
| 484 } // namespace blink | 484 } // namespace blink |
| OLD | NEW |