summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/notification_object_proxy.cc
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 23:16:56 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 23:16:56 +0000
commit6a760c99f8a9590f8643a832d50980c60c5c3931 (patch)
tree24cc61cdac8f30b937fe6c39ff342a142835c4c1 /chrome/browser/notifications/notification_object_proxy.cc
parent751fae0d3da720758f736b515012e72ce0a1e7e7 (diff)
downloadchromium_src-6a760c99f8a9590f8643a832d50980c60c5c3931.zip
chromium_src-6a760c99f8a9590f8643a832d50980c60c5c3931.tar.gz
chromium_src-6a760c99f8a9590f8643a832d50980c60c5c3931.tar.bz2
Desktop Notifications for the mac
BUG=23066 TEST=notify_demo.html Review URL: http://codereview.chromium.org/548208 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/notification_object_proxy.cc')
-rw-r--r--chrome/browser/notifications/notification_object_proxy.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/notifications/notification_object_proxy.cc b/chrome/browser/notifications/notification_object_proxy.cc
index a18e0d7..3b45ddf 100644
--- a/chrome/browser/notifications/notification_object_proxy.cc
+++ b/chrome/browser/notifications/notification_object_proxy.cc
@@ -59,8 +59,13 @@ void NotificationObjectProxy::DeliverMessage(IPC::Message* message) {
// Deferred method which runs on the IO thread and sends a message to the
// proxied notification, routing it through the correct host in the browser.
void NotificationObjectProxy::Send(IPC::Message* message) {
+ // Take ownership of the message; ownership will pass to a host if possible.
+ scoped_ptr<IPC::Message> owned_message(message);
+
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_);
- if (host)
- host->Send(message);
+ if (host) {
+ // Pass ownership to the host.
+ host->Send(owned_message.release());
+ }
}