| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 DEFINE_TRACE(PageDebuggerAgent) | 67 DEFINE_TRACE(PageDebuggerAgent) |
| 68 { | 68 { |
| 69 visitor->trace(m_pageScriptDebugServer); | 69 visitor->trace(m_pageScriptDebugServer); |
| 70 visitor->trace(m_pageAgent); | 70 visitor->trace(m_pageAgent); |
| 71 visitor->trace(m_overlay); | 71 visitor->trace(m_overlay); |
| 72 InspectorDebuggerAgent::trace(visitor); | 72 InspectorDebuggerAgent::trace(visitor); |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool PageDebuggerAgent::canExecuteScripts() const |
| 76 { |
| 77 ScriptController& scriptController = m_pageAgent->inspectedFrame()->script()
; |
| 78 return scriptController.canExecuteScripts(NotAboutToExecuteScript); |
| 79 } |
| 80 |
| 81 void PageDebuggerAgent::enable(ErrorString* errorString) |
| 82 { |
| 83 if (!canExecuteScripts()) { |
| 84 *errorString = "Script execution is prohibited"; |
| 85 return; |
| 86 } |
| 87 InspectorDebuggerAgent::enable(errorString); |
| 88 } |
| 89 |
| 75 void PageDebuggerAgent::enable() | 90 void PageDebuggerAgent::enable() |
| 76 { | 91 { |
| 92 ASSERT(canExecuteScripts()); |
| 77 InspectorDebuggerAgent::enable(); | 93 InspectorDebuggerAgent::enable(); |
| 78 m_instrumentingAgents->setPageDebuggerAgent(this); | 94 m_instrumentingAgents->setPageDebuggerAgent(this); |
| 79 } | 95 } |
| 80 | 96 |
| 81 void PageDebuggerAgent::disable() | 97 void PageDebuggerAgent::disable() |
| 82 { | 98 { |
| 83 InspectorDebuggerAgent::disable(); | 99 InspectorDebuggerAgent::disable(); |
| 84 m_instrumentingAgents->setPageDebuggerAgent(0); | 100 m_instrumentingAgents->setPageDebuggerAgent(0); |
| 85 } | 101 } |
| 86 | 102 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 return; | 167 return; |
| 152 reset(); | 168 reset(); |
| 153 } | 169 } |
| 154 | 170 |
| 155 void PageDebuggerAgent::didCommitLoadForLocalFrame(LocalFrame*) | 171 void PageDebuggerAgent::didCommitLoadForLocalFrame(LocalFrame*) |
| 156 { | 172 { |
| 157 resetModifiedSources(); | 173 resetModifiedSources(); |
| 158 } | 174 } |
| 159 | 175 |
| 160 } // namespace blink | 176 } // namespace blink |
| OLD | NEW |