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

Unified Diff: third_party/WebKit/Source/core/dom/ExecutionContext.cpp

Issue 2010603002: Use SourceLocation when reporting runtime exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2004243002
Patch Set: test fixes Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/ExecutionContext.cpp
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
index 98610a0fdff20acb9665c6d29e048e09e4a5eed0..0a5bebd71c70a72c300ad158170984893ec7088f 100644
--- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
+++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
@@ -27,7 +27,7 @@
#include "core/dom/ExecutionContext.h"
-#include "bindings/core/v8/ScriptCallStack.h"
+#include "bindings/core/v8/SourceLocation.h"
#include "core/dom/ExecutionContextTask.h"
#include "core/events/ErrorEvent.h"
#include "core/events/EventTarget.h"
@@ -43,22 +43,14 @@ namespace blink {
class ExecutionContext::PendingException {
WTF_MAKE_NONCOPYABLE(PendingException);
public:
- PendingException(const String& errorMessage, int lineNumber, int columnNumber, int scriptId, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
+ PendingException(const String& errorMessage, PassOwnPtr<SourceLocation> location)
: m_errorMessage(errorMessage)
- , m_lineNumber(lineNumber)
- , m_columnNumber(columnNumber)
- , m_scriptId(scriptId)
- , m_sourceURL(sourceURL)
- , m_callStack(callStack)
+ , m_location(std::move(location))
{
}
String m_errorMessage;
- int m_lineNumber;
- int m_columnNumber;
- int m_scriptId;
- String m_sourceURL;
- RefPtr<ScriptCallStack> m_callStack;
+ OwnPtr<SourceLocation> m_location;
};
ExecutionContext::ExecutionContext()
@@ -146,25 +138,25 @@ bool ExecutionContext::shouldSanitizeScriptError(const String& sourceURL, Access
return !(getSecurityOrigin()->canRequestNoSuborigin(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin);
}
-void ExecutionContext::reportException(ErrorEvent* errorEvent, int scriptId, PassRefPtr<ScriptCallStack> callStack, AccessControlStatus corsStatus)
+void ExecutionContext::reportException(ErrorEvent* errorEvent, PassOwnPtr<SourceLocation> location, AccessControlStatus corsStatus)
{
if (m_inDispatchErrorEvent) {
if (!m_pendingExceptions)
m_pendingExceptions = adoptPtr(new Vector<OwnPtr<PendingException>>());
- m_pendingExceptions->append(adoptPtr(new PendingException(errorEvent->messageForConsole(), errorEvent->lineno(), errorEvent->colno(), scriptId, errorEvent->filename(), callStack)));
+ m_pendingExceptions->append(adoptPtr(new PendingException(errorEvent->messageForConsole(), std::move(location))));
return;
}
// First report the original exception and only then all the nested ones.
if (!dispatchErrorEvent(errorEvent, corsStatus))
- logExceptionToConsole(errorEvent->messageForConsole(), scriptId, errorEvent->filename(), errorEvent->lineno(), errorEvent->colno(), callStack);
+ logExceptionToConsole(errorEvent->messageForConsole(), std::move(location));
if (!m_pendingExceptions)
return;
for (size_t i = 0; i < m_pendingExceptions->size(); i++) {
PendingException* e = m_pendingExceptions->at(i).get();
- logExceptionToConsole(e->m_errorMessage, e->m_scriptId, e->m_sourceURL, e->m_lineNumber, e->m_columnNumber, e->m_callStack);
+ logExceptionToConsole(e->m_errorMessage, std::move(e->m_location));
}
m_pendingExceptions.reset();
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.h ('k') | third_party/WebKit/Source/core/inspector/ConsoleMessage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698