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

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: worklets! 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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 void V8DebuggerImpl::idleStarted() 1050 void V8DebuggerImpl::idleStarted()
1051 { 1051 {
1052 m_isolate->GetCpuProfiler()->SetIdle(true); 1052 m_isolate->GetCpuProfiler()->SetIdle(true);
1053 } 1053 }
1054 1054
1055 void V8DebuggerImpl::idleFinished() 1055 void V8DebuggerImpl::idleFinished()
1056 { 1056 {
1057 m_isolate->GetCpuProfiler()->SetIdle(false); 1057 m_isolate->GetCpuProfiler()->SetIdle(false);
1058 } 1058 }
1059 1059
1060 void V8DebuggerImpl::exceptionThrown(int contextGroupId, const String16& errorMe ssage, const String16& url, unsigned lineNumber, unsigned columnNumber, std::uni que_ptr<V8StackTrace> stackTrace, int scriptId) 1060 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)
1061 {
1062 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8 StackTraceImpl*>(stackTrace.release()));
1063 unsigned exceptionId = ++m_lastExceptionId;
1064 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);
1065 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage));
1066 }
1067
1068 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)
1069 { 1061 {
1070 int contextGroupId = getGroupId(context); 1062 int contextGroupId = getGroupId(context);
1071 if (!contextGroupId) 1063 if (!contextGroupId)
1072 return 0; 1064 return 0;
1073 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8 StackTraceImpl*>(stackTrace.release())); 1065 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8 StackTraceImpl*>(stackTrace.release()));
1074 unsigned exceptionId = ++m_lastExceptionId; 1066 unsigned exceptionId = ++m_lastExceptionId;
1075 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); 1067 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);
1076 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage)); 1068 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage));
1077 return exceptionId; 1069 return exceptionId;
1078 } 1070 }
1079 1071
1080 void V8DebuggerImpl::promiseRejectionRevoked(v8::Local<v8::Context> context, uns igned promiseRejectionId) 1072 void V8DebuggerImpl::exceptionRevoked(v8::Local<v8::Context> context, unsigned e xceptionId, const String16& message)
1081 { 1073 {
1082 int contextGroupId = getGroupId(context); 1074 int contextGroupId = getGroupId(context);
1083 if (!contextGroupId) 1075 if (!contextGroupId)
1084 return; 1076 return;
1085 1077
1086 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF orRevokedException(m_client->currentTimeMS(), "Handler added to rejected promise ", promiseRejectionId); 1078 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF orRevokedException(m_client->currentTimeMS(), message, exceptionId);
1087 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage)); 1079 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage));
1088 } 1080 }
1089 1081
1090 std::unique_ptr<V8StackTrace> V8DebuggerImpl::captureStackTrace(bool fullStack) 1082 std::unique_ptr<V8StackTrace> V8DebuggerImpl::captureStackTrace(bool fullStack)
1091 { 1083 {
1092 return captureStackTraceImpl(fullStack); 1084 return captureStackTraceImpl(fullStack);
1093 } 1085 }
1094 1086
1095 std::unique_ptr<V8StackTraceImpl> V8DebuggerImpl::captureStackTraceImpl(bool ful lStack) 1087 std::unique_ptr<V8StackTraceImpl> V8DebuggerImpl::captureStackTraceImpl(bool ful lStack)
1096 { 1088 {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 1126
1135 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI d) 1127 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI d)
1136 { 1128 {
1137 if (!contextGroupId) 1129 if (!contextGroupId)
1138 return nullptr; 1130 return nullptr;
1139 SessionMap::iterator iter = m_sessions.find(contextGroupId); 1131 SessionMap::iterator iter = m_sessions.find(contextGroupId);
1140 return iter == m_sessions.end() ? nullptr : iter->second; 1132 return iter == m_sessions.end() ? nullptr : iter->second;
1141 } 1133 }
1142 1134
1143 } // namespace blink 1135 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698