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

Unified Diff: blimp/engine/session/blimp_engine_session.cc

Issue 2462183002: GRPC Stream implementation of HeliumStream
Patch Set: Fixed a few minor comments Created 4 years, 1 month 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/engine/session/blimp_engine_session.cc
diff --git a/blimp/engine/session/blimp_engine_session.cc b/blimp/engine/session/blimp_engine_session.cc
index aee2e39dcccd3944fc1ecd4a08eeeeb323cbdcfe..dd9823237d4f873cd8c3bcae39bc0f6bcb739619 100644
--- a/blimp/engine/session/blimp_engine_session.cc
+++ b/blimp/engine/session/blimp_engine_session.cc
@@ -37,6 +37,7 @@
#include "blimp/net/common.h"
#include "blimp/net/engine_authentication_handler.h"
#include "blimp/net/engine_connection_manager.h"
+#include "blimp/net/grpc_engine_transport.h"
#include "blimp/net/null_blimp_message_processor.h"
#include "blimp/net/tcp_engine_transport.h"
#include "blimp/net/thread_pipe_manager.h"
@@ -72,9 +73,6 @@ const int kDefaultDisplayWidth = 800;
const int kDefaultDisplayHeight = 600;
const uint16_t kDefaultPort = 25467;
-const char kTcpTransport[] = "tcp";
-const char kGrpcTransport[] = "grpc";
-
// Focus rules that support activating an child window.
class FocusRulesImpl : public wm::BaseFocusRules {
public:
@@ -156,9 +154,7 @@ class EngineNetworkComponents : public ConnectionHandler,
base::WeakPtr<BlobChannelSender> blob_channel_sender,
const std::string& client_token);
- // TODO(perumaal): Remove this once gRPC support is ready.
- // See crbug.com/659279.
- uint16_t GetPortForTesting() { return port_; }
+ AssignmentOptions GetAssignmentOptions() { return assignment_options_; }
BrowserConnectionHandler* connection_handler() {
return &connection_handler_;
@@ -178,7 +174,7 @@ class EngineNetworkComponents : public ConnectionHandler,
void OnConnectionError(int error) override;
net::NetLog* net_log_;
- uint16_t port_ = 0;
+ AssignmentOptions assignment_options_;
BrowserConnectionHandler connection_handler_;
std::unique_ptr<EngineAuthenticationHandler> authentication_handler_;
@@ -215,13 +211,13 @@ void EngineNetworkComponents::Initialize(
base::MakeUnique<BlobChannelService>(blob_channel_sender, ui_task_runner);
// Adds BlimpTransports to connection_manager_.
- net::IPEndPoint address(GetListeningAddress(), GetListeningPort());
- connection_manager_->ConnectTransport(&address, GetTransportType());
- port_ = address.port();
-
+ assignment_options_.engine_endpoint =
+ net::IPEndPoint(GetListeningAddress(), GetListeningPort());
+ connection_manager_->ConnectTransport(&assignment_options_,
+ GetTransportType());
// Print the engine port for client_engine_integration script, please do not
// remove this log.
- DVLOG(1) << "Engine port #: " << port_;
+ DVLOG(1) << "Engine port #: " << assignment_options_.engine_endpoint.port();
}
void EngineNetworkComponents::HandleConnection(
@@ -324,11 +320,11 @@ BlobChannelService* BlimpEngineSession::GetBlobChannelService() {
return net_components_->blob_channel_service();
}
-void BlimpEngineSession::GetEnginePortForTesting(
- const GetPortCallback& callback) {
+void BlimpEngineSession::GetAssignmentOptions(
+ const GetAssignmentOptionsCallback& callback) {
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
- base::Bind(&EngineNetworkComponents::GetPortForTesting,
+ base::Bind(&EngineNetworkComponents::GetAssignmentOptions,
base::Unretained(net_components_.get())),
callback);
}

Powered by Google App Engine
This is Rietveld 408576698