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

Side by Side Diff: third_party/WebKit/Source/core/dom/ExecutionContext.cpp

Issue 2116563003: [DevTools] Report unhandled exceptions and promise rejections through Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after ExceptionDetails change Created 4 years, 5 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 { 146 {
147 if (m_inDispatchErrorEvent) { 147 if (m_inDispatchErrorEvent) {
148 if (!m_pendingExceptions) 148 if (!m_pendingExceptions)
149 m_pendingExceptions = wrapUnique(new Vector<std::unique_ptr<PendingE xception>>()); 149 m_pendingExceptions = wrapUnique(new Vector<std::unique_ptr<PendingE xception>>());
150 m_pendingExceptions->append(wrapUnique(new PendingException(errorEvent-> messageForConsole(), errorEvent->location()->clone()))); 150 m_pendingExceptions->append(wrapUnique(new PendingException(errorEvent-> messageForConsole(), errorEvent->location()->clone())));
151 return; 151 return;
152 } 152 }
153 153
154 // First report the original exception and only then all the nested ones. 154 // First report the original exception and only then all the nested ones.
155 if (!dispatchErrorEvent(errorEvent, corsStatus)) 155 if (!dispatchErrorEvent(errorEvent, corsStatus))
156 logExceptionToConsole(errorEvent->messageForConsole(), errorEvent->locat ion()->clone()); 156 exceptionThrown(errorEvent->messageForConsole(), errorEvent->location()- >clone());
157 157
158 if (!m_pendingExceptions) 158 if (!m_pendingExceptions)
159 return; 159 return;
160 160
161 for (size_t i = 0; i < m_pendingExceptions->size(); i++) { 161 for (size_t i = 0; i < m_pendingExceptions->size(); i++) {
162 PendingException* e = m_pendingExceptions->at(i).get(); 162 PendingException* e = m_pendingExceptions->at(i).get();
163 logExceptionToConsole(e->m_errorMessage, std::move(e->m_location)); 163 exceptionThrown(e->m_errorMessage, std::move(e->m_location));
164 } 164 }
165 m_pendingExceptions.reset(); 165 m_pendingExceptions.reset();
166 } 166 }
167 167
168 bool ExecutionContext::dispatchErrorEvent(ErrorEvent* errorEvent, AccessControlS tatus corsStatus) 168 bool ExecutionContext::dispatchErrorEvent(ErrorEvent* errorEvent, AccessControlS tatus corsStatus)
169 { 169 {
170 EventTarget* target = errorEventTarget(); 170 EventTarget* target = errorEventTarget();
171 if (!target) 171 if (!target)
172 return false; 172 return false;
173 173
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 DEFINE_TRACE(ExecutionContext) 293 DEFINE_TRACE(ExecutionContext)
294 { 294 {
295 visitor->trace(m_publicURLManager); 295 visitor->trace(m_publicURLManager);
296 ContextLifecycleNotifier::trace(visitor); 296 ContextLifecycleNotifier::trace(visitor);
297 Supplementable<ExecutionContext>::trace(visitor); 297 Supplementable<ExecutionContext>::trace(visitor);
298 } 298 }
299 299
300 } // namespace blink 300 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.h ('k') | third_party/WebKit/Source/core/inspector/MainThreadDebugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698