OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 158 } |
159 | 159 |
160 void FrameConsole::unmute() | 160 void FrameConsole::unmute() |
161 { | 161 { |
162 ASSERT(muteCount > 0); | 162 ASSERT(muteCount > 0); |
163 muteCount--; | 163 muteCount--; |
164 } | 164 } |
165 | 165 |
166 ConsoleMessageStorage* FrameConsole::messageStorage() | 166 ConsoleMessageStorage* FrameConsole::messageStorage() |
167 { | 167 { |
168 LocalFrame* curFrame = m_frame; | 168 ASSERT(m_frame->page()); |
169 // FIXME: Move the console's messageStorage off the main frame. | 169 return &m_frame->page()->frameHost().consoleMessageStorage(); |
170 Frame* topFrame = curFrame->localFrameRoot(); | |
171 ASSERT(topFrame->isLocalFrame()); | |
172 LocalFrame* localTopFrame = toLocalFrame(topFrame); | |
173 if (localTopFrame != curFrame) | |
174 return localTopFrame->console().messageStorage(); | |
175 if (!m_consoleMessageStorage) | |
176 m_consoleMessageStorage = ConsoleMessageStorage::createForFrame(m_frame)
; | |
177 return m_consoleMessageStorage.get(); | |
178 } | 170 } |
179 | 171 |
180 void FrameConsole::clearMessages() | 172 void FrameConsole::clearMessages() |
181 { | 173 { |
182 messageStorage()->clear(); | 174 messageStorage()->clear(); |
183 } | 175 } |
184 | 176 |
185 void FrameConsole::adoptWorkerMessagesAfterTermination(WorkerGlobalScopeProxy* p
roxy) | 177 void FrameConsole::adoptWorkerMessagesAfterTermination(WorkerGlobalScopeProxy* p
roxy) |
186 { | 178 { |
187 messageStorage()->adoptWorkerMessagesAfterTermination(proxy); | 179 messageStorage()->adoptWorkerMessagesAfterTermination(proxy); |
(...skipping 14 matching lines...) Expand all Loading... |
202 messageStorage()->reportMessage(consoleMessage.release()); | 194 messageStorage()->reportMessage(consoleMessage.release()); |
203 } | 195 } |
204 | 196 |
205 void FrameConsole::trace(Visitor* visitor) | 197 void FrameConsole::trace(Visitor* visitor) |
206 { | 198 { |
207 visitor->trace(m_frame); | 199 visitor->trace(m_frame); |
208 visitor->trace(m_consoleMessageStorage); | 200 visitor->trace(m_consoleMessageStorage); |
209 } | 201 } |
210 | 202 |
211 } // namespace blink | 203 } // namespace blink |
OLD | NEW |