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

Side by Side Diff: Source/core/frame/FrameConsole.cpp

Issue 645693003: [DevTools] Console Message Storage moved from top local frame to frame host (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
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
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();
Charlie Reis 2014/10/15 17:09:17 nit: Can we use m_frame->host() instead of m_frame
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/FrameHost.h » ('j') | Source/core/inspector/InspectorInstrumentation.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698