summaryrefslogtreecommitdiffstats
path: root/chrome/common/desktop_notifications
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 20:09:01 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 20:09:01 +0000
commit21351f3d53b1764783de97b4f8927bcc819edb8a (patch)
tree4d0c2fcb423d75de938cd3ec548aa8cd9dd9d56f /chrome/common/desktop_notifications
parentea7c380758e8825f45ea6c803326e5954fb1cb6c (diff)
downloadchromium_src-21351f3d53b1764783de97b4f8927bcc819edb8a.zip
chromium_src-21351f3d53b1764783de97b4f8927bcc819edb8a.tar.gz
chromium_src-21351f3d53b1764783de97b4f8927bcc819edb8a.tar.bz2
Revert 38469 - Desktop Notifications for the mac!
BUG=23066 TEST=notify_demo.html Review URL: http://codereview.chromium.org/548208 TBR=johnnyg@chromium.org Review URL: http://codereview.chromium.org/600015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/desktop_notifications')
-rw-r--r--chrome/common/desktop_notifications/active_notification_tracker.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/common/desktop_notifications/active_notification_tracker.cc b/chrome/common/desktop_notifications/active_notification_tracker.cc
index bc25838..bcb6e2b 100644
--- a/chrome/common/desktop_notifications/active_notification_tracker.cc
+++ b/chrome/common/desktop_notifications/active_notification_tracker.cc
@@ -13,6 +13,7 @@ using WebKit::WebNotificationPermissionCallback;
bool ActiveNotificationTracker::GetId(
const WebNotification& notification, int& id) {
+ DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_DEFAULT);
ReverseTable::iterator iter = reverse_notification_table_.find(notification);
if (iter == reverse_notification_table_.end())
return false;
@@ -22,6 +23,7 @@ bool ActiveNotificationTracker::GetId(
bool ActiveNotificationTracker::GetNotification(
int id, WebNotification* notification) {
+ DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_DEFAULT);
WebNotification* lookup = notification_table_.Lookup(id);
if (!lookup)
return false;
@@ -32,6 +34,7 @@ bool ActiveNotificationTracker::GetNotification(
int ActiveNotificationTracker::RegisterNotification(
const WebKit::WebNotification& proxy) {
+ DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_DEFAULT);
WebNotification* notification = new WebNotification(proxy);
int id = notification_table_.Add(notification);
reverse_notification_table_[proxy] = id;
@@ -39,6 +42,7 @@ int ActiveNotificationTracker::RegisterNotification(
}
void ActiveNotificationTracker::UnregisterNotification(int id) {
+ DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_DEFAULT);
// We want to free the notification after removing it from the table.
scoped_ptr<WebNotification> notification(notification_table_.Lookup(id));
notification_table_.Remove(id);
@@ -57,14 +61,17 @@ void ActiveNotificationTracker::Clear() {
WebNotificationPermissionCallback* ActiveNotificationTracker::GetCallback(
int id) {
+ DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_DEFAULT);
return callback_table_.Lookup(id);
}
int ActiveNotificationTracker::RegisterPermissionRequest(
WebNotificationPermissionCallback* callback) {
+ DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_DEFAULT);
return callback_table_.Add(callback);
}
void ActiveNotificationTracker::OnPermissionRequestComplete(int id) {
+ DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_DEFAULT);
callback_table_.Remove(id);
}