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

Unified Diff: content/common/service_worker/service_worker_status_code.h

Issue 142973003: Have a central operation status code for ServiceWorker (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/common/service_worker/service_worker_status_code.h
diff --git a/content/common/service_worker/service_worker_status_code.h b/content/common/service_worker/service_worker_status_code.h
new file mode 100644
index 0000000000000000000000000000000000000000..4dbd4117b5f132dd8e32eed24a7975d775d771de
--- /dev/null
+++ b/content/common/service_worker/service_worker_status_code.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_STATUS_CODE_H_
+#define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_STATUS_CODE_H_
+
+#include "content/common/content_export.h"
+
+namespace content {
+
+// Generic service worker operation statuses.
+enum ServiceWorkerStatusCode {
+ // Operation succeeded.
+ SERVICE_WORKER_OK,
+
+ // Generic operation error (more specific error code should be used in
+ // general).
+ SERVICE_WORKER_ERROR_FAILED,
+
+ // Operation was aborted (e.g. due to context or child process shutdown).
+ SERVICE_WORKER_ERROR_ABORT,
+
+ // Starting a new service worker script context failed.
+ SERVICE_WORKER_ERROR_START_WORKER_FAILED,
+
+ // Could not find a renderer process to run a service worker.
+ SERVICE_WORKER_ERROR_PROCESS_NOT_FOUND,
+
+ // Install event handling failed.
+ SERVICE_WORKER_ERROR_INSTALL_WORKER_FAILED,
+
+ // Activate event handling failed.
+ SERVICE_WORKER_ERROR_ACTIVATE_WORKER_FAILED,
+};
+
+CONTENT_EXPORT const char* ServiceWorkerStatusToString(
+ ServiceWorkerStatusCode code);
+
+} // namespace content
+
+#endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_STATUS_CODE_H_
« no previous file with comments | « content/browser/service_worker/service_worker_storage.cc ('k') | content/common/service_worker/service_worker_status_code.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698