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

Unified Diff: content/renderer/active_notification_tracker.cc

Issue 740543003: Remove the old Web Notification code-path (Chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unittest references 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/active_notification_tracker.cc
diff --git a/content/renderer/active_notification_tracker.cc b/content/renderer/active_notification_tracker.cc
deleted file mode 100644
index 2a958a5877d5f2c391dd739159b33cd4b19662dc..0000000000000000000000000000000000000000
--- a/content/renderer/active_notification_tracker.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2011 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/renderer/active_notification_tracker.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
-#include "third_party/WebKit/public/web/WebNotification.h"
-
-using blink::WebNotification;
-
-namespace content {
-
-ActiveNotificationTracker::ActiveNotificationTracker() {}
-
-ActiveNotificationTracker::~ActiveNotificationTracker() {}
-
-bool ActiveNotificationTracker::GetId(
- const WebNotification& notification, int& id) {
- ReverseTable::iterator iter = reverse_notification_table_.find(notification);
- if (iter == reverse_notification_table_.end())
- return false;
- id = iter->second;
- return true;
-}
-
-bool ActiveNotificationTracker::GetNotification(
- int id, WebNotification* notification) {
- WebNotification* lookup = notification_table_.Lookup(id);
- if (!lookup)
- return false;
-
- *notification = *lookup;
- return true;
-}
-
-int ActiveNotificationTracker::RegisterNotification(
- const blink::WebNotification& proxy) {
- if (reverse_notification_table_.find(proxy)
- != reverse_notification_table_.end()) {
- return reverse_notification_table_[proxy];
- } else {
- WebNotification* notification = new WebNotification(proxy);
- int id = notification_table_.Add(notification);
- reverse_notification_table_[proxy] = id;
- return id;
- }
-}
-
-void ActiveNotificationTracker::UnregisterNotification(int id) {
- // We want to free the notification after removing it from the table.
- scoped_ptr<WebNotification> notification(notification_table_.Lookup(id));
- notification_table_.Remove(id);
- DCHECK(notification.get());
- if (notification)
- reverse_notification_table_.erase(*notification);
-}
-
-void ActiveNotificationTracker::Clear() {
- while (!reverse_notification_table_.empty()) {
- ReverseTable::iterator iter = reverse_notification_table_.begin();
- UnregisterNotification((*iter).second);
- }
-}
-
-} // namespace content
« no previous file with comments | « content/renderer/active_notification_tracker.h ('k') | content/renderer/active_notification_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698