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

Unified Diff: net/quic/quic_ack_notifier.h

Issue 127633002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | net/quic/quic_ack_notifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_ack_notifier.h
diff --git a/net/quic/quic_ack_notifier.h b/net/quic/quic_ack_notifier.h
index 5ec92134e78ef650b0d97c93a2503cb5306bd192..48c8375219fb0142457239584fdbefe3078b570a 100644
--- a/net/quic/quic_ack_notifier.h
+++ b/net/quic/quic_ack_notifier.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_QUIC_ACK_NOTIFIER_H_
#define NET_QUIC_QUIC_ACK_NOTIFIER_H_
+#include "base/memory/ref_counted.h"
#include "net/quic/quic_protocol.h"
namespace net {
@@ -16,13 +17,20 @@ namespace net {
// trigger a call to a provided Closure.
class NET_EXPORT_PRIVATE QuicAckNotifier {
public:
- class NET_EXPORT_PRIVATE DelegateInterface {
+ class NET_EXPORT_PRIVATE DelegateInterface
+ : public base::RefCounted<DelegateInterface> {
public:
DelegateInterface();
- virtual ~DelegateInterface();
virtual void OnAckNotification() = 0;
+
+ protected:
+ friend class base::RefCounted<DelegateInterface>;
+
+ // Delegates are ref counted.
+ virtual ~DelegateInterface();
};
+ // QuicAckNotifier is expected to keep its own reference to the delegate.
explicit QuicAckNotifier(DelegateInterface* delegate);
virtual ~QuicAckNotifier();
@@ -55,7 +63,7 @@ class NET_EXPORT_PRIVATE QuicAckNotifier {
// The delegate's OnAckNotification() method will be called once we have been
// notified of ACKs for all the sequence numbers we are tracking.
// This is not owned by OnAckNotifier and must outlive it.
- DelegateInterface* delegate_;
+ scoped_refptr<DelegateInterface> delegate_;
// Set of sequence numbers this notifier is waiting to hear about. The
// delegate will not be called until this is an empty set.
« no previous file with comments | « no previous file | net/quic/quic_ack_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698