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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 : m_scope(scope) 44 : m_scope(scope)
45 { 45 {
46 } 46 }
47 47
48 WorkerConsole::~WorkerConsole() 48 WorkerConsole::~WorkerConsole()
49 { 49 {
50 } 50 }
51 51
52 void WorkerConsole::reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage > consoleMessage) 52 void WorkerConsole::reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage > consoleMessage)
53 { 53 {
54 const ScriptCallFrame& lastCaller = consoleMessage->callStack()->at(0); 54 if (RefPtrWillBeRawPtr<ScriptCallStack> callStack = consoleMessage->callStac k()) {
55 consoleMessage->setURL(lastCaller.sourceURL()); 55 const ScriptCallFrame& lastCaller = callStack->at(0);
56 consoleMessage->setLineNumber(lastCaller.lineNumber()); 56 consoleMessage->setURL(lastCaller.sourceURL());
57 consoleMessage->setLineNumber(lastCaller.lineNumber());
58 }
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
57 m_scope->addConsoleMessage(consoleMessage); 59 m_scope->addConsoleMessage(consoleMessage);
58 } 60 }
59 61
60 ExecutionContext* WorkerConsole::context() 62 ExecutionContext* WorkerConsole::context()
61 { 63 {
62 if (!m_scope) 64 if (!m_scope)
63 return 0; 65 return 0;
64 return m_scope->executionContext(); 66 return m_scope->executionContext();
65 } 67 }
66 68
67 void WorkerConsole::trace(Visitor* visitor) 69 void WorkerConsole::trace(Visitor* visitor)
68 { 70 {
69 visitor->trace(m_scope); 71 visitor->trace(m_scope);
70 ConsoleBase::trace(visitor); 72 ConsoleBase::trace(visitor);
71 } 73 }
72 74
73 // FIXME: add memory getter 75 // FIXME: add memory getter
74 76
75 } // namespace blink 77 } // namespace blink
OLDNEW
« 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