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

Unified Diff: remoting/client/jingle_host_connection.cc

Issue 2861047: Refactor the client code. Move all x11-related code into X11View and create... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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: remoting/client/jingle_host_connection.cc
===================================================================
--- remoting/client/jingle_host_connection.cc (revision 52921)
+++ remoting/client/jingle_host_connection.cc (working copy)
@@ -4,28 +4,26 @@
#include "base/message_loop.h"
#include "remoting/base/constants.h"
+#include "remoting/client/client_config.h"
#include "remoting/client/jingle_host_connection.h"
#include "remoting/jingle_glue/jingle_thread.h"
namespace remoting {
-JingleHostConnection::JingleHostConnection(JingleThread* network_thread)
- : network_thread_(network_thread),
+JingleHostConnection::JingleHostConnection(ClientContext* context)
+ : context_(context),
event_callback_(NULL) {
}
JingleHostConnection::~JingleHostConnection() {
}
-void JingleHostConnection::Connect(const std::string& username,
- const std::string& password,
- const std::string& host_jid,
+void JingleHostConnection::Connect(ClientConfig* config,
HostEventCallback* event_callback) {
message_loop()->PostTask(
FROM_HERE,
NewRunnableMethod(this, &JingleHostConnection::DoConnect,
- username, password, host_jid,
- event_callback));
+ config, event_callback));
}
void JingleHostConnection::Disconnect() {
@@ -105,20 +103,19 @@
}
MessageLoop* JingleHostConnection::message_loop() {
- return network_thread_->message_loop();
+ return context_->jingle_thread()->message_loop();
}
-void JingleHostConnection::DoConnect(const std::string& username,
- const std::string& auth_token,
- const std::string& host_jid,
+void JingleHostConnection::DoConnect(ClientConfig* config,
HostEventCallback* event_callback) {
DCHECK_EQ(message_loop(), MessageLoop::current());
event_callback_ = event_callback;
- jingle_client_ = new JingleClient(network_thread_);
- jingle_client_->Init(username, auth_token, kChromotingTokenServiceName, this);
- jingle_channel_ = jingle_client_->Connect(host_jid, this);
+ jingle_client_ = new JingleClient(context_->jingle_thread());
+ jingle_client_->Init(config->username(), config->auth_token(),
+ kChromotingTokenServiceName, this);
+ jingle_channel_ = jingle_client_->Connect(config->host_jid(), this);
}
void JingleHostConnection::DoDisconnect() {

Powered by Google App Engine
This is Rietveld 408576698