| OLD | NEW |
| 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 Loading... |
| 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->page()); | 87 scriptDebugServer().addListener(this, m_pageAgent->inspectedFrame()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void PageDebuggerAgent::stopListeningScriptDebugServer() | 90 void PageDebuggerAgent::stopListeningScriptDebugServer() |
| 91 { | 91 { |
| 92 scriptDebugServer().removeListener(this, m_pageAgent->page()); | 92 scriptDebugServer().removeListener(this, m_pageAgent->inspectedFrame()); |
| 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 Loading... |
| 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->mainFr
ame()); | 125 ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspec
tedFrame()); |
| 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 if (frame != m_pageAgent->mainFrame()) | 139 // FIXME: what about nested objects? |
| 140 if (frame != m_pageAgent->inspectedFrame()) |
| 140 return; | 141 return; |
| 141 | 142 |
| 142 reset(); | 143 reset(); |
| 143 | 144 |
| 144 scriptDebugServer().setPreprocessorSource(String()); | 145 scriptDebugServer().setPreprocessorSource(String()); |
| 145 ASSERT(m_pageAgent); | 146 ASSERT(m_pageAgent); |
| 146 if (!m_pageAgent->scriptPreprocessorSource().isEmpty()) | 147 if (!m_pageAgent->scriptPreprocessorSource().isEmpty()) |
| 147 scriptDebugServer().setPreprocessorSource(m_pageAgent->scriptPreprocesso
rSource()); | 148 scriptDebugServer().setPreprocessorSource(m_pageAgent->scriptPreprocesso
rSource()); |
| 148 } | 149 } |
| 149 | 150 |
| 150 void PageDebuggerAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* loader) | 151 void PageDebuggerAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* loader) |
| 151 { | 152 { |
| 152 Frame* mainFrame = frame->page()->deprecatedLocalMainFrame(); | 153 if (loader->frame() == m_pageAgent->inspectedFrame()) |
| 153 if (loader->frame() == mainFrame) | |
| 154 pageDidCommitLoad(); | 154 pageDidCommitLoad(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace blink | 157 } // namespace blink |
| 158 | 158 |
| OLD | NEW |