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

Unified Diff: third_party/WebKit/Source/core/events/ErrorEvent.cpp

Issue 2006893004: Store SourceLocation in ErrorEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2010603002
Patch Set: rebased 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/events/ErrorEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/ErrorEvent.cpp b/third_party/WebKit/Source/core/events/ErrorEvent.cpp
index 5e2112afc7e48ecc407ff576dd12fe7cdfa6ccbf..bab76836fef19fd787574e850cc47016d5a49586 100644
--- a/third_party/WebKit/Source/core/events/ErrorEvent.cpp
+++ b/third_party/WebKit/Source/core/events/ErrorEvent.cpp
@@ -37,9 +37,7 @@ namespace blink {
ErrorEvent::ErrorEvent()
: m_sanitizedMessage()
- , m_fileName()
- , m_lineNumber(0)
- , m_columnNumber(0)
+ , m_location(SourceLocation::create(String(), 0, 0, nullptr))
, m_world(DOMWrapperWorld::current(v8::Isolate::GetCurrent()))
{
}
@@ -47,29 +45,23 @@ ErrorEvent::ErrorEvent()
ErrorEvent::ErrorEvent(const AtomicString& type, const ErrorEventInit& initializer)
: Event(type, initializer)
, m_sanitizedMessage()
- , m_fileName()
- , m_lineNumber(0)
- , m_columnNumber(0)
, m_world(DOMWrapperWorld::current(v8::Isolate::GetCurrent()))
{
if (initializer.hasMessage())
m_sanitizedMessage = initializer.message();
- if (initializer.hasFilename())
- m_fileName = initializer.filename();
- if (initializer.hasLineno())
- m_lineNumber = initializer.lineno();
- if (initializer.hasColno())
- m_columnNumber = initializer.colno();
+ m_location = SourceLocation::create(
+ initializer.hasFilename() ? initializer.filename() : String(),
+ initializer.hasLineno() ? initializer.lineno() : 0,
+ initializer.hasColno() ? initializer.colno() : 0,
+ nullptr);
if (initializer.hasError())
m_error = initializer.error();
}
-ErrorEvent::ErrorEvent(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber, DOMWrapperWorld* world)
+ErrorEvent::ErrorEvent(const String& message, PassOwnPtr<SourceLocation> location, DOMWrapperWorld* world)
: Event(EventTypeNames::error, false, true)
, m_sanitizedMessage(message)
- , m_fileName(fileName)
- , m_lineNumber(lineNumber)
- , m_columnNumber(columnNumber)
+ , m_location(std::move(location))
, m_world(world)
{
}

Powered by Google App Engine
This is Rietveld 408576698