| OLD | NEW |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 WorkerConsole::WorkerConsole(WorkerGlobalScope* scope) | 43 WorkerConsole::WorkerConsole(WorkerGlobalScope* scope) |
| 44 : m_scope(scope) | 44 : m_scope(scope) |
| 45 { | 45 { |
| 46 ScriptWrappable::init(this); | 46 ScriptWrappable::init(this); |
| 47 } | 47 } |
| 48 | 48 |
| 49 WorkerConsole::~WorkerConsole() | 49 WorkerConsole::~WorkerConsole() |
| 50 { | 50 { |
| 51 } | 51 } |
| 52 | 52 |
| 53 void WorkerConsole::reportMessageToClient(MessageLevel level, const String& mess
age, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack) | 53 void WorkerConsole::reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage
> consoleMessage) |
| 54 { | 54 { |
| 55 const ScriptCallFrame& lastCaller = callStack->at(0); | 55 const ScriptCallFrame& lastCaller = consoleMessage->callStack()->at(0); |
| 56 m_scope->thread()->workerReportingProxy().reportConsoleMessage(ConsoleMessag
e::create(ConsoleAPIMessageSource, level, message, lastCaller.sourceURL(), lastC
aller.lineNumber())); | 56 consoleMessage->setURL(lastCaller.sourceURL()); |
| 57 consoleMessage->setLineNumber(lastCaller.lineNumber()); |
| 58 m_scope->addMessage(consoleMessage); |
| 57 } | 59 } |
| 58 | 60 |
| 59 ExecutionContext* WorkerConsole::context() | 61 ExecutionContext* WorkerConsole::context() |
| 60 { | 62 { |
| 61 if (!m_scope) | 63 if (!m_scope) |
| 62 return 0; | 64 return 0; |
| 63 return m_scope->executionContext(); | 65 return m_scope->executionContext(); |
| 64 } | 66 } |
| 65 | 67 |
| 66 void WorkerConsole::trace(Visitor* visitor) | 68 void WorkerConsole::trace(Visitor* visitor) |
| 67 { | 69 { |
| 68 visitor->trace(m_scope); | 70 visitor->trace(m_scope); |
| 69 ConsoleBase::trace(visitor); | 71 ConsoleBase::trace(visitor); |
| 70 } | 72 } |
| 71 | 73 |
| 72 // FIXME: add memory getter | 74 // FIXME: add memory getter |
| 73 | 75 |
| 74 } // namespace blink | 76 } // namespace blink |
| OLD | NEW |