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

Unified Diff: chrome/browser/notifications/notification_test_util.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: Changes as per review comments. 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/notification_test_util.cc
diff --git a/chrome/browser/notifications/notification_test_util.cc b/chrome/browser/notifications/notification_test_util.cc
index 1cfdf9d5c04ae209b8493623dc32fc23cb23f29f..e5a56704e08788ff840541e8ad4ce9e9a7f6cc90 100644
--- a/chrome/browser/notifications/notification_test_util.cc
+++ b/chrome/browser/notifications/notification_test_util.cc
@@ -34,7 +34,8 @@ void StubNotificationUIManager::SetNotificationAddedCallback(
void StubNotificationUIManager::Add(const Notification& notification,
Profile* profile) {
- notifications_.push_back(std::make_pair(notification, profile));
+ notifications_.push_back(std::make_pair(
+ notification, NotificationUIManager::GetProfileID(profile)));
if (!notification_added_callback_.is_null()) {
notification_added_callback_.Run();
@@ -82,21 +83,21 @@ bool StubNotificationUIManager::CancelById(const std::string& delegate_id,
std::set<std::string>
StubNotificationUIManager::GetAllIdsByProfileAndSourceOrigin(
- Profile* profile,
+ ProfileID profile_id,
const GURL& source) {
std::set<std::string> delegate_ids;
for (const auto& pair : notifications_) {
- if (pair.second == profile && pair.first.origin_url() == source)
+ if (pair.second == profile_id && pair.first.origin_url() == source)
delegate_ids.insert(pair.first.delegate_id());
}
return delegate_ids;
}
std::set<std::string> StubNotificationUIManager::GetAllIdsByProfile(
- Profile* profile) {
+ ProfileID profile_id) {
std::set<std::string> delegate_ids;
for (const auto& pair : notifications_) {
- if (pair.second == profile)
+ if (pair.second == profile_id)
delegate_ids.insert(pair.first.delegate_id());
}
return delegate_ids;
« no previous file with comments | « chrome/browser/notifications/notification_test_util.h ('k') | chrome/browser/notifications/notification_ui_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698