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

Side by Side Diff: content/public/common/push_messaging_status.cc

Issue 2436393002: Disallow repeated PushManager.subscribes with different sender ids (Closed)
Patch Set: Make error message more informative Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/common/push_messaging_status.h" 5 #include "content/public/common/push_messaging_status.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // We split this out for UMA, but it must be indistinguishable to JS. 45 // We split this out for UMA, but it must be indistinguishable to JS.
46 return PushRegistrationStatusToString( 46 return PushRegistrationStatusToString(
47 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); 47 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED);
48 48
49 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE: 49 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE:
50 return "Registration failed - could not retrieve the public key"; 50 return "Registration failed - could not retrieve the public key";
51 51
52 case PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING: 52 case PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING:
53 return "Registration failed - missing applicationServerKey, and manifest " 53 return "Registration failed - missing applicationServerKey, and manifest "
54 "empty or missing"; 54 "empty or missing";
55
56 case PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH:
57 return "Registration failed - A subscription with a different "
58 "applicationServerKey (or gcm_sender_id) already exists; to "
59 "change the applicationServerKey, unsubscribe then resubscribe.";
55 } 60 }
56 NOTREACHED(); 61 NOTREACHED();
57 return ""; 62 return "";
58 } 63 }
59 64
60 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) { 65 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) {
61 switch (status) { 66 switch (status) {
62 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED: 67 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED:
63 return "Unregistration successful - from push service"; 68 return "Unregistration successful - from push service";
64 69
(...skipping 18 matching lines...) Expand all
83 return "Unregistration failed - storage error"; 88 return "Unregistration failed - storage error";
84 89
85 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR: 90 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR:
86 return "Unregistration failed - could not connect to push server"; 91 return "Unregistration failed - could not connect to push server";
87 } 92 }
88 NOTREACHED(); 93 NOTREACHED();
89 return ""; 94 return "";
90 } 95 }
91 96
92 } // namespace content 97 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698