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

Unified Diff: content/browser/service_worker/embedded_worker_registry.cc

Issue 147593006: Refine error code returned by ServiceWorkerVersion::StartWorker (e.g. PROCESS_NOT_FOUND etc) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/embedded_worker_registry.cc
diff --git a/content/browser/service_worker/embedded_worker_registry.cc b/content/browser/service_worker/embedded_worker_registry.cc
index d939cfb126e586fa7009c6e0e2c3a4d70132a476..73cea860bf97d9a164985c5ecfd9135b20d725ce 100644
--- a/content/browser/service_worker/embedded_worker_registry.cc
+++ b/content/browser/service_worker/embedded_worker_registry.cc
@@ -25,7 +25,7 @@ scoped_ptr<EmbeddedWorkerInstance> EmbeddedWorkerRegistry::CreateWorker() {
return worker.Pass();
}
-bool EmbeddedWorkerRegistry::StartWorker(
+ServiceWorkerStatusCode EmbeddedWorkerRegistry::StartWorker(
int process_id,
int embedded_worker_id,
int64 service_worker_version_id,
@@ -36,8 +36,8 @@ bool EmbeddedWorkerRegistry::StartWorker(
script_url));
}
-bool EmbeddedWorkerRegistry::StopWorker(int process_id,
- int embedded_worker_id) {
+ServiceWorkerStatusCode EmbeddedWorkerRegistry::StopWorker(
+ int process_id, int embedded_worker_id) {
return Send(process_id,
new EmbeddedWorkerMsg_StopWorker(embedded_worker_id));
}
@@ -107,13 +107,16 @@ EmbeddedWorkerInstance* EmbeddedWorkerRegistry::GetWorker(
EmbeddedWorkerRegistry::~EmbeddedWorkerRegistry() {}
-bool EmbeddedWorkerRegistry::Send(int process_id, IPC::Message* message) {
+ServiceWorkerStatusCode EmbeddedWorkerRegistry::Send(
+ int process_id, IPC::Message* message) {
if (!context_)
- return false;
+ return SERVICE_WORKER_ERROR_ABORT;
ProcessToSenderMap::iterator found = process_sender_map_.find(process_id);
if (found == process_sender_map_.end())
- return false;
- return found->second->Send(message);
+ return SERVICE_WORKER_ERROR_PROCESS_NOT_FOUND;
+ if (!found->second->Send(message))
+ return SERVICE_WORKER_ERROR_IPC_FAILED;
+ return SERVICE_WORKER_OK;
}
void EmbeddedWorkerRegistry::RemoveWorker(int process_id,

Powered by Google App Engine
This is Rietveld 408576698