summaryrefslogtreecommitdiffstats
path: root/remoting/jingle_glue
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 00:05:47 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 00:05:47 +0000
commit640e4569f6e0ebf1ad3107791a3c94d026dcecfd (patch)
tree4c294955b031f478abed54bc26d32a31e21846cb /remoting/jingle_glue
parentc9336d2894620ea2fb48fd658dc1d26ef6b30ed1 (diff)
downloadchromium_src-640e4569f6e0ebf1ad3107791a3c94d026dcecfd.zip
chromium_src-640e4569f6e0ebf1ad3107791a3c94d026dcecfd.tar.gz
chromium_src-640e4569f6e0ebf1ad3107791a3c94d026dcecfd.tar.bz2
Start chromoting host in the service process though a method call
This change exposes method calls to configure the chromoting host and allow it to be started from a method. This will allow us to use IPC message to start the chromoting host. TEST=unit_tests --gtest_filter=ServiceProcess* BUG=50243, 50244 Review URL: http://codereview.chromium.org/3084024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/jingle_glue')
-rw-r--r--remoting/jingle_glue/jingle_client.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/remoting/jingle_glue/jingle_client.cc b/remoting/jingle_glue/jingle_client.cc
index eb89e21..b3ea334 100644
--- a/remoting/jingle_glue/jingle_client.cc
+++ b/remoting/jingle_glue/jingle_client.cc
@@ -76,6 +76,11 @@ void JingleClient::DoConnect(scoped_refptr<JingleChannel> channel,
}
void JingleClient::Close() {
+ // Once we are closed we really shouldn't talk to the callback again. In the
+ // case when JingleClient outlives the owner access the callback is not safe.
+ // TODO(hclam): We need to lock to reset callback.
+ callback_ = NULL;
+
message_loop()->PostTask(
FROM_HERE, NewRunnableMethod(this, &JingleClient::DoClose));
}
@@ -85,12 +90,14 @@ void JingleClient::DoClose() {
// If we have not yet initialized and the client is already closed then
// don't close again.
- if (!callback_ || state_ == CLOSED)
+ if (state_ == CLOSED)
return;
- client_->Disconnect();
- // Client is deleted by TaskRunner.
- client_ = NULL;
+ if (client_) {
+ client_->Disconnect();
+ // Client is deleted by TaskRunner.
+ client_ = NULL;
+ }
tunnel_session_client_.reset();
port_allocator_.reset();
session_manager_.reset();