diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 01:44:10 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 01:44:10 +0000 |
commit | 3714e47374c375193e9dc4cf0a140d40af5ed3ff (patch) | |
tree | 574c8ef00befef5790db4c1477273fbe117a90ab | |
parent | 306d4e55fda262cabbdb929efd7ab42186f312ff (diff) | |
download | chromium_src-3714e47374c375193e9dc4cf0a140d40af5ed3ff.zip chromium_src-3714e47374c375193e9dc4cf0a140d40af5ed3ff.tar.gz chromium_src-3714e47374c375193e9dc4cf0a140d40af5ed3ff.tar.bz2 |
Remove the routing id parameter from the desktop notification IPCs sent by the renderer.
We can retrieve the routing id from the message.
BUG=70690
TEST=no change in functionality.
Review URL: http://codereview.chromium.org/6299022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72911 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/desktop_notification_handler.cc | 12 | ||||
-rw-r--r-- | chrome/browser/desktop_notification_handler.h | 8 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 6 | ||||
-rw-r--r-- | chrome/common/render_messages_params.cc | 6 | ||||
-rw-r--r-- | chrome/common/render_messages_params.h | 3 | ||||
-rw-r--r-- | chrome/renderer/notification_provider.cc | 6 |
6 files changed, 17 insertions, 24 deletions
diff --git a/chrome/browser/desktop_notification_handler.cc b/chrome/browser/desktop_notification_handler.cc index 310a10b..7f6cab2 100644 --- a/chrome/browser/desktop_notification_handler.cc +++ b/chrome/browser/desktop_notification_handler.cc @@ -36,6 +36,7 @@ bool DesktopNotificationHandler::OnMessageReceived( } void DesktopNotificationHandler::OnShowDesktopNotification( + const IPC::Message& message, const ViewHostMsg_ShowNotification_Params& params) { RenderProcessHost* process = GetRenderProcessHost(); DesktopNotificationService* service = @@ -44,24 +45,25 @@ void DesktopNotificationHandler::OnShowDesktopNotification( service->ShowDesktopNotification( params, process->id(), - params.routing_id, + message.routing_id(), DesktopNotificationService::PageNotification); } void DesktopNotificationHandler::OnCancelDesktopNotification( - int routing_id, int notification_id) { + const IPC::Message& message, int notification_id) { RenderProcessHost* process = GetRenderProcessHost(); DesktopNotificationService* service = process->profile()->GetDesktopNotificationService(); service->CancelDesktopNotification( process->id(), - routing_id, + message.routing_id(), notification_id); } void DesktopNotificationHandler::OnRequestNotificationPermission( - int routing_id, const GURL& source_origin, int callback_context) { + const IPC::Message& message, const GURL& source_origin, + int callback_context) { RenderProcessHost* process = GetRenderProcessHost(); Browser* browser = BrowserList::GetLastActive(); // We may not have a BrowserList if the chrome browser process is launched as @@ -76,7 +78,7 @@ void DesktopNotificationHandler::OnRequestNotificationPermission( service->RequestPermission( source_origin, process->id(), - routing_id, + message.routing_id(), callback_context, tab); } diff --git a/chrome/browser/desktop_notification_handler.h b/chrome/browser/desktop_notification_handler.h index 7fce602..121f3d4 100644 --- a/chrome/browser/desktop_notification_handler.h +++ b/chrome/browser/desktop_notification_handler.h @@ -7,6 +7,7 @@ #pragma once #include "chrome/browser/tab_contents/web_navigation_observer.h" +#include "ipc/ipc_message.h" struct ViewHostMsg_ShowNotification_Params; class RenderProcessHost; @@ -27,9 +28,12 @@ class DesktopNotificationHandler : public WebNavigationObserver { private: // IPC handlers. void OnShowDesktopNotification( + const IPC::Message& message, const ViewHostMsg_ShowNotification_Params& params); - void OnCancelDesktopNotification(int routing_id, int notification_id); - void OnRequestNotificationPermission(int routing_id, const GURL& origin, + void OnCancelDesktopNotification(const IPC::Message& message, + int notification_id); + void OnRequestNotificationPermission(const IPC::Message& message, + const GURL& origin, int callback_id); private: diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 0cc2db5..250c77d 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -2180,11 +2180,9 @@ IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached, // a desktop notification. IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowDesktopNotification, ViewHostMsg_ShowNotification_Params) -IPC_MESSAGE_ROUTED2(ViewHostMsg_CancelDesktopNotification, - int /* routing_id */, +IPC_MESSAGE_ROUTED1(ViewHostMsg_CancelDesktopNotification, int /* notification_id */) -IPC_MESSAGE_ROUTED3(ViewHostMsg_RequestNotificationPermission, - int /* routing_id */, +IPC_MESSAGE_ROUTED2(ViewHostMsg_RequestNotificationPermission, GURL /* origin */, int /* callback_context */) IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_CheckNotificationPermission, diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index 409776b..59a17bd 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -1311,7 +1311,6 @@ void ParamTraits<ViewHostMsg_ShowNotification_Params>::Write( WriteParam(m, p.direction); WriteParam(m, p.replace_id); WriteParam(m, p.notification_id); - WriteParam(m, p.routing_id); } bool ParamTraits<ViewHostMsg_ShowNotification_Params>::Read( @@ -1327,8 +1326,7 @@ bool ParamTraits<ViewHostMsg_ShowNotification_Params>::Read( ReadParam(m, iter, &p->body) && ReadParam(m, iter, &p->direction) && ReadParam(m, iter, &p->replace_id) && - ReadParam(m, iter, &p->notification_id) && - ReadParam(m, iter, &p->routing_id); + ReadParam(m, iter, &p->notification_id); } void ParamTraits<ViewHostMsg_ShowNotification_Params>::Log( @@ -1352,8 +1350,6 @@ void ParamTraits<ViewHostMsg_ShowNotification_Params>::Log( LogParam(p.replace_id, l); l->append(","); LogParam(p.notification_id, l); - l->append(","); - LogParam(p.routing_id, l); l->append(")"); } diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index 88473c6c..ce4b18c 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -742,9 +742,6 @@ struct ViewHostMsg_ShowNotification_Params { // Notification ID for sending events back for this notification. int notification_id; - - // The routing id of the message. - int routing_id; }; // Creates a new view via a control message since the view doesn't yet exist. diff --git a/chrome/renderer/notification_provider.cc b/chrome/renderer/notification_provider.cc index 170db3a..e3aeeb1 100644 --- a/chrome/renderer/notification_provider.cc +++ b/chrome/renderer/notification_provider.cc @@ -46,8 +46,7 @@ void NotificationProvider::cancel(const WebNotification& notification) { bool id_found = manager_.GetId(notification, id); // Won't be found if the notification has already been closed by the user. if (id_found) - Send(new ViewHostMsg_CancelDesktopNotification(routing_id(), routing_id(), - id)); + Send(new ViewHostMsg_CancelDesktopNotification(routing_id(), id)); } void NotificationProvider::objectDestroyed( @@ -79,7 +78,6 @@ void NotificationProvider::requestPermission( int id = manager_.RegisterPermissionRequest(callback); Send(new ViewHostMsg_RequestNotificationPermission(routing_id(), - routing_id(), GURL(origin.toString()), id)); } @@ -121,7 +119,6 @@ bool NotificationProvider::ShowHTML(const WebNotification& notification, params.contents_url = notification.url(); params.notification_id = id; params.replace_id = notification.replaceId(); - params.routing_id = routing_id(); return Send(new ViewHostMsg_ShowDesktopNotification(routing_id(), params)); } @@ -138,7 +135,6 @@ bool NotificationProvider::ShowText(const WebNotification& notification, params.direction = notification.direction(); params.notification_id = id; params.replace_id = notification.replaceId(); - params.routing_id = routing_id(); return Send(new ViewHostMsg_ShowDesktopNotification(routing_id(), params)); } |