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

Unified Diff: content/browser/shared_worker/shared_worker_service_impl.cc

Issue 185743004: Implement SharedWorkerServiceImpl::GetWorkers(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/shared_worker/shared_worker_service_impl.cc
diff --git a/content/browser/shared_worker/shared_worker_service_impl.cc b/content/browser/shared_worker/shared_worker_service_impl.cc
index d5a06b36a8a2a691c1ae363c28783c3452e832ef..fa08917e2819a93b473a7c7184990c5dc03c22a6 100644
--- a/content/browser/shared_worker/shared_worker_service_impl.cc
+++ b/content/browser/shared_worker/shared_worker_service_impl.cc
@@ -32,8 +32,22 @@ bool SharedWorkerServiceImpl::TerminateWorker(int process_id, int route_id) {
}
std::vector<WorkerService::WorkerInfo> SharedWorkerServiceImpl::GetWorkers() {
- // TODO(horo): implement this.
std::vector<WorkerService::WorkerInfo> results;
+ for (WorkerHostMap::const_iterator iter = worker_hosts_.begin();
+ iter != worker_hosts_.end();
+ ++iter) {
+ SharedWorkerHost* host = iter->second;
+ const SharedWorkerInstance* instance = host->instance();
+ if (instance) {
+ WorkerService::WorkerInfo info;
+ info.url = instance->url();
+ info.name = instance->name();
+ info.route_id = host->worker_route_id();
+ info.process_id = host->process_id();
+ info.handle = host->container_render_filter()->PeerHandle();
+ results.push_back(info);
+ }
+ }
return results;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698