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

Unified Diff: chrome/browser/notifications/notification_object_proxy.h

Issue 433273002: NotificationObjectProxy should own the DesktopNotificationDelegateImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pass as scoped_ptr Created 6 years, 4 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: chrome/browser/notifications/notification_object_proxy.h
diff --git a/chrome/browser/notifications/notification_object_proxy.h b/chrome/browser/notifications/notification_object_proxy.h
index 9870ac10e3de40266392f50e78a87bcbc3961638..a6014b0075ae283fc1e798b27738f2779a829b8f 100644
--- a/chrome/browser/notifications/notification_object_proxy.h
+++ b/chrome/browser/notifications/notification_object_proxy.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/memory/scoped_ptr.h"
#include "chrome/browser/notifications/notification_delegate.h"
namespace content {
@@ -21,9 +22,11 @@ class RenderFrameHost;
class NotificationObjectProxy
: public NotificationDelegate {
public:
- // Creates a Proxy object with the necessary callback information.
- NotificationObjectProxy(content::RenderFrameHost* render_frame_host,
- content::DesktopNotificationDelegate* delegate);
+ // Creates a Proxy object with the necessary callback information. The Proxy
+ // will take ownership of |delegate|.
+ NotificationObjectProxy(
+ content::RenderFrameHost* render_frame_host,
+ scoped_ptr<content::DesktopNotificationDelegate> delegate);
// NotificationDelegate implementation.
virtual void Display() OVERRIDE;
@@ -37,13 +40,13 @@ class NotificationObjectProxy
protected:
friend class base::RefCountedThreadSafe<NotificationObjectProxy>;
- virtual ~NotificationObjectProxy() {}
+ virtual ~NotificationObjectProxy();
private:
// Callback information to find the JS Notification object where it lives.
int render_process_id_;
int render_frame_id_;
- content::DesktopNotificationDelegate* delegate_;
+ scoped_ptr<content::DesktopNotificationDelegate> delegate_;
bool displayed_;
std::string id_;
};
« no previous file with comments | « chrome/browser/notifications/notification_browsertest.cc ('k') | chrome/browser/notifications/notification_object_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698