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

Unified Diff: Source/core/workers/WorkerConsole.cpp

Issue 562683003: Tidy up ConsoleMessage callstack inclusion, fix Worker console crashes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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
« Source/core/frame/ConsoleBase.cpp ('K') | « Source/core/frame/ConsoleBase.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerConsole.cpp
diff --git a/Source/core/workers/WorkerConsole.cpp b/Source/core/workers/WorkerConsole.cpp
index 7991d2814f048c1e14e09bd2d476ac00f7cd1635..6227d9d6290d15d803b5363b6aa25a50b6392175 100644
--- a/Source/core/workers/WorkerConsole.cpp
+++ b/Source/core/workers/WorkerConsole.cpp
@@ -51,9 +51,11 @@ WorkerConsole::~WorkerConsole()
void WorkerConsole::reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage> consoleMessage)
{
- const ScriptCallFrame& lastCaller = consoleMessage->callStack()->at(0);
- consoleMessage->setURL(lastCaller.sourceURL());
- consoleMessage->setLineNumber(lastCaller.lineNumber());
+ if (RefPtrWillBeRawPtr<ScriptCallStack> callStack = consoleMessage->callStack()) {
+ const ScriptCallFrame& lastCaller = callStack->at(0);
+ consoleMessage->setURL(lastCaller.sourceURL());
+ consoleMessage->setLineNumber(lastCaller.lineNumber());
+ }
kozyatinskiy1 2014/09/15 12:57:25 We have two places where we call this function: Co
sof 2014/09/15 13:09:33 That seems quite brittle - by inference, we should
kozyatinskiy1 2014/09/15 13:31:29 Ok, I agree with you but in this case, it is diffi
m_scope->addConsoleMessage(consoleMessage);
}
« Source/core/frame/ConsoleBase.cpp ('K') | « Source/core/frame/ConsoleBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698