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

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

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Fix include Created 3 years, 8 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/bind_helpers.h" 10 #include "base/bind_helpers.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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 error_message = 274 error_message =
274 "Push subscriptions that don't enable userVisibleOnly are not " 275 "Push subscriptions that don't enable userVisibleOnly are not "
275 "supported."; 276 "supported.";
276 } 277 }
277 callbacks->onError(blink::WebPushError( 278 callbacks->onError(blink::WebPushError(
278 error_type, blink::WebString::fromUTF8(error_message))); 279 error_type, blink::WebString::fromUTF8(error_message)));
279 } 280 }
280 } 281 }
281 282
282 } // namespace content 283 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/push_messaging/push_messaging_manager.cc ('k') | content/common/push_messaging.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698