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

Unified Diff: chrome/browser/notifications/message_center_notification_manager.cc

Issue 1155453002: Passing ProfileID instead of Profile* to clarify that profile should not be used for making any cal… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/message_center_notification_manager.cc
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index e4c54e7430d9f8d01001fee859ab5e2d69c42799..b7870cf8e94407f198cd73faf96b3a8c87a21439 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -231,7 +231,7 @@ bool MessageCenterNotificationManager::CancelById(
std::set<std::string>
MessageCenterNotificationManager::GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
+ ProfileID profile_id,
const GURL& source) {
// The profile pointer can be weak, the instance may have been destroyed, so
Peter Beverloo 2015/05/21 11:28:48 nit: You can now remove this comment.
Deepak 2015/05/21 14:01:07 Done.
// no profile method should be called inside this function.
@@ -239,7 +239,7 @@ MessageCenterNotificationManager::GetAllIdsByProfileAndSourceOrigin(
std::set<std::string> delegate_ids;
for (const auto& pair : profile_notifications_) {
const Notification& notification = pair.second->notification();
- if (pair.second->profile() == profile &&
+ if (pair.second->profile() == profile_id &&
notification.origin_url() == source) {
delegate_ids.insert(notification.delegate_id());
}
@@ -249,13 +249,13 @@ MessageCenterNotificationManager::GetAllIdsByProfileAndSourceOrigin(
}
std::set<std::string> MessageCenterNotificationManager::GetAllIdsByProfile(
- Profile* profile) {
+ ProfileID profile_id) {
// The profile pointer can be weak, the instance may have been destroyed, so
Peter Beverloo 2015/05/21 11:28:48 nit: You can now remove this comment.
Deepak 2015/05/21 14:01:07 Done.
// no profile method should be called inside this function.
std::set<std::string> delegate_ids;
for (const auto& pair : profile_notifications_) {
- if (pair.second->profile() == profile)
+ if (pair.second->profile() == profile_id)
Peter Beverloo 2015/05/21 11:28:48 This is now a [Profile* == void*] comparison. Even
Deepak 2015/05/21 14:01:07 Done.
delegate_ids.insert(pair.second->notification().delegate_id());
}

Powered by Google App Engine
This is Rietveld 408576698