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

Side by Side 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, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 19 matching lines...) Expand all
30 const std::string& profile_id, 30 const std::string& profile_id,
31 bool incognito, 31 bool incognito,
32 const Notification& notification) override; 32 const Notification& notification) override;
33 void Close(const std::string& profile_id, 33 void Close(const std::string& profile_id,
34 const std::string& notification_id) override; 34 const std::string& notification_id) override;
35 bool GetDisplayed(const std::string& profile_id, 35 bool GetDisplayed(const std::string& profile_id,
36 bool incognito, 36 bool incognito,
37 std::set<std::string>* notifications) const override; 37 std::set<std::string>* notifications) const override;
38 bool SupportsNotificationCenter() const override; 38 bool SupportsNotificationCenter() const override;
39 39
40 // Perform some sanity checks on the returned values. Since the notification
41 // data comes from outside of Chrome it's better to do real production checks
42 // than just DCHECKS.
43 // 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.
44 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.
45
40 private: 46 private:
41 // Cocoa class that receives callbacks from the NSUserNotificationCenter. 47 // Cocoa class that receives callbacks from the NSUserNotificationCenter.
42 base::scoped_nsobject<NotificationCenterDelegate> delegate_; 48 base::scoped_nsobject<NotificationCenterDelegate> delegate_;
43 49
44 // The notification center to use, this can be overriden in tests 50 // The notification center to use, this can be overriden in tests
45 NSUserNotificationCenter* notification_center_; 51 NSUserNotificationCenter* notification_center_;
46 52
47 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeMac); 53 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeMac);
48 }; 54 };
49 55
50 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ 56 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698