| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-2011 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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 void V8DebuggerImpl::idleStarted() | 1056 void V8DebuggerImpl::idleStarted() |
| 1057 { | 1057 { |
| 1058 m_isolate->GetCpuProfiler()->SetIdle(true); | 1058 m_isolate->GetCpuProfiler()->SetIdle(true); |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 void V8DebuggerImpl::idleFinished() | 1061 void V8DebuggerImpl::idleFinished() |
| 1062 { | 1062 { |
| 1063 m_isolate->GetCpuProfiler()->SetIdle(false); | 1063 m_isolate->GetCpuProfiler()->SetIdle(false); |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 void V8DebuggerImpl::logToConsole(v8::Local<v8::Context> context, v8::Local<v8::
Value> arg1, v8::Local<v8::Value> arg2) | |
| 1067 { | |
| 1068 int contextGroupId = getGroupId(context); | |
| 1069 InspectedContext* inspectedContext = getContext(contextGroupId, contextId(co
ntext)); | |
| 1070 if (!inspectedContext) | |
| 1071 return; | |
| 1072 std::vector<v8::Local<v8::Value>> arguments; | |
| 1073 if (!arg1.IsEmpty()) | |
| 1074 arguments.push_back(arg1); | |
| 1075 if (!arg2.IsEmpty()) | |
| 1076 arguments.push_back(arg2); | |
| 1077 ensureConsoleMessageStorage(contextGroupId)->addMessage(V8ConsoleMessage::cr
eateForConsoleAPI(m_client->currentTimeMS(), ConsoleAPIType::kLog, arguments, ca
ptureStackTraceImpl(false), inspectedContext)); | |
| 1078 } | |
| 1079 | |
| 1080 void V8DebuggerImpl::exceptionThrown(int contextGroupId, const String16& errorMe
ssage, const String16& url, unsigned lineNumber, unsigned columnNumber, std::uni
que_ptr<V8StackTrace> stackTrace, int scriptId) | 1066 void V8DebuggerImpl::exceptionThrown(int contextGroupId, const String16& errorMe
ssage, const String16& url, unsigned lineNumber, unsigned columnNumber, std::uni
que_ptr<V8StackTrace> stackTrace, int scriptId) |
| 1081 { | 1067 { |
| 1082 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8
StackTraceImpl*>(stackTrace.release())); | 1068 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8
StackTraceImpl*>(stackTrace.release())); |
| 1083 unsigned exceptionId = ++m_lastExceptionId; | 1069 unsigned exceptionId = ++m_lastExceptionId; |
| 1084 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF
orException(m_client->currentTimeMS(), errorMessage, url, lineNumber, columnNumb
er, std::move(stackTraceImpl), scriptId, m_isolate, 0, v8::Local<v8::Value>(), e
xceptionId); | 1070 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF
orException(m_client->currentTimeMS(), errorMessage, url, lineNumber, columnNumb
er, std::move(stackTraceImpl), scriptId, m_isolate, 0, v8::Local<v8::Value>(), e
xceptionId); |
| 1085 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes
sage)); | 1071 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes
sage)); |
| 1086 } | 1072 } |
| 1087 | 1073 |
| 1088 unsigned V8DebuggerImpl::promiseRejected(v8::Local<v8::Context> context, const S
tring16& errorMessage, v8::Local<v8::Value> exception, const String16& url, unsi
gned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace> stackTrace
, int scriptId) | 1074 unsigned V8DebuggerImpl::promiseRejected(v8::Local<v8::Context> context, const S
tring16& errorMessage, v8::Local<v8::Value> exception, const String16& url, unsi
gned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace> stackTrace
, int scriptId) |
| 1089 { | 1075 { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 | 1140 |
| 1155 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI
d) | 1141 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI
d) |
| 1156 { | 1142 { |
| 1157 if (!contextGroupId) | 1143 if (!contextGroupId) |
| 1158 return nullptr; | 1144 return nullptr; |
| 1159 SessionMap::iterator iter = m_sessions.find(contextGroupId); | 1145 SessionMap::iterator iter = m_sessions.find(contextGroupId); |
| 1160 return iter == m_sessions.end() ? nullptr : iter->second; | 1146 return iter == m_sessions.end() ? nullptr : iter->second; |
| 1161 } | 1147 } |
| 1162 | 1148 |
| 1163 } // namespace blink | 1149 } // namespace blink |
| OLD | NEW |