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

Unified Diff: Source/core/page/PageConsole.cpp

Issue 111113003: Move PageConsole to using FrameHost instead of Page (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/PageConsole.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PageConsole.cpp
diff --git a/Source/core/page/PageConsole.cpp b/Source/core/page/PageConsole.cpp
index 763910a162c4bc4178c2a7a74870c70dd8380067..167506ae35e3085bf0df7decfadf433c291bbca8 100644
--- a/Source/core/page/PageConsole.cpp
+++ b/Source/core/page/PageConsole.cpp
@@ -30,15 +30,13 @@
#include "core/page/PageConsole.h"
#include "core/dom/Document.h"
-#include "core/dom/ScriptableDocumentParser.h"
+#include "core/frame/FrameHost.h"
#include "core/inspector/ConsoleAPITypes.h"
#include "core/inspector/InspectorConsoleInstrumentation.h"
#include "core/page/Chrome.h"
#include "core/page/ChromeClient.h"
-#include "core/frame/ConsoleBase.h"
#include "core/page/Page.h"
#include "wtf/text/StringBuilder.h"
-#include "wtf/text/WTFString.h"
namespace WebCore {
@@ -48,8 +46,8 @@ int muteCount = 0;
}
-PageConsole::PageConsole(Page* page)
- : m_page(page)
+PageConsole::PageConsole(FrameHost& frameHost)
+ : m_frameHost(frameHost)
{
}
@@ -68,7 +66,9 @@ void PageConsole::addMessage(MessageSource source, MessageLevel level, const Str
if (muteCount && source != ConsoleAPIMessageSource)
return;
- ExecutionContext* context = m_page->mainFrame()->document();
+ // FIXME: This should not need to reach for the main-frame.
+ // Inspector code should just take the current frame and know how to walk itself.
+ ExecutionContext* context = m_frameHost.page().mainFrame()->document();
if (!context)
return;
@@ -85,10 +85,10 @@ void PageConsole::addMessage(MessageSource source, MessageLevel level, const Str
return;
String stackTrace;
- if (callStack && m_page->chrome().client().shouldReportDetailedMessageForSource(messageURL))
+ if (callStack && m_frameHost.chrome().client().shouldReportDetailedMessageForSource(messageURL))
stackTrace = PageConsole::formatStackTraceString(message, callStack);
- m_page->chrome().client().addMessageToConsole(source, level, message, lineNumber, messageURL, stackTrace);
+ m_frameHost.chrome().client().addMessageToConsole(source, level, message, lineNumber, messageURL, stackTrace);
}
String PageConsole::formatStackTraceString(const String& originalMessage, PassRefPtr<ScriptCallStack> callStack)
« no previous file with comments | « Source/core/page/PageConsole.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698