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

Side by Side Diff: Source/modules/notifications/NotificationCenter.h

Issue 103083002: Decouple FileSystem and WebSQL callbacks from VoidCallback and it non-refcounted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/notifications/NotificationCenter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (!client()) { 61 if (!client()) {
62 exceptionState.throwUninformativeAndGenericDOMException(InvalidState Error); 62 exceptionState.throwUninformativeAndGenericDOMException(InvalidState Error);
63 return 0; 63 return 0;
64 } 64 }
65 return WebKitNotification::create(title, body, iconUrl, executionContext (), exceptionState, this); 65 return WebKitNotification::create(title, body, iconUrl, executionContext (), exceptionState, this);
66 } 66 }
67 67
68 NotificationClient* client() const { return m_client; } 68 NotificationClient* client() const { return m_client; }
69 69
70 int checkPermission(); 70 int checkPermission();
71 void requestPermission(PassRefPtr<VoidCallback> = 0); 71 void requestPermission(PassOwnPtr<VoidCallback> = nullptr);
72 72
73 virtual void stop() OVERRIDE; 73 virtual void stop() OVERRIDE;
74 74
75 private: 75 private:
76 NotificationCenter(ExecutionContext*, NotificationClient*); 76 NotificationCenter(ExecutionContext*, NotificationClient*);
77 77
78 class NotificationRequestCallback : public RefCounted<NotificationRequestCal lback> { 78 class NotificationRequestCallback : public RefCounted<NotificationRequestCal lback> {
79 public: 79 public:
80 static PassRefPtr<NotificationRequestCallback> createAndStartTimer(Notif icationCenter*, PassRefPtr<VoidCallback>); 80 static PassRefPtr<NotificationRequestCallback> createAndStartTimer(Notif icationCenter*, PassOwnPtr<VoidCallback>);
81 void startTimer(); 81 void startTimer();
82 void timerFired(Timer<NotificationRequestCallback>*); 82 void timerFired(Timer<NotificationRequestCallback>*);
83 private: 83 private:
84 NotificationRequestCallback(NotificationCenter*, PassRefPtr<VoidCallback >); 84 NotificationRequestCallback(NotificationCenter*, PassOwnPtr<VoidCallback >);
85 85
86 RefPtr<NotificationCenter> m_notificationCenter; 86 RefPtr<NotificationCenter> m_notificationCenter;
87 Timer<NotificationRequestCallback> m_timer; 87 Timer<NotificationRequestCallback> m_timer;
88 RefPtr<VoidCallback> m_callback; 88 OwnPtr<VoidCallback> m_callback;
89 }; 89 };
90 90
91 void requestTimedOut(NotificationRequestCallback*); 91 void requestTimedOut(NotificationRequestCallback*);
92 92
93 NotificationClient* m_client; 93 NotificationClient* m_client;
94 HashSet<RefPtr<NotificationRequestCallback> > m_callbacks; 94 HashSet<RefPtr<NotificationRequestCallback> > m_callbacks;
95 }; 95 };
96 96
97 } // namespace WebCore 97 } // namespace WebCore
98 98
99 #endif // ENABLE(LEGACY_NOTIFICATIONS) 99 #endif // ENABLE(LEGACY_NOTIFICATIONS)
100 100
101 #endif // NotificationCenter_h 101 #endif // NotificationCenter_h
OLDNEW
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/notifications/NotificationCenter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698