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

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

Issue 183663025: Implement SharedWorkerServiceImpl::TerminateWorker(). (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 | « content/browser/shared_worker/shared_worker_host.cc ('k') | 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..cb846a06037ef85ae929e197b148985eb3d3adb9 100644
--- a/content/browser/shared_worker/shared_worker_service_impl.cc
+++ b/content/browser/shared_worker/shared_worker_service_impl.cc
@@ -27,8 +27,12 @@ SharedWorkerServiceImpl::~SharedWorkerServiceImpl() {
}
bool SharedWorkerServiceImpl::TerminateWorker(int process_id, int route_id) {
- // TODO(horo): implement this.
- return false;
+ SharedWorkerHost* host =
+ worker_hosts_.get(std::make_pair(process_id, route_id));
+ if (!host || !host->instance())
+ return false;
+ host->TerminateWorker();
+ return true;
}
std::vector<WorkerService::WorkerInfo> SharedWorkerServiceImpl::GetWorkers() {
« no previous file with comments | « content/browser/shared_worker/shared_worker_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698