summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools/debugger_agent_impl.cc
diff options
context:
space:
mode:
authormnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 09:13:29 +0000
committermnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 09:13:29 +0000
commit45f32d9f9d48f4897418d0db85c3814f869a39eb (patch)
tree50ff2e0db364fac3cf1bbdf3257346eb559257ed /webkit/glue/devtools/debugger_agent_impl.cc
parentf93914857eb403a7aecf9154d14efae2703077e9 (diff)
downloadchromium_src-45f32d9f9d48f4897418d0db85c3814f869a39eb.zip
chromium_src-45f32d9f9d48f4897418d0db85c3814f869a39eb.tar.gz
chromium_src-45f32d9f9d48f4897418d0db85c3814f869a39eb.tar.bz2
Sync with the profiler changes in V8.
- Use context prior to calling 'ResumeProfiler'. - Check the status of the profiler using 'IsProfilerPaused'. Review URL: http://codereview.chromium.org/115767 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools/debugger_agent_impl.cc')
-rw-r--r--webkit/glue/devtools/debugger_agent_impl.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/webkit/glue/devtools/debugger_agent_impl.cc b/webkit/glue/devtools/debugger_agent_impl.cc
index 3d18bb5..eb38ab6 100644
--- a/webkit/glue/devtools/debugger_agent_impl.cc
+++ b/webkit/glue/devtools/debugger_agent_impl.cc
@@ -59,6 +59,10 @@ void DebuggerAgentImpl::GetContextId() {
}
void DebuggerAgentImpl::StartProfiling() {
+ v8::HandleScope scope;
+ WebCore::V8Proxy* proxy = V8Proxy::retrieve(GetPage()->mainFrame());
+ DCHECK(proxy && proxy->ContextInitialized());
+ v8::Context::Scope context_scope(proxy->GetContext());
v8::V8::ResumeProfiler();
}
@@ -66,11 +70,15 @@ void DebuggerAgentImpl::StopProfiling() {
v8::V8::PauseProfiler();
}
+void DebuggerAgentImpl::IsProfilingStarted() {
+ delegate_->DidIsProfilingStarted(!v8::V8::IsProfilerPaused());
+}
+
void DebuggerAgentImpl::GetLogLines(int position) {
static char buffer[65536];
int read_size = v8::V8::GetLogLines(position, buffer, sizeof(buffer) - 1);
buffer[read_size] = '\0';
- DidGetLogLines(buffer, position + read_size);
+ delegate_->DidGetLogLines(buffer, position + read_size);
}
void DebuggerAgentImpl::DebuggerOutput(const std::string& command) {
@@ -78,11 +86,6 @@ void DebuggerAgentImpl::DebuggerOutput(const std::string& command) {
webdevtools_agent_->ForceRepaint();
}
-void DebuggerAgentImpl::DidGetLogLines(
- const std::string& log, int new_position) {
- delegate_->DidGetLogLines(log, new_position);
-}
-
// static
void DebuggerAgentImpl::ResetUtilityContext(
Document* document,