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

Side by Side Diff: content/renderer/active_notification_tracker.cc

Issue 14081010: Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some gtk issues Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/active_notification_tracker.h" 5 #include "content/renderer/active_notification_tracker.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotification.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotification.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPermis sionCallback.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPermis sionCallback.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 reverse_notification_table_[proxy] = id; 48 reverse_notification_table_[proxy] = id;
49 return id; 49 return id;
50 } 50 }
51 } 51 }
52 52
53 void ActiveNotificationTracker::UnregisterNotification(int id) { 53 void ActiveNotificationTracker::UnregisterNotification(int id) {
54 // We want to free the notification after removing it from the table. 54 // We want to free the notification after removing it from the table.
55 scoped_ptr<WebNotification> notification(notification_table_.Lookup(id)); 55 scoped_ptr<WebNotification> notification(notification_table_.Lookup(id));
56 notification_table_.Remove(id); 56 notification_table_.Remove(id);
57 DCHECK(notification.get()); 57 DCHECK(notification.get());
58 if (notification.get()) 58 if (notification)
59 reverse_notification_table_.erase(*notification); 59 reverse_notification_table_.erase(*notification);
60 } 60 }
61 61
62 void ActiveNotificationTracker::Clear() { 62 void ActiveNotificationTracker::Clear() {
63 while (!reverse_notification_table_.empty()) { 63 while (!reverse_notification_table_.empty()) {
64 ReverseTable::iterator iter = reverse_notification_table_.begin(); 64 ReverseTable::iterator iter = reverse_notification_table_.begin();
65 UnregisterNotification((*iter).second); 65 UnregisterNotification((*iter).second);
66 } 66 }
67 } 67 }
68 68
(...skipping 15 matching lines...) Expand all
84 int ActiveNotificationTracker::RegisterPermissionRequest( 84 int ActiveNotificationTracker::RegisterPermissionRequest(
85 WebNotificationPermissionCallback* callback) { 85 WebNotificationPermissionCallback* callback) {
86 return callback_table_.Add(callback); 86 return callback_table_.Add(callback);
87 } 87 }
88 88
89 void ActiveNotificationTracker::OnPermissionRequestComplete(int id) { 89 void ActiveNotificationTracker::OnPermissionRequestComplete(int id) {
90 callback_table_.Remove(id); 90 callback_table_.Remove(id);
91 } 91 }
92 92
93 } // namespace content 93 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/test_renderer_host.cc ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698