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

Unified Diff: content/public/common/push_messaging_status.cc

Issue 219653002: Push API: send and receive IPC messages for registration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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/public/common/push_messaging_status.cc
diff --git a/content/public/common/push_messaging_status.cc b/content/public/common/push_messaging_status.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a3f0855d443a566a242567d688df55b39e274a2c
--- /dev/null
+++ b/content/public/common/push_messaging_status.cc
@@ -0,0 +1,34 @@
+// 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.
+
+#include "content/public/common/push_messaging_status.h"
+
+#include "base/logging.h"
+
+namespace content {
+
+const char* PushMessagingStatusToString(PushMessagingStatus status) {
+ switch (status) {
+ case PUSH_MESSAGING_STATUS_OK:
+ return "Successful operation";
+ case PUSH_MESSAGING_STATUS_INVALID_PARAMETER:
+ return "Invalid parameter";
+ case PUSH_MESSAGING_STATUS_NOT_SIGNED_IN:
+ return "Profile not signed in";
+ case PUSH_MESSAGING_STATUS_OPERATION_PENDING:
+ return "Previous asynchronous operation is still pending";
+ case PUSH_MESSAGING_STATUS_NETWORK_ERROR:
+ return "Network socket error";
+ case PUSH_MESSAGING_STATUS_SERVER_ERROR:
+ return "Server error";
+ case PUSH_MESSAGING_STATUS_TTL_EXCEEDED:
+ return "Exceeded the specified TTL during message sending";
+ case PUSH_MESSAGING_STATUS_UNKNOWN_ERROR:
+ return "Unknown error";
+ }
+ NOTREACHED();
+ return "";
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698