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

Side by Side Diff: content/child/notifications/pending_notifications_tracker.h

Issue 1634933006: Use NotificationResources instead of a bare SkBitmap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests. Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_ 5 #ifndef CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_
6 #define CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_ 6 #define CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/id_map.h" 10 #include "base/id_map.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati onManager.h"
16 15
17 class SkBitmap; 16 class SkBitmap;
18 17
19 namespace base { 18 namespace base {
20 class SingleThreadTaskRunner; 19 class SingleThreadTaskRunner;
21 } 20 }
22 21
23 namespace blink { 22 namespace blink {
24 struct WebNotificationData; 23 struct WebNotificationData;
25 class WebNotificationDelegate; 24 class WebNotificationDelegate;
26 } 25 }
27 26
28 namespace content { 27 namespace content {
29 28
30 class NotificationImageLoader; 29 class NotificationImageLoader;
31 class NotificationManager; 30 struct NotificationResources;
32 31
33 // Type definition for the callback signature which is to be invoked when the 32 // Type definition for the callback signature which is to be invoked when the
34 // resources associated with a notification have been fetched. 33 // resources associated with a notification have been fetched.
35 using NotificationResourcesFetchedCallback = 34 using NotificationResourcesFetchedCallback =
36 base::Callback<void(const SkBitmap&)>; 35 base::Callback<void(const NotificationResources&)>;
37 36
38 // Tracks all aspects of all pending Web Notifications. Most notably, it's in 37 // Tracks all aspects of all pending Web Notifications. Most notably, it's in
39 // charge of ensuring that all resource fetches associated with the notification 38 // charge of ensuring that all resource fetches associated with the notification
40 // are completed as expected. The data associated with the notifications is 39 // are completed as expected. The data associated with the notifications is
41 // stored in this class, to maintain thread integrity of their members. 40 // stored in this class, to maintain thread integrity of their members.
42 // 41 //
43 // The pending notification tracker is owned by the NotificationManager, and 42 // The pending notification tracker is owned by the NotificationManager, and
44 // lives on the thread that manager has been associated with. 43 // lives on the thread that manager has been associated with.
45 class PendingNotificationsTracker { 44 class PendingNotificationsTracker {
46 public: 45 public:
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 std::map<blink::WebNotificationDelegate*, int> delegate_to_pending_id_map_; 96 std::map<blink::WebNotificationDelegate*, int> delegate_to_pending_id_map_;
98 97
99 base::WeakPtrFactory<PendingNotificationsTracker> weak_factory_; 98 base::WeakPtrFactory<PendingNotificationsTracker> weak_factory_;
100 99
101 DISALLOW_COPY_AND_ASSIGN(PendingNotificationsTracker); 100 DISALLOW_COPY_AND_ASSIGN(PendingNotificationsTracker);
102 }; 101 };
103 102
104 } // namespace content 103 } // namespace content
105 104
106 #endif // CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_ 105 #endif // CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATIONS_TRACKER_H_
OLDNEW
« no previous file with comments | « content/child/notifications/notification_manager.cc ('k') | content/child/notifications/pending_notifications_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698