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

Side by Side Diff: content/common/push_messaging_param_traits.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
« no previous file with comments | « content/common/push_messaging.mojom ('k') | content/public/browser/push_messaging_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/common/push_messaging_param_traits.h" 5 #include "content/common/push_messaging_param_traits.h"
6 6
7 namespace mojo { 7 namespace mojo {
8 8
9 // PushRegistrationStatus 9 // PushRegistrationStatus
10 static_assert( 10 static_assert(
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 content::mojom::PushRegistrationStatus::MANIFEST_EMPTY_OR_MISSING), 94 content::mojom::PushRegistrationStatus::MANIFEST_EMPTY_OR_MISSING),
95 "PushRegistrationStatus enums must match, MANIFEST_EMPTY_OR_MISSING"); 95 "PushRegistrationStatus enums must match, MANIFEST_EMPTY_OR_MISSING");
96 96
97 static_assert( 97 static_assert(
98 content::PushRegistrationStatus:: 98 content::PushRegistrationStatus::
99 PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH == 99 PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH ==
100 static_cast<content::PushRegistrationStatus>( 100 static_cast<content::PushRegistrationStatus>(
101 content::mojom::PushRegistrationStatus::SENDER_ID_MISMATCH), 101 content::mojom::PushRegistrationStatus::SENDER_ID_MISMATCH),
102 "PushRegistrationStatus enums must match, SENDER_ID_MISMATCH"); 102 "PushRegistrationStatus enums must match, SENDER_ID_MISMATCH");
103 103
104 static_assert(
105 content::PushRegistrationStatus::PUSH_REGISTRATION_STATUS_STORAGE_CORRUPT ==
106 static_cast<content::PushRegistrationStatus>(
107 content::mojom::PushRegistrationStatus::STORAGE_CORRUPT),
108 "PushRegistrationStatus enums must match, STORAGE_CORRUPT");
109
104 static_assert(content::PushRegistrationStatus::PUSH_REGISTRATION_STATUS_LAST == 110 static_assert(content::PushRegistrationStatus::PUSH_REGISTRATION_STATUS_LAST ==
105 static_cast<content::PushRegistrationStatus>( 111 static_cast<content::PushRegistrationStatus>(
106 content::mojom::PushRegistrationStatus::LAST), 112 content::mojom::PushRegistrationStatus::LAST),
107 "PushRegistrationStatus enums must match, LAST"); 113 "PushRegistrationStatus enums must match, LAST");
108 114
109 // PushErrorType 115 // PushErrorType
110 static_assert(blink::WebPushError::ErrorType::ErrorTypeAbort == 116 static_assert(blink::WebPushError::ErrorType::ErrorTypeAbort ==
111 static_cast<blink::WebPushError::ErrorType>( 117 static_cast<blink::WebPushError::ErrorType>(
112 content::mojom::PushErrorType::ABORT), 118 content::mojom::PushErrorType::ABORT),
113 "PushErrorType enums must match, ABORT"); 119 "PushErrorType enums must match, ABORT");
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 content::PushGetRegistrationStatus:: 184 content::PushGetRegistrationStatus::
179 PUSH_GETREGISTRATION_STATUS_INCOGNITO_REGISTRATION_NOT_FOUND == 185 PUSH_GETREGISTRATION_STATUS_INCOGNITO_REGISTRATION_NOT_FOUND ==
180 static_cast<content::PushGetRegistrationStatus>( 186 static_cast<content::PushGetRegistrationStatus>(
181 content::mojom::PushGetRegistrationStatus:: 187 content::mojom::PushGetRegistrationStatus::
182 INCOGNITO_REGISTRATION_NOT_FOUND), 188 INCOGNITO_REGISTRATION_NOT_FOUND),
183 "PushGetRegistrationStatus enums must match, " 189 "PushGetRegistrationStatus enums must match, "
184 "INCOGNITO_REGISTRATION_NOT_FOUND"); 190 "INCOGNITO_REGISTRATION_NOT_FOUND");
185 191
186 static_assert( 192 static_assert(
187 content::PushGetRegistrationStatus:: 193 content::PushGetRegistrationStatus::
188 PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE == 194 PUSH_GETREGISTRATION_STATUS_STORAGE_CORRUPT ==
189 static_cast<content::PushGetRegistrationStatus>( 195 static_cast<content::PushGetRegistrationStatus>(
190 content::mojom::PushGetRegistrationStatus::PUBLIC_KEY_UNAVAILABLE), 196 content::mojom::PushGetRegistrationStatus::STORAGE_CORRUPT),
191 "PushGetRegistrationStatus enums must match, PUBLIC_KEY_UNAVAILABLE"); 197 "PushGetRegistrationStatus enums must match, STORAGE_CORRUPT");
192 198
193 static_assert( 199 static_assert(
194 content::PushGetRegistrationStatus::PUSH_GETREGISTRATION_STATUS_LAST == 200 content::PushGetRegistrationStatus::PUSH_GETREGISTRATION_STATUS_LAST ==
195 static_cast<content::PushGetRegistrationStatus>( 201 static_cast<content::PushGetRegistrationStatus>(
196 content::mojom::PushGetRegistrationStatus::LAST), 202 content::mojom::PushGetRegistrationStatus::LAST),
197 "PushGetRegistrationStatus enums must match, LAST"); 203 "PushGetRegistrationStatus enums must match, LAST");
198 204
199 // PushPermissionStatus 205 // PushPermissionStatus
200 static_assert(blink::WebPushPermissionStatus::WebPushPermissionStatusGranted == 206 static_assert(blink::WebPushPermissionStatus::WebPushPermissionStatusGranted ==
201 static_cast<blink::WebPushPermissionStatus>( 207 static_cast<blink::WebPushPermissionStatus>(
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 input <= content::mojom::PushPermissionStatus::LAST) { 347 input <= content::mojom::PushPermissionStatus::LAST) {
342 *output = static_cast<blink::WebPushPermissionStatus>(input); 348 *output = static_cast<blink::WebPushPermissionStatus>(input);
343 return true; 349 return true;
344 } 350 }
345 351
346 NOTREACHED(); 352 NOTREACHED();
347 return false; 353 return false;
348 } 354 }
349 355
350 } // namespace mojo 356 } // namespace mojo
OLDNEW
« no previous file with comments | « content/common/push_messaging.mojom ('k') | content/public/browser/push_messaging_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698