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

Unified Diff: chrome/browser/notifications/notification_platform_bridge_mac.h

Issue 2105863002: Verify that the notification response contains sensible data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add upstream branch Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/notification_platform_bridge_mac.h
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.h b/chrome/browser/notifications/notification_platform_bridge_mac.h
index ad261aaa79764597f596b48b1d6b0472d580f005..8337672b2007e573f005dadb6753b6f4bc156b20 100644
--- a/chrome/browser/notifications/notification_platform_bridge_mac.h
+++ b/chrome/browser/notifications/notification_platform_bridge_mac.h
@@ -37,6 +37,12 @@ class NotificationPlatformBridgeMac : public NotificationPlatformBridge {
std::set<std::string>* notifications) const override;
bool SupportsNotificationCenter() const override;
+ // Perform some sanity checks on the returned values. Since the notification
+ // data comes from outside of Chrome it's better to do real production checks
+ // than just DCHECKS.
+ // Returns true if all the checks pass, false otherwise.
Peter Beverloo 2016/06/28 23:35:52 There is a contrast between "some sanity checks" a
Miguel Garcia 2016/06/30 10:42:00 Done.
+ static bool VerifyNotificationData(NSDictionary* response);
Peter Beverloo 2016/06/28 23:35:52 Please annotate this with WARN_UNUSED_RESULT from
Miguel Garcia 2016/06/30 10:42:00 Done.
+
private:
// Cocoa class that receives callbacks from the NSUserNotificationCenter.
base::scoped_nsobject<NotificationCenterDelegate> delegate_;

Powered by Google App Engine
This is Rietveld 408576698