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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 PageScriptDebugServer::PageScriptDebugServer() | 71 PageScriptDebugServer::PageScriptDebugServer() |
72 : ScriptDebugServer() | 72 : ScriptDebugServer() |
73 , m_pausedPage(0) | 73 , m_pausedPage(0) |
74 { | 74 { |
75 } | 75 } |
76 | 76 |
77 void PageScriptDebugServer::addListener(ScriptDebugListener* listener, Page* pag
e) | 77 void PageScriptDebugServer::addListener(ScriptDebugListener* listener, Page* pag
e) |
78 { | 78 { |
| 79 V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame()); |
| 80 if (!proxy) |
| 81 return; |
79 ScriptController* scriptController = page->mainFrame()->script(); | 82 ScriptController* scriptController = page->mainFrame()->script(); |
80 if (!scriptController->canExecuteScripts(NotAboutToExecuteScript)) | 83 if (!scriptController->canExecuteScripts(NotAboutToExecuteScript)) |
81 return; | 84 return; |
82 V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame()); | |
83 | 85 |
84 v8::HandleScope scope; | 86 v8::HandleScope scope; |
85 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext(); | 87 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext(); |
86 v8::Context::Scope contextScope(debuggerContext); | 88 v8::Context::Scope contextScope(debuggerContext); |
87 | 89 |
88 if (!m_listenersMap.size()) { | 90 if (!m_listenersMap.size()) { |
89 ensureDebuggerScriptCompiled(); | 91 ensureDebuggerScriptCompiled(); |
90 ASSERT(!m_debuggerScript.get()->IsUndefined()); | 92 ASSERT(!m_debuggerScript.get()->IsUndefined()); |
91 v8::Debug::SetDebugEventListener2(&PageScriptDebugServer::v8DebugEventCa
llback, v8::External::New(this)); | 93 v8::Debug::SetDebugEventListener2(&PageScriptDebugServer::v8DebugEventCa
llback, v8::External::New(this)); |
92 } | 94 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 155 } |
154 | 156 |
155 void PageScriptDebugServer::quitMessageLoopOnPause() | 157 void PageScriptDebugServer::quitMessageLoopOnPause() |
156 { | 158 { |
157 m_clientMessageLoop->quitNow(); | 159 m_clientMessageLoop->quitNow(); |
158 } | 160 } |
159 | 161 |
160 } // namespace WebCore | 162 } // namespace WebCore |
161 | 163 |
162 #endif // ENABLE(JAVASCRIPT_DEBUGGER) | 164 #endif // ENABLE(JAVASCRIPT_DEBUGGER) |
OLD | NEW |