| OLD | NEW |
| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "content/child/notifications/notification_manager.h" | 9 #include "content/child/notifications/notification_manager.h" |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 const IPC::Message& msg) { | 34 const IPC::Message& msg) { |
| 35 NotificationManager::ThreadSpecificInstance(thread_safe_sender(), | 35 NotificationManager::ThreadSpecificInstance(thread_safe_sender(), |
| 36 main_thread_task_runner(), | 36 main_thread_task_runner(), |
| 37 this)->OnMessageReceived(msg); | 37 this)->OnMessageReceived(msg); |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool NotificationDispatcher::GetWorkerThreadIdForMessage( | 40 bool NotificationDispatcher::GetWorkerThreadIdForMessage( |
| 41 const IPC::Message& msg, | 41 const IPC::Message& msg, |
| 42 int* ipc_thread_id) { | 42 int* ipc_thread_id) { |
| 43 int notification_id = -1; | 43 int notification_id = -1; |
| 44 const bool success = PickleIterator(msg).ReadInt(¬ification_id); | 44 const bool success = base::PickleIterator(msg).ReadInt(¬ification_id); |
| 45 DCHECK(success); | 45 DCHECK(success); |
| 46 | 46 |
| 47 base::AutoLock lock(notification_id_map_lock_); | 47 base::AutoLock lock(notification_id_map_lock_); |
| 48 auto iterator = notification_id_map_.find(notification_id); | 48 auto iterator = notification_id_map_.find(notification_id); |
| 49 if (iterator != notification_id_map_.end()) { | 49 if (iterator != notification_id_map_.end()) { |
| 50 *ipc_thread_id = iterator->second; | 50 *ipc_thread_id = iterator->second; |
| 51 return true; | 51 return true; |
| 52 } | 52 } |
| 53 return false; | 53 return false; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace content | 56 } // namespace content |
| OLD | NEW |