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

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

Issue 938123002: Push API: Add and cleanup UMA logging for unregister/get/delivery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@incognito
Patch Set: Update tests Created 5 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 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 18 matching lines...) Expand all
29 return "Registration failed - push service error"; 29 return "Registration failed - push service error";
30 30
31 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: 31 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID:
32 return "Registration failed - no sender id provided"; 32 return "Registration failed - no sender id provided";
33 33
34 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: 34 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR:
35 return "Registration failed - storage error"; 35 return "Registration failed - storage error";
36 36
37 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE: 37 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE:
38 return "Registration successful - from cache"; 38 return "Registration successful - from cache";
39
40 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR:
41 return "Registration failed - could not connect to push server";
42
43 case PUSH_REGISTRATION_STATUS_INCOGNITO_SERVICE_NOT_AVAILABLE_PERMISSION_DEN IED:
44 // We split this out for UMA, but it must be indistinguishable to JS.
45 return PushRegistrationStatusToString(
46 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED);
39 } 47 }
40 NOTREACHED(); 48 }
41 return ""; 49
50 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) {
51 switch (status) {
52 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED:
53 return "Unregistration successful - from push service";
54
55 case PUSH_UNREGISTRATION_STATUS_SUCCESS_WILL_RETRY_NETWORK_ERROR:
56 return "Unregistration successful - a network error occurred, but it "
Michael van Ouwerkerk 2015/02/20 11:05:56 Maybe not success but pending.
johnme 2015/02/20 11:34:19 Done.
57 "will be retried until it succeeds";
58
59 case PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED:
60 return "Unregistration successful - was not registered";
61
62 case PUSH_UNREGISTRATION_STATUS_NO_SERVICE_WORKER:
63 return "Unregistration failed - no Service Worker";
64
65 case PUSH_UNREGISTRATION_STATUS_SERVICE_NOT_AVAILABLE:
66 return "Unregistration failed - push service not available";
67
68 case PUSH_UNREGISTRATION_STATUS_SERVICE_ERROR:
69 return "Unregistration failed - push service error";
70
71 case PUSH_UNREGISTRATION_STATUS_STORAGE_ERROR:
72 return "Unregistration failed - storage error";
73
74 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR:
75 return "Unregistration failed - could not connect to push server";
76 }
42 } 77 }
43 78
44 } // namespace content 79 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698