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

Side by Side Diff: content/child/push_messaging/push_provider.cc

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Comment out PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE Created 3 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/child/push_messaging/push_provider.h" 5 #include "content/child/push_messaging/push_provider.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 case PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE: 55 case PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE:
56 case PUSH_REGISTRATION_STATUS_LIMIT_REACHED: 56 case PUSH_REGISTRATION_STATUS_LIMIT_REACHED:
57 case PUSH_REGISTRATION_STATUS_SERVICE_ERROR: 57 case PUSH_REGISTRATION_STATUS_SERVICE_ERROR:
58 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: 58 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID:
59 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: 59 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR:
60 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE: 60 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE:
61 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR: 61 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR:
62 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED: 62 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED:
63 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE: 63 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE:
64 case PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING: 64 case PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING:
65 case PUSH_REGISTRATION_STATUS_STORAGE_CORRUPT:
65 error_type = blink::WebPushError::ErrorTypeAbort; 66 error_type = blink::WebPushError::ErrorTypeAbort;
66 break; 67 break;
67 } 68 }
68 return blink::WebPushError( 69 return blink::WebPushError(
69 error_type, 70 error_type,
70 blink::WebString::fromUTF8(PushRegistrationStatusToString(status))); 71 blink::WebString::fromUTF8(PushRegistrationStatusToString(status)));
71 } 72 }
72 73
73 static base::LazyInstance<base::ThreadLocalPointer<PushProvider>>::Leaky 74 static base::LazyInstance<base::ThreadLocalPointer<PushProvider>>::Leaky
74 g_push_provider_tls = LAZY_INSTANCE_INITIALIZER; 75 g_push_provider_tls = LAZY_INSTANCE_INITIALIZER;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 "supported."; 302 "supported.";
302 } 303 }
303 304
304 callbacks->onError( 305 callbacks->onError(
305 blink::WebPushError(error, blink::WebString::fromUTF8(error_message))); 306 blink::WebPushError(error, blink::WebString::fromUTF8(error_message)));
306 307
307 permission_status_callbacks_.Remove(request_id); 308 permission_status_callbacks_.Remove(request_id);
308 } 309 }
309 310
310 } // namespace content 311 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698