summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 14:39:32 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 14:39:32 +0000
commit4b16cc08cff942a5bccf9ac93626816b3142269c (patch)
treefc078cfb7263638b95c1711e03f63d673da17c26 /chrome
parentd139ddddddd5e232ebf8fc50dc7881a11b330b03 (diff)
downloadchromium_src-4b16cc08cff942a5bccf9ac93626816b3142269c.zip
chromium_src-4b16cc08cff942a5bccf9ac93626816b3142269c.tar.gz
chromium_src-4b16cc08cff942a5bccf9ac93626816b3142269c.tar.bz2
DevTools: Cache resource metainfo even when debugger agent is not attached.
- Cache 200 resources - Hide agent functionality behind the flag Review URL: http://codereview.chromium.org/62183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--chrome/renderer/devtools_agent.cc1
-rw-r--r--chrome/renderer/render_view.cc20
3 files changed, 15 insertions, 7 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 2082c0c..141bf3e 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -270,6 +270,7 @@ bool BrowserRenderProcessHost::Init() {
switches::kEnableWebWorkers,
switches::kEnableStatsTable,
switches::kEnableExtensions,
+ switches::kEnableOutOfProcessDevTools,
};
for (size_t i = 0; i < arraysize(switch_names); ++i) {
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc
index 633203c..046b755 100644
--- a/chrome/renderer/devtools_agent.cc
+++ b/chrome/renderer/devtools_agent.cc
@@ -61,6 +61,7 @@ void DevToolsAgent::OnRpcMessage(const std::string& raw_msg) {
void DevToolsAgent::OnInspectElement(int x, int y) {
WebDevToolsAgent* web_agent = GetWebAgent();
if (web_agent) {
+ web_agent->Attach();
web_agent->InspectElement(x, y);
}
}
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index b4fc6d5..9cef455 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -299,13 +299,19 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd,
decrement_shared_popup_at_destruction_ = false;
}
- devtools_agent_.reset(new DevToolsAgent(routing_id, this));
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ bool dev_tools_enabled = command_line.HasSwitch(
+ switches::kEnableOutOfProcessDevTools);
+ if (dev_tools_enabled)
+ devtools_agent_.reset(new DevToolsAgent(routing_id, this));
webwidget_ = WebView::Create(this, webkit_prefs);
- devtools_agent_filter_ = new DevToolsAgentFilter(
- webview()->GetWebDevToolsAgent(),
- routing_id);
+ if (dev_tools_enabled)
+ devtools_agent_filter_ = new DevToolsAgentFilter(
+ webview()->GetWebDevToolsAgent(),
+ routing_id);
#if defined(OS_LINUX)
// We have to enable ourselves as the editor delegate on linux so we can copy
@@ -334,7 +340,6 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd,
host_window_ = parent_hwnd;
modal_dialog_event_.reset(modal_dialog_event);
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDomAutomationController))
enabled_bindings_ |= BindingsPolicy::DOM_AUTOMATION;
disable_popup_blocking_ =
@@ -342,7 +347,8 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd,
debug_message_handler_ = new DebugMessageHandler(this);
render_thread_->AddFilter(debug_message_handler_);
- render_thread_->AddFilter(devtools_agent_filter_);
+ if (dev_tools_enabled)
+ render_thread_->AddFilter(devtools_agent_filter_);
}
void RenderView::OnMessageReceived(const IPC::Message& message) {
@@ -353,7 +359,7 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
// If this is developer tools renderer intercept tools messages first.
if (devtools_client_.get() && devtools_client_->OnMessageReceived(message))
return;
- if (devtools_agent_->OnMessageReceived(message))
+ if (devtools_agent_.get() && devtools_agent_->OnMessageReceived(message))
return;
IPC_BEGIN_MESSAGE_MAP(RenderView, message)