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

Unified Diff: content/child/notifications/notification_dispatcher.cc

Issue 1904163002: Move Web Notifications to use Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@skbitmap-blink
Patch Set: it works \o/ Created 4 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: content/child/notifications/notification_dispatcher.cc
diff --git a/content/child/notifications/notification_dispatcher.cc b/content/child/notifications/notification_dispatcher.cc
deleted file mode 100644
index f840b40e376700e85a392558b6f48ef93bfa0c83..0000000000000000000000000000000000000000
--- a/content/child/notifications/notification_dispatcher.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/child/notifications/notification_dispatcher.h"
-
-#include <limits>
-
-#include "content/child/notifications/notification_manager.h"
-
-namespace content {
-
-NotificationDispatcher::NotificationDispatcher(
- ThreadSafeSender* thread_safe_sender)
- : WorkerThreadMessageFilter(thread_safe_sender) {}
-
-NotificationDispatcher::~NotificationDispatcher() {}
-
-int NotificationDispatcher::GenerateNotificationId(int thread_id) {
- base::AutoLock lock(notification_id_map_lock_);
- CHECK_LT(next_notification_id_, std::numeric_limits<int>::max());
-
- notification_id_map_[next_notification_id_] = thread_id;
- return next_notification_id_++;
-}
-
-bool NotificationDispatcher::ShouldHandleMessage(
- const IPC::Message& msg) const {
- return IPC_MESSAGE_CLASS(msg) == PlatformNotificationMsgStart;
-}
-
-void NotificationDispatcher::OnFilteredMessageReceived(
- const IPC::Message& msg) {
- NotificationManager::ThreadSpecificInstance(thread_safe_sender(), this)
- ->OnMessageReceived(msg);
-}
-
-bool NotificationDispatcher::GetWorkerThreadIdForMessage(
- const IPC::Message& msg,
- int* ipc_thread_id) {
- int notification_id = -1;
- const bool success = base::PickleIterator(msg).ReadInt(&notification_id);
- DCHECK(success);
-
- base::AutoLock lock(notification_id_map_lock_);
- auto iterator = notification_id_map_.find(notification_id);
- if (iterator != notification_id_map_.end()) {
- *ipc_thread_id = iterator->second;
- return true;
- }
- return false;
-}
-
-} // namespace content
« no previous file with comments | « content/child/notifications/notification_dispatcher.h ('k') | content/child/notifications/notification_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698