OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/notifications/notification_object_proxy.h" | 5 #include "chrome/browser/notifications/notification_object_proxy.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "chrome/browser/browser_process.h" | |
10 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
11 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
12 #include "chrome/common/render_messages.h" | 11 #include "chrome/common/render_messages.h" |
13 | 12 |
14 NotificationObjectProxy::NotificationObjectProxy(int process_id, int route_id, | 13 NotificationObjectProxy::NotificationObjectProxy(int process_id, int route_id, |
15 int notification_id, bool worker) | 14 int notification_id, bool worker) |
16 : process_id_(process_id), | 15 : process_id_(process_id), |
17 route_id_(route_id), | 16 route_id_(route_id), |
18 notification_id_(notification_id), | 17 notification_id_(notification_id), |
19 worker_(worker) { | 18 worker_(worker) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Take ownership of the message; ownership will pass to a host if possible. | 76 // Take ownership of the message; ownership will pass to a host if possible. |
78 scoped_ptr<IPC::Message> owned_message(message); | 77 scoped_ptr<IPC::Message> owned_message(message); |
79 | 78 |
80 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 79 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
81 RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_); | 80 RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_); |
82 if (host) { | 81 if (host) { |
83 // Pass ownership to the host. | 82 // Pass ownership to the host. |
84 host->Send(owned_message.release()); | 83 host->Send(owned_message.release()); |
85 } | 84 } |
86 } | 85 } |
OLD | NEW |