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

Side by Side Diff: WebCore/bindings/v8/ScriptDebugServer.cpp

Issue 5664002: Merge 73441 - 2010-12-07 Yury Semikhatsky <yurys@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years 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 | no next file » | 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext(); 106 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
107 v8::Context::Scope contextScope(debuggerContext); 107 v8::Context::Scope contextScope(debuggerContext);
108 108
109 if (!m_listenersMap.size()) { 109 if (!m_listenersMap.size()) {
110 ensureDebuggerScriptCompiled(); 110 ensureDebuggerScriptCompiled();
111 ASSERT(!m_debuggerScript.get()->IsUndefined()); 111 ASSERT(!m_debuggerScript.get()->IsUndefined());
112 v8::Debug::SetDebugEventListener2(&ScriptDebugServer::v8DebugEventCallba ck); 112 v8::Debug::SetDebugEventListener2(&ScriptDebugServer::v8DebugEventCallba ck);
113 } 113 }
114 m_listenersMap.set(page, listener); 114 m_listenersMap.set(page, listener);
115 115
116 v8::Local<v8::Context> context = proxy->mainWorldContext(); 116 V8DOMWindowShell* shell = proxy->windowShell();
117 117 if (!shell->isContextInitialized())
118 return;
119 v8::Handle<v8::Context> context = shell->context();
118 v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast( m_debuggerScript.get()->Get(v8::String::New("getScripts"))); 120 v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast( m_debuggerScript.get()->Get(v8::String::New("getScripts")));
119 v8::Handle<v8::Value> argv[] = { context->GetData() }; 121 v8::Handle<v8::Value> argv[] = { context->GetData() };
120 v8::Handle<v8::Value> value = getScriptsFunction->Call(m_debuggerScript.get( ), 1, argv); 122 v8::Handle<v8::Value> value = getScriptsFunction->Call(m_debuggerScript.get( ), 1, argv);
121 if (value.IsEmpty()) 123 if (value.IsEmpty())
122 return; 124 return;
123 ASSERT(!value->IsUndefined() && value->IsArray()); 125 ASSERT(!value->IsUndefined() && value->IsArray());
124 v8::Handle<v8::Array> scriptsArray = v8::Handle<v8::Array>::Cast(value); 126 v8::Handle<v8::Array> scriptsArray = v8::Handle<v8::Array>::Cast(value);
125 for (unsigned i = 0; i < scriptsArray->Length(); ++i) 127 for (unsigned i = 0; i < scriptsArray->Length(); ++i)
126 dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArr ay->Get(v8::Integer::New(i)))); 128 dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArr ay->Get(v8::Integer::New(i))));
127 } 129 }
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 void ScriptDebugServer::didResume() 465 void ScriptDebugServer::didResume()
464 { 466 {
465 m_currentCallFrame.clear(); 467 m_currentCallFrame.clear();
466 m_executionState.clear(); 468 m_executionState.clear();
467 m_pausedPage = 0; 469 m_pausedPage = 0;
468 } 470 }
469 471
470 } // namespace WebCore 472 } // namespace WebCore
471 473
472 #endif // ENABLE(JAVASCRIPT_DEBUGGER) 474 #endif // ENABLE(JAVASCRIPT_DEBUGGER)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698