| 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/ui/webui/workers_ui.h" | 5 #include "chrome/browser/ui/webui/workers_ui.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/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 | 46 |
| 47 DictionaryValue* BuildWorkerData( | 47 DictionaryValue* BuildWorkerData( |
| 48 WorkerProcessHost* process, | 48 WorkerProcessHost* process, |
| 49 const WorkerProcessHost::WorkerInstance& instance) { | 49 const WorkerProcessHost::WorkerInstance& instance) { |
| 50 DictionaryValue* worker_data = new DictionaryValue(); | 50 DictionaryValue* worker_data = new DictionaryValue(); |
| 51 worker_data->SetInteger(kWorkerProcessHostIdField, process->id()); | 51 worker_data->SetInteger(kWorkerProcessHostIdField, process->id()); |
| 52 worker_data->SetInteger(kWorkerRouteIdField, instance.worker_route_id()); | 52 worker_data->SetInteger(kWorkerRouteIdField, instance.worker_route_id()); |
| 53 worker_data->SetString(kUrlField, instance.url().spec()); | 53 worker_data->SetString(kUrlField, instance.url().spec()); |
| 54 worker_data->SetString(kNameField, instance.name()); | 54 worker_data->SetString(kNameField, instance.name()); |
| 55 worker_data->SetInteger(kPidField, process->pid()); | 55 worker_data->SetInteger(kPidField, base::GetProcId(process->handle())); |
| 56 return worker_data; | 56 return worker_data; |
| 57 } | 57 } |
| 58 | 58 |
| 59 class WorkersUIHTMLSource : public ChromeWebUIDataSource { | 59 class WorkersUIHTMLSource : public ChromeWebUIDataSource { |
| 60 public: | 60 public: |
| 61 WorkersUIHTMLSource(); | 61 WorkersUIHTMLSource(); |
| 62 | 62 |
| 63 virtual void StartDataRequest(const std::string& path, | 63 virtual void StartDataRequest(const std::string& path, |
| 64 bool is_incognito, | 64 bool is_incognito, |
| 65 int request_id); | 65 int request_id); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 // Set up the chrome://workers/ source. | 258 // Set up the chrome://workers/ source. |
| 259 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | 259 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
| 260 profile->GetChromeURLDataManager()->AddDataSource(html_source); | 260 profile->GetChromeURLDataManager()->AddDataSource(html_source); |
| 261 } | 261 } |
| 262 | 262 |
| 263 WorkersUI::~WorkersUI() { | 263 WorkersUI::~WorkersUI() { |
| 264 observer_->WorkersUIDestroyed(); | 264 observer_->WorkersUIDestroyed(); |
| 265 observer_ = NULL; | 265 observer_ = NULL; |
| 266 } | 266 } |
| OLD | NEW |