| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/task_manager/task_manager_worker_resource_provider.h" | 5 #include "chrome/browser/task_manager/task_manager_worker_resource_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/debugger/devtools_window.h" | 12 #include "chrome/browser/debugger/devtools_window.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "content/browser/browser_child_process_host.h" | 14 #include "content/browser/browser_child_process_host.h" |
| 15 #include "content/browser/worker_host/worker_process_host.h" | 15 #include "content/browser/worker_host/worker_process_host.h" |
| 16 #include "content/browser/worker_host/worker_service.h" | |
| 17 #include "content/browser/worker_host/worker_service_observer.h" | |
| 18 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/browser/child_process_data.h" | 17 #include "content/public/browser/child_process_data.h" |
| 20 #include "content/public/browser/devtools_agent_host_registry.h" | 18 #include "content/public/browser/devtools_agent_host_registry.h" |
| 21 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
| 22 #include "content/public/browser/notification_types.h" | 20 #include "content/public/browser/notification_types.h" |
| 21 #include "content/public/browser/worker_service.h" |
| 23 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 24 #include "grit/theme_resources_standard.h" | 23 #include "grit/theme_resources_standard.h" |
| 25 #include "third_party/skia/include/core/SkBitmap.h" | 24 #include "third_party/skia/include/core/SkBitmap.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
| 28 | 27 |
| 29 using content::BrowserThread; | 28 using content::BrowserThread; |
| 30 using content::DevToolsAgentHost; | 29 using content::DevToolsAgentHost; |
| 31 using content::DevToolsAgentHostRegistry; | 30 using content::DevToolsAgentHostRegistry; |
| 31 using content::WorkerService; |
| 32 | 32 |
| 33 // Objects of this class are created on the IO thread and then passed to the UI | 33 // Objects of this class are created on the IO thread and then passed to the UI |
| 34 // thread where they are passed to the task manager. All methods must be called | 34 // thread where they are passed to the task manager. All methods must be called |
| 35 // only on the UI thread. Destructor may be called on any thread. | 35 // only on the UI thread. Destructor may be called on any thread. |
| 36 class TaskManagerSharedWorkerResource : public TaskManager::Resource { | 36 class TaskManagerSharedWorkerResource : public TaskManager::Resource { |
| 37 public: | 37 public: |
| 38 TaskManagerSharedWorkerResource(const content::ChildProcessData& process_data, | 38 TaskManagerSharedWorkerResource(const content::ChildProcessData& process_data, |
| 39 int routing_id, const GURL& url, | 39 int routing_id, const GURL& url, |
| 40 const string16& name); | 40 const string16& name); |
| 41 virtual ~TaskManagerSharedWorkerResource(); | 41 virtual ~TaskManagerSharedWorkerResource(); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 int process_id = resource->process_data().id; | 349 int process_id = resource->process_data().id; |
| 350 launching_workers_[process_id].push_back(resource); | 350 launching_workers_[process_id].push_back(resource); |
| 351 } else { | 351 } else { |
| 352 task_manager_->AddResource(resource); | 352 task_manager_->AddResource(resource); |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 | 355 |
| 356 void TaskManagerWorkerResourceProvider::DeleteAllResources() { | 356 void TaskManagerWorkerResourceProvider::DeleteAllResources() { |
| 357 STLDeleteElements(&resources_); | 357 STLDeleteElements(&resources_); |
| 358 } | 358 } |
| OLD | NEW |