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

Unified Diff: blimp/net/client_connection_manager.cc

Issue 1501463003: [Blimp Net] Client sends START_CONNECTION message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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
« blimp/common/protocol_version.cc ('K') | « blimp/net/client_connection_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/client_connection_manager.cc
diff --git a/blimp/net/client_connection_manager.cc b/blimp/net/client_connection_manager.cc
index c8238e4ba70f318330567a20753566e81ba04e20..2ce6938d5c9f47ed765e3d7ddbccf4a9e1a1cb84 100644
--- a/blimp/net/client_connection_manager.cc
+++ b/blimp/net/client_connection_manager.cc
@@ -5,7 +5,11 @@
#include "blimp/net/client_connection_manager.h"
#include "base/logging.h"
+#include "blimp/common/create_blimp_message.h"
+#include "blimp/common/proto/blimp_message.pb.h"
+#include "blimp/common/protocol_version.h"
#include "blimp/net/blimp_connection.h"
+#include "blimp/net/blimp_message_processor.h"
#include "blimp/net/blimp_transport.h"
#include "blimp/net/connection_handler.h"
#include "net/base/net_errors.h"
@@ -48,7 +52,9 @@ void ClientConnectionManager::OnConnectResult(int transport_index, int result) {
DCHECK_NE(result, net::ERR_IO_PENDING);
const auto& transport = transports_[transport_index];
if (result == net::OK) {
- connection_handler_->HandleConnection(transport->TakeConnection());
+ scoped_ptr<BlimpConnection> connection = transport->TakeConnection();
+ SendAuthenticationMessage(connection.get());
+ connection_handler_->HandleConnection(std::move(connection));
} else {
DVLOG(1) << "Transport " << transport->GetName()
<< " failed to connect:" << net::ErrorToString(result);
@@ -56,4 +62,13 @@ void ClientConnectionManager::OnConnectResult(int transport_index, int result) {
}
}
+void ClientConnectionManager::SendAuthenticationMessage(
+ BlimpConnection* connection) {
+ // TODO(haibinlu): get client token.
+ const char* client_token = "token";
Wez 2015/12/09 02:30:03 Sorry, I missed that this was the production code
haibinlu 2015/12/09 19:40:34 Done.
+ connection->GetOutgoingMessageProcessor()->ProcessMessage(
+ CreateStartConnectionMessage(client_token, kProtocolVersion),
+ net::CompletionCallback());
+}
+
} // namespace blimp
« blimp/common/protocol_version.cc ('K') | « blimp/net/client_connection_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698