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 8399007: Removing dedicated worker-related IPC codei (first round). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: CR feedback Created 9 years, 1 month 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
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"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 void WorkersUIHTMLSource::SendSharedWorkersData(int request_id) { 86 void WorkersUIHTMLSource::SendSharedWorkersData(int request_id) {
87 ListValue workers_list; 87 ListValue workers_list;
88 BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS); 88 BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS);
89 for (; !iter.Done(); ++iter) { 89 for (; !iter.Done(); ++iter) {
90 WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter); 90 WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
91 const WorkerProcessHost::Instances& instances = worker->instances(); 91 const WorkerProcessHost::Instances& instances = worker->instances();
92 for (WorkerProcessHost::Instances::const_iterator i = instances.begin(); 92 for (WorkerProcessHost::Instances::const_iterator i = instances.begin();
93 i != instances.end(); ++i) { 93 i != instances.end(); ++i) {
94 if (!i->shared()) 94 workers_list.Append(BuildWorkerData(worker, *i));
95 continue;
96 workers_list.Append(BuildWorkerData(worker, *i));
97 } 95 }
98 } 96 }
99 97
100 std::string json_string; 98 std::string json_string;
101 base::JSONWriter::Write(&workers_list, false, &json_string); 99 base::JSONWriter::Write(&workers_list, false, &json_string);
102 100
103 SendResponse(request_id, base::RefCountedString::TakeString(&json_string)); 101 SendResponse(request_id, base::RefCountedString::TakeString(&json_string));
104 } 102 }
105 103
106 class WorkersDOMHandler : public WebUIMessageHandler { 104 class WorkersDOMHandler : public WebUIMessageHandler {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 260
263 // Set up the chrome://workers/ source. 261 // Set up the chrome://workers/ source.
264 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); 262 Profile* profile = Profile::FromBrowserContext(contents->browser_context());
265 profile->GetChromeURLDataManager()->AddDataSource(html_source); 263 profile->GetChromeURLDataManager()->AddDataSource(html_source);
266 } 264 }
267 265
268 WorkersUI::~WorkersUI() { 266 WorkersUI::~WorkersUI() {
269 observer_->WorkersUIDestroyed(); 267 observer_->WorkersUIDestroyed();
270 observer_ = NULL; 268 observer_ = NULL;
271 } 269 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/devtools_sanity_unittest.cc ('k') | content/browser/debugger/worker_devtools_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698