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

Side by Side Diff: webkit/glue/devtools/debugger_agent_impl.cc

Issue 467043: Revert 34040 - DevTools: make possible profiling of scripts doing heavy calcu... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/devtools/debugger_agent_impl.h ('k') | webkit/glue/devtools/js/debugger_agent.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include <wtf/HashSet.h> 7 #include <wtf/HashSet.h>
8 #include <wtf/RefPtr.h> 8 #include <wtf/RefPtr.h>
9 #include <wtf/Vector.h> 9 #include <wtf/Vector.h>
10 10
(...skipping 26 matching lines...) Expand all
37 using WebCore::V8Proxy; 37 using WebCore::V8Proxy;
38 using WebKit::WebViewImpl; 38 using WebKit::WebViewImpl;
39 39
40 DebuggerAgentImpl::DebuggerAgentImpl( 40 DebuggerAgentImpl::DebuggerAgentImpl(
41 WebViewImpl* web_view_impl, 41 WebViewImpl* web_view_impl,
42 DebuggerAgentDelegate* delegate, 42 DebuggerAgentDelegate* delegate,
43 WebDevToolsAgentImpl* webdevtools_agent) 43 WebDevToolsAgentImpl* webdevtools_agent)
44 : web_view_impl_(web_view_impl), 44 : web_view_impl_(web_view_impl),
45 delegate_(delegate), 45 delegate_(delegate),
46 webdevtools_agent_(webdevtools_agent), 46 webdevtools_agent_(webdevtools_agent),
47 profiler_log_position_(0),
47 auto_continue_on_exception_(false) { 48 auto_continue_on_exception_(false) {
48 DebuggerAgentManager::DebugAttach(this); 49 DebuggerAgentManager::DebugAttach(this);
49 } 50 }
50 51
51 DebuggerAgentImpl::~DebuggerAgentImpl() { 52 DebuggerAgentImpl::~DebuggerAgentImpl() {
52 DebuggerAgentManager::DebugDetach(this); 53 DebuggerAgentManager::DebugDetach(this);
53 } 54 }
54 55
55 void DebuggerAgentImpl::GetContextId() { 56 void DebuggerAgentImpl::GetContextId() {
56 delegate_->SetContextId(webdevtools_agent_->host_id()); 57 delegate_->SetContextId(webdevtools_agent_->host_id());
57 } 58 }
58 59
60 void DebuggerAgentImpl::StartProfiling(int flags) {
61 v8::HandleScope scope;
62 WebCore::Frame* frame = GetPage()->mainFrame();
63 ASSERT(V8Proxy::retrieve(GetPage()->mainFrame())->isContextInitialized());
64 v8::Context::Scope context_scope(V8Proxy::context(frame));
65 v8::V8::ResumeProfilerEx(flags);
66 }
67
68 void DebuggerAgentImpl::StopProfiling(int flags) {
69 v8::V8::PauseProfilerEx(flags);
70 }
71
72 void DebuggerAgentImpl::GetActiveProfilerModules() {
73 delegate_->DidGetActiveProfilerModules(v8::V8::GetActiveProfilerModules());
74 }
75
76 void DebuggerAgentImpl::GetNextLogLines() {
77 static char buffer[65536];
78 int read_size = v8::V8::GetLogLines(
79 profiler_log_position_, buffer, sizeof(buffer) - 1);
80 profiler_log_position_ += read_size;
81 buffer[read_size] = '\0';
82 delegate_->DidGetNextLogLines(buffer);
83 }
84
59 void DebuggerAgentImpl::DebuggerOutput(const String& command) { 85 void DebuggerAgentImpl::DebuggerOutput(const String& command) {
60 delegate_->DebuggerOutput(command); 86 delegate_->DebuggerOutput(command);
61 webdevtools_agent_->ForceRepaint(); 87 webdevtools_agent_->ForceRepaint();
62 } 88 }
63 89
64 // static 90 // static
65 void DebuggerAgentImpl::CreateUtilityContext( 91 void DebuggerAgentImpl::CreateUtilityContext(
66 Frame* frame, 92 Frame* frame,
67 v8::Persistent<v8::Context>* context) { 93 v8::Persistent<v8::Context>* context) {
68 v8::HandleScope scope; 94 v8::HandleScope scope;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 ASSERT(function->IsFunction()); 200 ASSERT(function->IsFunction());
175 v8::Handle<v8::Value> args[] = { 201 v8::Handle<v8::Value> args[] = {
176 v8::Local<v8::Value>() 202 v8::Local<v8::Value>()
177 }; 203 };
178 v8::Handle<v8::Function>::Cast(function)->Call(context->Global(), 0, args); 204 v8::Handle<v8::Function>::Cast(function)->Call(context->Global(), 0, args);
179 } 205 }
180 206
181 WebCore::Page* DebuggerAgentImpl::GetPage() { 207 WebCore::Page* DebuggerAgentImpl::GetPage() {
182 return web_view_impl_->page(); 208 return web_view_impl_->page();
183 } 209 }
OLDNEW
« no previous file with comments | « webkit/glue/devtools/debugger_agent_impl.h ('k') | webkit/glue/devtools/js/debugger_agent.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698