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

Unified Diff: Source/core/inspector/PageRuntimeAgent.cpp

Issue 1118963002: Revert of DevTools: remove dependency of most agents on InspectorPageAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.h ('k') | Source/web/WebDevToolsAgentImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/PageRuntimeAgent.cpp
diff --git a/Source/core/inspector/PageRuntimeAgent.cpp b/Source/core/inspector/PageRuntimeAgent.cpp
index 7f811fe405e49b815a69c542e90943330c6b1ca4..7bb1a3d26897f8a273baf545d17c6c0f90b1306b 100644
--- a/Source/core/inspector/PageRuntimeAgent.cpp
+++ b/Source/core/inspector/PageRuntimeAgent.cpp
@@ -40,6 +40,7 @@
#include "core/inspector/InjectedScript.h"
#include "core/inspector/InjectedScriptManager.h"
#include "core/inspector/InspectorIdentifiers.h"
+#include "core/inspector/InspectorPageAgent.h"
#include "core/inspector/InstrumentingAgents.h"
#include "core/page/Page.h"
#include "platform/weborigin/SecurityOrigin.h"
@@ -48,9 +49,9 @@
static int s_nextDebuggerId = 1;
-PageRuntimeAgent::PageRuntimeAgent(LocalFrame* inspectedFrame, InjectedScriptManager* injectedScriptManager, Client* client, ScriptDebugServer* scriptDebugServer)
+PageRuntimeAgent::PageRuntimeAgent(InjectedScriptManager* injectedScriptManager, Client* client, ScriptDebugServer* scriptDebugServer, InspectorPageAgent* pageAgent)
: InspectorRuntimeAgent(injectedScriptManager, scriptDebugServer, client)
- , m_inspectedFrame(inspectedFrame)
+ , m_pageAgent(pageAgent)
, m_mainWorldContextCreated(false)
, m_debuggerId(s_nextDebuggerId++)
{
@@ -65,7 +66,7 @@
DEFINE_TRACE(PageRuntimeAgent)
{
- visitor->trace(m_inspectedFrame);
+ visitor->trace(m_pageAgent);
InspectorRuntimeAgent::trace(visitor);
}
@@ -129,7 +130,7 @@
InjectedScript PageRuntimeAgent::injectedScriptForEval(ErrorString* errorString, const int* executionContextId)
{
if (!executionContextId) {
- ScriptState* scriptState = ScriptState::forMainWorld(m_inspectedFrame);
+ ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspectedFrame());
InjectedScript result = injectedScriptManager()->injectedScriptFor(scriptState);
if (result.isEmpty())
*errorString = "Internal error: main world execution context not found.";
@@ -154,7 +155,7 @@
void PageRuntimeAgent::reportExecutionContextCreation()
{
Vector<std::pair<ScriptState*, SecurityOrigin*> > isolatedContexts;
- for (Frame* frame = m_inspectedFrame; frame; frame = frame->tree().traverseNext(m_inspectedFrame)) {
+ for (Frame* frame = m_pageAgent->inspectedFrame(); frame; frame = frame->tree().traverseNext(m_pageAgent->inspectedFrame())) {
if (!frame->isLocalFrame())
continue;
LocalFrame* localFrame = toLocalFrame(frame);
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.h ('k') | Source/web/WebDevToolsAgentImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698