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

Side by Side Diff: Source/WebCore/bindings/v8/PageScriptDebugServer.cpp

Issue 9340005: Merge 106846 - Before accessing a frame's script controller in V8 bindings, first check that the ... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | Source/WebCore/bindings/v8/ScheduledAction.cpp » ('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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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)
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/bindings/v8/ScheduledAction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698