Chromium Code Reviews| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 #endif | 93 #endif |
| 94 ScriptDebugServer::trace(visitor); | 94 ScriptDebugServer::trace(visitor); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void PageScriptDebugServer::setContextDebugData(v8::Local<v8::Context> context, const String& type, int contextDebugId) | 97 void PageScriptDebugServer::setContextDebugData(v8::Local<v8::Context> context, const String& type, int contextDebugId) |
| 98 { | 98 { |
| 99 String debugData = "[" + type + "," + String::number(contextDebugId) + "]"; | 99 String debugData = "[" + type + "," + String::number(contextDebugId) + "]"; |
| 100 ScriptDebugServer::setContextDebugData(context, debugData); | 100 ScriptDebugServer::setContextDebugData(context, debugData); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void PageScriptDebugServer::addListener(ScriptDebugListener* listener, LocalFram e* localFrameRoot, int contextDebugId) | 103 bool PageScriptDebugServer::addListener(ScriptDebugListener* listener, LocalFram e* localFrameRoot, int contextDebugId) |
| 104 { | 104 { |
| 105 ASSERT(localFrameRoot == localFrameRoot->localFrameRoot()); | 105 ASSERT(localFrameRoot == localFrameRoot->localFrameRoot()); |
| 106 | 106 |
| 107 ScriptController& scriptController = localFrameRoot->script(); | 107 ScriptController& scriptController = localFrameRoot->script(); |
| 108 if (!scriptController.canExecuteScripts(NotAboutToExecuteScript)) | 108 if (!scriptController.canExecuteScripts(NotAboutToExecuteScript)) |
|
sergeyv
2015/05/08 13:11:42
Lets make this check earlier - in the enable metho
yurys
2015/05/08 13:21:14
Done.
| |
| 109 return; | 109 return false; |
| 110 | 110 |
| 111 if (m_listenersMap.isEmpty()) | 111 if (m_listenersMap.isEmpty()) |
| 112 enable(); | 112 enable(); |
| 113 m_listenersMap.set(localFrameRoot, listener); | 113 m_listenersMap.set(localFrameRoot, listener); |
| 114 String contextDataSubstring = "," + String::number(contextDebugId) + "]"; | 114 String contextDataSubstring = "," + String::number(contextDebugId) + "]"; |
| 115 reportCompiledScripts(contextDataSubstring, listener); | 115 reportCompiledScripts(contextDataSubstring, listener); |
| 116 return true; | |
| 116 } | 117 } |
| 117 | 118 |
| 118 void PageScriptDebugServer::removeListener(ScriptDebugListener* listener, LocalF rame* localFrame) | 119 void PageScriptDebugServer::removeListener(ScriptDebugListener* listener, LocalF rame* localFrame) |
| 119 { | 120 { |
| 120 if (!m_listenersMap.contains(localFrame)) | 121 if (!m_listenersMap.contains(localFrame)) |
| 121 return; | 122 return; |
| 122 | 123 |
| 123 if (m_pausedFrame == localFrame) | 124 if (m_pausedFrame == localFrame) |
| 124 continueProgram(); | 125 continueProgram(); |
| 125 | 126 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 | 201 |
| 201 m_pausedFrame = 0; | 202 m_pausedFrame = 0; |
| 202 } | 203 } |
| 203 | 204 |
| 204 void PageScriptDebugServer::quitMessageLoopOnPause() | 205 void PageScriptDebugServer::quitMessageLoopOnPause() |
| 205 { | 206 { |
| 206 m_clientMessageLoop->quitNow(); | 207 m_clientMessageLoop->quitNow(); |
| 207 } | 208 } |
| 208 | 209 |
| 209 } // namespace blink | 210 } // namespace blink |
| OLD | NEW |