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

Side by Side Diff: webkit/glue/webdevtoolsfrontend_impl.cc

Issue 460018: DevTools: make possible profiling of scripts doing heavy calculations. (Closed)
Patch Set: Comments addressed 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
« no previous file with comments | « webkit/glue/webdevtoolsfrontend_impl.h ('k') | webkit/webkit.gyp » ('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 <string> 7 #include <string>
8 8
9 #include "Document.h" 9 #include "Document.h"
10 #include "DOMWindow.h" 10 #include "DOMWindow.h"
(...skipping 15 matching lines...) Expand all
26 #undef LOG 26 #undef LOG
27 27
28 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsFrontendClient.h" 28 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsFrontendClient.h"
29 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" 29 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
30 #include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h" 30 #include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h"
31 #include "third_party/WebKit/WebKit/chromium/src/WebFrameImpl.h" 31 #include "third_party/WebKit/WebKit/chromium/src/WebFrameImpl.h"
32 #include "third_party/WebKit/WebKit/chromium/src/WebViewImpl.h" 32 #include "third_party/WebKit/WebKit/chromium/src/WebViewImpl.h"
33 #include "webkit/glue/devtools/bound_object.h" 33 #include "webkit/glue/devtools/bound_object.h"
34 #include "webkit/glue/devtools/debugger_agent.h" 34 #include "webkit/glue/devtools/debugger_agent.h"
35 #include "webkit/glue/devtools/devtools_rpc_js.h" 35 #include "webkit/glue/devtools/devtools_rpc_js.h"
36 #include "webkit/glue/devtools/profiler_agent.h"
36 #include "webkit/glue/devtools/tools_agent.h" 37 #include "webkit/glue/devtools/tools_agent.h"
37 #include "webkit/glue/glue_util.h" 38 #include "webkit/glue/glue_util.h"
38 #include "webkit/glue/webdevtoolsfrontend_impl.h" 39 #include "webkit/glue/webdevtoolsfrontend_impl.h"
39 40
40 using namespace WebCore; 41 using namespace WebCore;
41 using WebKit::WebDevToolsFrontend; 42 using WebKit::WebDevToolsFrontend;
42 using WebKit::WebDevToolsFrontendClient; 43 using WebKit::WebDevToolsFrontendClient;
43 using WebKit::WebFrame; 44 using WebKit::WebFrame;
44 using WebKit::WebFrameImpl; 45 using WebKit::WebFrameImpl;
45 using WebKit::WebScriptSource; 46 using WebKit::WebScriptSource;
46 using WebKit::WebString; 47 using WebKit::WebString;
47 using WebKit::WebView; 48 using WebKit::WebView;
48 using WebKit::WebViewImpl; 49 using WebKit::WebViewImpl;
49 50
50 static v8::Local<v8::String> ToV8String(const String& s) { 51 static v8::Local<v8::String> ToV8String(const String& s) {
51 if (s.isNull()) 52 if (s.isNull())
52 return v8::Local<v8::String>(); 53 return v8::Local<v8::String>();
53 54
54 return v8::String::New(reinterpret_cast<const uint16_t*>(s.characters()), 55 return v8::String::New(reinterpret_cast<const uint16_t*>(s.characters()),
55 s.length()); 56 s.length());
56 } 57 }
57 58
58 DEFINE_RPC_JS_BOUND_OBJ(DebuggerAgent, DEBUGGER_AGENT_STRUCT, 59 DEFINE_RPC_JS_BOUND_OBJ(DebuggerAgent, DEBUGGER_AGENT_STRUCT,
59 DebuggerAgentDelegate, DEBUGGER_AGENT_DELEGATE_STRUCT) 60 DebuggerAgentDelegate, DEBUGGER_AGENT_DELEGATE_STRUCT)
61 DEFINE_RPC_JS_BOUND_OBJ(ProfilerAgent, PROFILER_AGENT_STRUCT,
62 ProfilerAgentDelegate, PROFILER_AGENT_DELEGATE_STRUCT)
60 DEFINE_RPC_JS_BOUND_OBJ(ToolsAgent, TOOLS_AGENT_STRUCT, 63 DEFINE_RPC_JS_BOUND_OBJ(ToolsAgent, TOOLS_AGENT_STRUCT,
61 ToolsAgentDelegate, TOOLS_AGENT_DELEGATE_STRUCT) 64 ToolsAgentDelegate, TOOLS_AGENT_DELEGATE_STRUCT)
62 65
63 class ToolsAgentNativeDelegateImpl : public ToolsAgentNativeDelegate { 66 class ToolsAgentNativeDelegateImpl : public ToolsAgentNativeDelegate {
64 public: 67 public:
65 struct ResourceContentRequestData { 68 struct ResourceContentRequestData {
66 String mime_type; 69 String mime_type;
67 RefPtr<Node> frame; 70 RefPtr<Node> frame;
68 }; 71 };
69 72
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 : web_view_impl_(web_view_impl), 130 : web_view_impl_(web_view_impl),
128 client_(client), 131 client_(client),
129 application_locale_(application_locale), 132 application_locale_(application_locale),
130 loaded_(false) { 133 loaded_(false) {
131 WebFrameImpl* frame = web_view_impl_->mainFrameImpl(); 134 WebFrameImpl* frame = web_view_impl_->mainFrameImpl();
132 v8::HandleScope scope; 135 v8::HandleScope scope;
133 v8::Handle<v8::Context> frame_context = V8Proxy::context(frame->frame()); 136 v8::Handle<v8::Context> frame_context = V8Proxy::context(frame->frame());
134 137
135 debugger_agent_obj_.set(new JsDebuggerAgentBoundObj( 138 debugger_agent_obj_.set(new JsDebuggerAgentBoundObj(
136 this, frame_context, "RemoteDebuggerAgent")); 139 this, frame_context, "RemoteDebuggerAgent"));
140 profiler_agent_obj_.set(new JsProfilerAgentBoundObj(
141 this, frame_context, "RemoteProfilerAgent"));
137 tools_agent_obj_.set( 142 tools_agent_obj_.set(
138 new JsToolsAgentBoundObj(this, frame_context, "RemoteToolsAgent")); 143 new JsToolsAgentBoundObj(this, frame_context, "RemoteToolsAgent"));
139 144
140 // Debugger commands should be sent using special method. 145 // Debugger commands should be sent using special method.
141 debugger_command_executor_obj_.set( 146 debugger_command_executor_obj_.set(
142 new BoundObject(frame_context, this, "RemoteDebuggerCommandExecutor")); 147 new BoundObject(frame_context, this, "RemoteDebuggerCommandExecutor"));
143 debugger_command_executor_obj_->AddProtoFunction( 148 debugger_command_executor_obj_->AddProtoFunction(
144 "DebuggerCommand", 149 "DebuggerCommand",
145 WebDevToolsFrontendImpl::JsDebuggerCommand); 150 WebDevToolsFrontendImpl::JsDebuggerCommand);
146 debugger_command_executor_obj_->AddProtoFunction( 151 debugger_command_executor_obj_->AddProtoFunction(
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 frontend->client_->sendDebuggerPauseScript(); 459 frontend->client_->sendDebuggerPauseScript();
455 return v8::Undefined(); 460 return v8::Undefined();
456 } 461 }
457 462
458 // static 463 // static
459 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsWindowUnloading( 464 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsWindowUnloading(
460 const v8::Arguments& args) { 465 const v8::Arguments& args) {
461 //TODO(pfeldman): Implement this. 466 //TODO(pfeldman): Implement this.
462 return v8::Undefined(); 467 return v8::Undefined();
463 } 468 }
OLDNEW
« no previous file with comments | « webkit/glue/webdevtoolsfrontend_impl.h ('k') | webkit/webkit.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698