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

Unified Diff: jingle/glue/pseudotcp_adapter.h

Issue 7040021: Fix crash condition if caller deletes PseudoTcpAdaptor from within a callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make it safe to delete PseudoTcpAdapter from callbacks. Created 9 years, 7 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 | jingle/glue/pseudotcp_adapter.cc » ('j') | jingle/glue/pseudotcp_adapter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/glue/pseudotcp_adapter.h
diff --git a/jingle/glue/pseudotcp_adapter.h b/jingle/glue/pseudotcp_adapter.h
index 35df8ce91aff96bf6bd1ef200d20647379df36da..df731953c4014f2f7e28e714340b86a0c81e8813 100644
--- a/jingle/glue/pseudotcp_adapter.h
+++ b/jingle/glue/pseudotcp_adapter.h
@@ -17,9 +17,7 @@
namespace jingle_glue {
-class PseudoTcpAdapter : public net::StreamSocket,
- public cricket::IPseudoTcpNotify,
- public base::NonThreadSafe {
+class PseudoTcpAdapter : public net::StreamSocket, base::NonThreadSafe {
Sergey Ulanov 2011/05/20 22:01:40 Please add some comments explaining lifetime of th
Wez 2011/05/21 08:10:55 Done.
public:
// Creates adapter for the specified |socket|. |socket| is assumed
// to be already connected. Takes ownership of |socket|.
@@ -47,43 +45,10 @@ class PseudoTcpAdapter : public net::StreamSocket,
virtual bool WasEverUsed() const OVERRIDE;
virtual bool UsingTCPFastOpen() const OVERRIDE;
- // cricket::IPseudoTcpNotify implementation.
- virtual void OnTcpOpen(cricket::PseudoTcp* tcp) OVERRIDE;
- virtual void OnTcpReadable(cricket::PseudoTcp* tcp) OVERRIDE;
- virtual void OnTcpWriteable(cricket::PseudoTcp* tcp) OVERRIDE;
- virtual void OnTcpClosed(cricket::PseudoTcp* tcp, uint32 error) OVERRIDE;
- virtual WriteResult TcpWritePacket(cricket::PseudoTcp* tcp,
- const char* buffer, size_t len) OVERRIDE;
-
private:
- void DoReadFromSocket();
- void HandleReadResults(int result);
-
- // Callback functions for Read() and Write() in |socket_|
- void OnRead(int result);
- void OnWritten(int result);
-
- void AdjustClock();
- void HandleTcpClock();
-
- scoped_ptr<net::Socket> socket_;
- cricket::PseudoTcp pseudotcp_;
-
- net::CompletionCallback* connect_callback_;
- scoped_refptr<net::IOBuffer> read_buffer_;
- int read_buffer_size_;
- net::CompletionCallback* read_callback_;
- scoped_refptr<net::IOBuffer> write_buffer_;
- int write_buffer_size_;
- net::CompletionCallback* write_callback_;
-
- bool socket_write_pending_;
- scoped_refptr<net::IOBuffer> socket_read_buffer_;
-
- net::CompletionCallbackImpl<PseudoTcpAdapter> socket_read_callback_;
- net::CompletionCallbackImpl<PseudoTcpAdapter> socket_write_callback_;
+ class Core;
- base::OneShotTimer<PseudoTcpAdapter> timer_;
+ scoped_refptr<Core> core_;
net::BoundNetLog net_log_;
« no previous file with comments | « no previous file | jingle/glue/pseudotcp_adapter.cc » ('j') | jingle/glue/pseudotcp_adapter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698