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

Side by Side Diff: chrome/browser/ui/webui/workers_ui.cc

Issue 9052007: Create an API around WorkerService that chrome consumes. Rename the existing WorkerService to Wor... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months 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 | Annotate | Revision Log
OLDNEW
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"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/debugger/devtools_window.h" 14 #include "chrome/browser/debugger/devtools_window.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" 16 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h"
17 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 17 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
18 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
19 #include "content/public/browser/devtools_agent_host_registry.h" 19 #include "content/public/browser/devtools_agent_host_registry.h"
20 #include "content/browser/tab_contents/tab_contents.h" 20 #include "content/browser/tab_contents/tab_contents.h"
21 #include "content/browser/worker_host/worker_process_host.h" 21 #include "content/browser/worker_host/worker_process_host.h"
22 #include "content/browser/worker_host/worker_service.h"
23 #include "content/browser/worker_host/worker_service_observer.h"
24 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
23 #include "content/public/browser/worker_service.h"
24 #include "content/public/browser/worker_service_observer.h"
25 #include "content/public/common/process_type.h" 25 #include "content/public/common/process_type.h"
26 #include "grit/generated_resources.h" 26 #include "grit/generated_resources.h"
27 #include "grit/workers_resources.h" 27 #include "grit/workers_resources.h"
28 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
29 29
30 using content::BrowserThread; 30 using content::BrowserThread;
31 using content::DevToolsAgentHost; 31 using content::DevToolsAgentHost;
32 using content::DevToolsAgentHostRegistry; 32 using content::DevToolsAgentHostRegistry;
33 using content::WorkerService;
34 using content::WorkerServiceObserver;
33 35
34 static const char kWorkersDataFile[] = "workers_data.json"; 36 static const char kWorkersDataFile[] = "workers_data.json";
35 37
36 static const char kOpenDevToolsCommand[] = "openDevTools"; 38 static const char kOpenDevToolsCommand[] = "openDevTools";
37 static const char kTerminateWorkerCommand[] = "terminateWorker"; 39 static const char kTerminateWorkerCommand[] = "terminateWorker";
38 40
39 static const char kWorkerProcessHostIdField[] = "workerProcessHostId"; 41 static const char kWorkerProcessHostIdField[] = "workerProcessHostId";
40 static const char kWorkerRouteIdField[] = "workerRouteId"; 42 static const char kWorkerRouteIdField[] = "workerRouteId";
41 static const char kUrlField[] = "url"; 43 static const char kUrlField[] = "url";
42 static const char kNameField[] = "name"; 44 static const char kNameField[] = "name";
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 260
259 // Set up the chrome://workers/ source. 261 // Set up the chrome://workers/ source.
260 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 262 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
261 profile->GetChromeURLDataManager()->AddDataSource(html_source); 263 profile->GetChromeURLDataManager()->AddDataSource(html_source);
262 } 264 }
263 265
264 WorkersUI::~WorkersUI() { 266 WorkersUI::~WorkersUI() {
265 observer_->WorkersUIDestroyed(); 267 observer_->WorkersUIDestroyed();
266 observer_ = NULL; 268 observer_ = NULL;
267 } 269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698