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

Unified Diff: remoting/protocol/connection_to_client.cc

Issue 9433027: Delete Session and SessionManager object synchronously. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/protocol/fake_authenticator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_client.cc
diff --git a/remoting/protocol/connection_to_client.cc b/remoting/protocol/connection_to_client.cc
index 69b16248b0a0c1b126f4d9cdc2a40f870fb50d1e..b88cb06c4301b566be4940fcf93ed751d31ac72a 100644
--- a/remoting/protocol/connection_to_client.cc
+++ b/remoting/protocol/connection_to_client.cc
@@ -31,10 +31,6 @@ ConnectionToClient::ConnectionToClient(protocol::Session* session)
}
ConnectionToClient::~ConnectionToClient() {
- if (session_.get()) {
- base::MessageLoopProxy::current()->DeleteSoon(
- FROM_HERE, session_.release());
- }
}
void ConnectionToClient::SetEventHandler(EventHandler* event_handler) {
@@ -53,12 +49,7 @@ void ConnectionToClient::Disconnect() {
CloseChannels();
DCHECK(session_.get());
- Session* session = session_.release();
-
- // It may not be safe to delete |session_| here becase this method
- // may be invoked in resonse to a libjingle event and libjingle's
- // sigslot doesn't handle it properly, so postpone the deletion.
- base::MessageLoopProxy::current()->DeleteSoon(FROM_HERE, session);
+ scoped_ptr<Session> session = session_.Pass();
// This should trigger OnConnectionClosed() event and this object
// may be destroyed as the result.
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/protocol/fake_authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698