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

Unified Diff: blimp/client/session/blimp_client_session.cc

Issue 1696563002: Blimp: add support for SSL connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address remaining rsleevi feedback items Created 4 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
Index: blimp/client/session/blimp_client_session.cc
diff --git a/blimp/client/session/blimp_client_session.cc b/blimp/client/session/blimp_client_session.cc
index 29c0b32b28703cecc197fbd6a7aa36226a1c4875..1c607a2f72bf291981d3fc9055fc1e782dd70f9a 100644
--- a/blimp/client/session/blimp_client_session.cc
+++ b/blimp/client/session/blimp_client_session.cc
@@ -22,6 +22,7 @@
#include "blimp/net/client_connection_manager.h"
#include "blimp/net/common.h"
#include "blimp/net/null_blimp_message_processor.h"
+#include "blimp/net/ssl_client_transport.h"
#include "blimp/net/tcp_client_transport.h"
#include "net/base/address_list.h"
#include "net/base/ip_address.h"
@@ -66,7 +67,6 @@ class ClientNetworkComponents {
// they are used from the UI thread.
std::vector<scoped_ptr<BlimpMessageThreadPipe>> outgoing_pipes_;
std::vector<scoped_ptr<BlimpMessageProcessor>> outgoing_message_processors_;
-
DISALLOW_COPY_AND_ASSIGN(ClientNetworkComponents);
};
@@ -81,8 +81,21 @@ void ClientNetworkComponents::ConnectWithAssignment(
DCHECK(connection_manager_);
connection_manager_->set_client_token(assignment.client_token);
- connection_manager_->AddTransport(make_scoped_ptr(new TCPClientTransport(
- net::AddressList(assignment.ip_endpoint), nullptr)));
+ switch (assignment.transport_protocol) {
+ case Assignment::SSL: {
+ DCHECK(assignment.cert);
+ connection_manager_->AddTransport(make_scoped_ptr(new SSLClientTransport(
+ assignment.ip_endpoint, assignment.cert, nullptr)));
+ } break;
Ryan Sleevi 2016/02/23 00:49:45 Did you git cl format this? I have never seen this
Kevin M 2016/02/23 01:58:25 Yes, this is output from git cl format. Removed th
+ case Assignment::TCP: {
+ connection_manager_->AddTransport(make_scoped_ptr(
+ new TCPClientTransport(assignment.ip_endpoint, nullptr)));
+ } break;
+ default:
+ DLOG(FATAL) << "No support for transport "
+ << assignment.transport_protocol << ".";
+ break;
+ }
connection_manager_->Connect();
}
@@ -118,8 +131,7 @@ BlimpClientSession::BlimpClientSession()
options.message_loop_type = base::MessageLoop::TYPE_IO;
io_thread_.StartWithOptions(options);
- assignment_source_.reset(new AssignmentSource(
- base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner()));
+ assignment_source_.reset(new AssignmentSource(io_thread_.task_runner()));
// Register features' message senders and receivers.
tab_control_feature_->set_outgoing_message_processor(

Powered by Google App Engine
This is Rietveld 408576698