summaryrefslogtreecommitdiffstats
path: root/chrome/browser/task_manager
diff options
context:
space:
mode:
authoryurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-02 13:02:34 +0000
committeryurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-02 13:02:34 +0000
commit7293e834b2a590e0eb4205045b2e270997dd1e6b (patch)
tree5cfd15e1670e33d8b069fc1ce264010b2a2a76da /chrome/browser/task_manager
parent719ad1ed3bb16cbab26e5ddf35436811a9ce96cf (diff)
downloadchromium_src-7293e834b2a590e0eb4205045b2e270997dd1e6b.zip
chromium_src-7293e834b2a590e0eb4205045b2e270997dd1e6b.tar.gz
chromium_src-7293e834b2a590e0eb4205045b2e270997dd1e6b.tar.bz2
Implement inspect action for workers in Task Manager
BUG=None TEST=None Review URL: http://codereview.chromium.org/8423040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager')
-rw-r--r--chrome/browser/task_manager/task_manager_worker_resource_provider.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/task_manager/task_manager_worker_resource_provider.cc b/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
index d37e1be..24d8d37 100644
--- a/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
+++ b/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
@@ -10,7 +10,9 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/debugger/devtools_window.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "content/browser/browser_child_process_host.h"
+#include "content/browser/debugger/worker_devtools_manager.h"
#include "content/browser/worker_host/worker_process_host.h"
#include "content/browser/worker_host/worker_service.h"
#include "content/browser/worker_host/worker_service_observer.h"
@@ -46,6 +48,8 @@ class TaskManagerSharedWorkerResource : public TaskManager::Resource {
virtual SkBitmap GetIcon() const OVERRIDE;
virtual base::ProcessHandle GetProcess() const OVERRIDE;
virtual Type GetType() const OVERRIDE;
+ virtual bool CanInspect() const OVERRIDE;
+ virtual void Inspect() const OVERRIDE;
virtual bool SupportNetworkUsage() const OVERRIDE;
virtual void SetSupportNetworkUsage() OVERRIDE;
@@ -111,6 +115,23 @@ TaskManager::Resource::Type TaskManagerSharedWorkerResource::GetType() const {
return WORKER;
}
+bool TaskManagerSharedWorkerResource::CanInspect() const {
+ return true;
+}
+
+void TaskManagerSharedWorkerResource::Inspect() const {
+ // TODO(yurys): would be better to get profile from one of the tabs connected
+ // to the worker.
+ Profile* profile = ProfileManager::GetLastUsedProfile();
+ if (!profile)
+ return;
+ DevToolsAgentHost* agent_host =
+ WorkerDevToolsManager::GetDevToolsAgentHostForWorker(
+ process_info_.id(),
+ routing_id_);
+ DevToolsWindow::OpenDevToolsWindowForWorker(profile, agent_host);
+}
+
bool TaskManagerSharedWorkerResource::SupportNetworkUsage() const {
return false;
}