OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 { | 56 { |
57 } | 57 } |
58 | 58 |
59 ExecutionContext* Console::context() | 59 ExecutionContext* Console::context() |
60 { | 60 { |
61 if (!m_frame) | 61 if (!m_frame) |
62 return 0; | 62 return 0; |
63 return m_frame->document(); | 63 return m_frame->document(); |
64 } | 64 } |
65 | 65 |
66 void Console::reportMessageToClient(MessageLevel level, const String& message, P
assRefPtrWillBeRawPtr<ScriptCallStack> callStack) | 66 void Console::reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage> cons
oleMessage) |
67 { | 67 { |
68 if (!m_frame || !m_frame->host() || !callStack.get()) | 68 if (!m_frame) |
69 return; | 69 return; |
70 | 70 |
71 String stackTrace; | 71 m_frame->console().addMessage(consoleMessage); |
72 if (m_frame->chromeClient().shouldReportDetailedMessageForSource(callStack->
at(0).sourceURL())) { | |
73 RefPtrWillBeRawPtr<ScriptCallStack> fullStack = createScriptCallStack(Sc
riptCallStack::maxCallStackSizeToCapture); | |
74 stackTrace = FrameConsole::formatStackTraceString(message, fullStack); | |
75 } | |
76 m_frame->chromeClient().addMessageToConsole(m_frame, ConsoleAPIMessageSource
, level, message, callStack->at(0).lineNumber(), callStack->at(0).sourceURL(), s
tackTrace); | |
77 } | 72 } |
78 | 73 |
79 PassRefPtrWillBeRawPtr<MemoryInfo> Console::memory() const | 74 PassRefPtrWillBeRawPtr<MemoryInfo> Console::memory() const |
80 { | 75 { |
81 // FIXME: Because we create a new object here each time, | 76 // FIXME: Because we create a new object here each time, |
82 // console.memory !== console.memory, which seems wrong. | 77 // console.memory !== console.memory, which seems wrong. |
83 return MemoryInfo::create(); | 78 return MemoryInfo::create(); |
84 } | 79 } |
85 | 80 |
86 } // namespace blink | 81 } // namespace blink |
OLD | NEW |