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

Side by Side Diff: Source/core/inspector/PageDebuggerAgent.cpp

Issue 892693006: Revert of DevTools: use per-LocalFrame instrumenting agents instead of per-Page ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/PageConsoleAgent.cpp ('k') | Source/core/inspector/PageRuntimeAgent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 void PageDebuggerAgent::disable() 79 void PageDebuggerAgent::disable()
80 { 80 {
81 InspectorDebuggerAgent::disable(); 81 InspectorDebuggerAgent::disable();
82 m_instrumentingAgents->setPageDebuggerAgent(0); 82 m_instrumentingAgents->setPageDebuggerAgent(0);
83 } 83 }
84 84
85 void PageDebuggerAgent::startListeningScriptDebugServer() 85 void PageDebuggerAgent::startListeningScriptDebugServer()
86 { 86 {
87 scriptDebugServer().addListener(this, m_pageAgent->inspectedFrame()); 87 scriptDebugServer().addListener(this, m_pageAgent->page());
88 } 88 }
89 89
90 void PageDebuggerAgent::stopListeningScriptDebugServer() 90 void PageDebuggerAgent::stopListeningScriptDebugServer()
91 { 91 {
92 scriptDebugServer().removeListener(this, m_pageAgent->inspectedFrame()); 92 scriptDebugServer().removeListener(this, m_pageAgent->page());
93 } 93 }
94 94
95 PageScriptDebugServer& PageDebuggerAgent::scriptDebugServer() 95 PageScriptDebugServer& PageDebuggerAgent::scriptDebugServer()
96 { 96 {
97 return *m_pageScriptDebugServer; 97 return *m_pageScriptDebugServer;
98 } 98 }
99 99
100 void PageDebuggerAgent::muteConsole() 100 void PageDebuggerAgent::muteConsole()
101 { 101 {
102 FrameConsole::mute(); 102 FrameConsole::mute();
(...skipping 12 matching lines...) Expand all
115 115
116 void PageDebuggerAgent::overlaySteppedOver() 116 void PageDebuggerAgent::overlaySteppedOver()
117 { 117 {
118 ErrorString error; 118 ErrorString error;
119 stepOver(&error); 119 stepOver(&error);
120 } 120 }
121 121
122 InjectedScript PageDebuggerAgent::injectedScriptForEval(ErrorString* errorString , const int* executionContextId) 122 InjectedScript PageDebuggerAgent::injectedScriptForEval(ErrorString* errorString , const int* executionContextId)
123 { 123 {
124 if (!executionContextId) { 124 if (!executionContextId) {
125 ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspec tedFrame()); 125 ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->mainFr ame());
126 InjectedScript result = injectedScriptManager()->injectedScriptFor(scrip tState); 126 InjectedScript result = injectedScriptManager()->injectedScriptFor(scrip tState);
127 if (result.isEmpty()) 127 if (result.isEmpty())
128 *errorString = "Internal error: main world execution context not fou nd."; 128 *errorString = "Internal error: main world execution context not fou nd.";
129 return result; 129 return result;
130 } 130 }
131 InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId (*executionContextId); 131 InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId (*executionContextId);
132 if (injectedScript.isEmpty()) 132 if (injectedScript.isEmpty())
133 *errorString = "Execution context with given id not found."; 133 *errorString = "Execution context with given id not found.";
134 return injectedScript; 134 return injectedScript;
135 } 135 }
136 136
137 void PageDebuggerAgent::didClearDocumentOfWindowObject(LocalFrame* frame) 137 void PageDebuggerAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
138 { 138 {
139 // FIXME: what about nested objects? 139 if (frame != m_pageAgent->mainFrame())
140 if (frame != m_pageAgent->inspectedFrame())
141 return; 140 return;
142 141
143 reset(); 142 reset();
144 143
145 scriptDebugServer().setPreprocessorSource(String()); 144 scriptDebugServer().setPreprocessorSource(String());
146 ASSERT(m_pageAgent); 145 ASSERT(m_pageAgent);
147 if (!m_pageAgent->scriptPreprocessorSource().isEmpty()) 146 if (!m_pageAgent->scriptPreprocessorSource().isEmpty())
148 scriptDebugServer().setPreprocessorSource(m_pageAgent->scriptPreprocesso rSource()); 147 scriptDebugServer().setPreprocessorSource(m_pageAgent->scriptPreprocesso rSource());
149 } 148 }
150 149
151 void PageDebuggerAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* loader) 150 void PageDebuggerAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* loader)
152 { 151 {
153 if (loader->frame() == m_pageAgent->inspectedFrame()) 152 Frame* mainFrame = frame->page()->deprecatedLocalMainFrame();
153 if (loader->frame() == mainFrame)
154 pageDidCommitLoad(); 154 pageDidCommitLoad();
155 } 155 }
156 156
157 } // namespace blink 157 } // namespace blink
158 158
OLDNEW
« no previous file with comments | « Source/core/inspector/PageConsoleAgent.cpp ('k') | Source/core/inspector/PageRuntimeAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698