Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp

Issue 2170263002: [DevTools] Pass error object when reporting exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 void V8DebuggerImpl::idleStarted() 1054 void V8DebuggerImpl::idleStarted()
1055 { 1055 {
1056 m_isolate->GetCpuProfiler()->SetIdle(true); 1056 m_isolate->GetCpuProfiler()->SetIdle(true);
1057 } 1057 }
1058 1058
1059 void V8DebuggerImpl::idleFinished() 1059 void V8DebuggerImpl::idleFinished()
1060 { 1060 {
1061 m_isolate->GetCpuProfiler()->SetIdle(false); 1061 m_isolate->GetCpuProfiler()->SetIdle(false);
1062 } 1062 }
1063 1063
1064 void V8DebuggerImpl::exceptionThrown(int contextGroupId, const String16& errorMe ssage, const String16& url, unsigned lineNumber, unsigned columnNumber, std::uni que_ptr<V8StackTrace> stackTrace, int scriptId) 1064 unsigned V8DebuggerImpl::exceptionThrown(v8::Local<v8::Context> context, const S tring16& message, v8::Local<v8::Value> exception, const String16& detailedMessag e, const String16& url, unsigned lineNumber, unsigned columnNumber, std::unique_ ptr<V8StackTrace> stackTrace, int scriptId)
1065 {
1066 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8 StackTraceImpl*>(stackTrace.release()));
1067 unsigned exceptionId = ++m_lastExceptionId;
1068 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);
1069 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage));
1070 }
1071
1072 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)
1073 { 1065 {
1074 int contextGroupId = getGroupId(context); 1066 int contextGroupId = getGroupId(context);
1075 if (!contextGroupId) 1067 if (!contextGroupId)
1076 return 0; 1068 return 0;
1077 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8 StackTraceImpl*>(stackTrace.release())); 1069 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8 StackTraceImpl*>(stackTrace.release()));
1078 unsigned exceptionId = ++m_lastExceptionId; 1070 unsigned exceptionId = ++m_lastExceptionId;
1079 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF orException(m_client->currentTimeMS(), errorMessage, url, lineNumber, columnNumb er, std::move(stackTraceImpl), scriptId, m_isolate, contextId(context), exceptio n, exceptionId); 1071 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF orException(m_client->currentTimeMS(), detailedMessage, url, lineNumber, columnN umber, std::move(stackTraceImpl), scriptId, m_isolate, message, contextId(contex t), exception, exceptionId);
1080 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage)); 1072 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage));
1081 return exceptionId; 1073 return exceptionId;
1082 } 1074 }
1083 1075
1084 void V8DebuggerImpl::promiseRejectionRevoked(v8::Local<v8::Context> context, uns igned promiseRejectionId) 1076 void V8DebuggerImpl::exceptionRevoked(v8::Local<v8::Context> context, unsigned e xceptionId, const String16& message)
1085 { 1077 {
1086 int contextGroupId = getGroupId(context); 1078 int contextGroupId = getGroupId(context);
1087 if (!contextGroupId) 1079 if (!contextGroupId)
1088 return; 1080 return;
1089 1081
1090 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF orRevokedException(m_client->currentTimeMS(), "Handler added to rejected promise ", promiseRejectionId); 1082 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF orRevokedException(m_client->currentTimeMS(), message, exceptionId);
1091 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage)); 1083 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage));
1092 } 1084 }
1093 1085
1094 std::unique_ptr<V8StackTrace> V8DebuggerImpl::captureStackTrace(bool fullStack) 1086 std::unique_ptr<V8StackTrace> V8DebuggerImpl::captureStackTrace(bool fullStack)
1095 { 1087 {
1096 return captureStackTraceImpl(fullStack); 1088 return captureStackTraceImpl(fullStack);
1097 } 1089 }
1098 1090
1099 std::unique_ptr<V8StackTraceImpl> V8DebuggerImpl::captureStackTraceImpl(bool ful lStack) 1091 std::unique_ptr<V8StackTraceImpl> V8DebuggerImpl::captureStackTraceImpl(bool ful lStack)
1100 { 1092 {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 1130
1139 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI d) 1131 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI d)
1140 { 1132 {
1141 if (!contextGroupId) 1133 if (!contextGroupId)
1142 return nullptr; 1134 return nullptr;
1143 SessionMap::iterator iter = m_sessions.find(contextGroupId); 1135 SessionMap::iterator iter = m_sessions.find(contextGroupId);
1144 return iter == m_sessions.end() ? nullptr : iter->second; 1136 return iter == m_sessions.end() ? nullptr : iter->second;
1145 } 1137 }
1146 1138
1147 } // namespace blink 1139 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698