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

Side by Side Diff: content/child/notifications/notification_dispatcher.cc

Issue 740033002: Initialize NotificationDispatcher::next_notification_id_ to 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/child/notifications/notification_dispatcher.h" 5 #include "content/child/notifications/notification_dispatcher.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "content/child/notifications/notification_manager.h" 8 #include "content/child/notifications/notification_manager.h"
9 #include "content/child/thread_safe_sender.h" 9 #include "content/child/thread_safe_sender.h"
10 #include "content/child/worker_thread_task_runner.h" 10 #include "content/child/worker_thread_task_runner.h"
11 #include "content/common/platform_notification_messages.h" 11 #include "content/common/platform_notification_messages.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 NotificationDispatcher::NotificationDispatcher( 15 NotificationDispatcher::NotificationDispatcher(
16 ThreadSafeSender* thread_safe_sender) 16 ThreadSafeSender* thread_safe_sender)
17 : main_thread_loop_proxy_(base::MessageLoopProxy::current()), 17 : main_thread_loop_proxy_(base::MessageLoopProxy::current()),
18 thread_safe_sender_(thread_safe_sender) { 18 thread_safe_sender_(thread_safe_sender),
19 next_notification_id_(0) {
19 } 20 }
20 21
21 NotificationDispatcher::~NotificationDispatcher() {} 22 NotificationDispatcher::~NotificationDispatcher() {}
22 23
23 int NotificationDispatcher::GenerateNotificationId(int thread_id) { 24 int NotificationDispatcher::GenerateNotificationId(int thread_id) {
24 base::AutoLock lock(notification_id_map_lock_); 25 base::AutoLock lock(notification_id_map_lock_);
25 notification_id_map_[next_notification_id_] = thread_id; 26 notification_id_map_[next_notification_id_] = thread_id;
26 return next_notification_id_++; 27 return next_notification_id_++;
27 } 28 }
28 29
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 64
64 bool NotificationDispatcher::ShouldHandleMessage(const IPC::Message& msg) { 65 bool NotificationDispatcher::ShouldHandleMessage(const IPC::Message& msg) {
65 // The thread-safe message filter is responsible for handling all the messages 66 // The thread-safe message filter is responsible for handling all the messages
66 // except for the routed permission-request-completed message, which will be 67 // except for the routed permission-request-completed message, which will be
67 // picked up by the RenderFrameImpl instead. 68 // picked up by the RenderFrameImpl instead.
68 return IPC_MESSAGE_CLASS(msg) == PlatformNotificationMsgStart && 69 return IPC_MESSAGE_CLASS(msg) == PlatformNotificationMsgStart &&
69 msg.type() != PlatformNotificationMsg_PermissionRequestComplete::ID; 70 msg.type() != PlatformNotificationMsg_PermissionRequestComplete::ID;
70 } 71 }
71 72
72 } // namespace content 73 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698