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

Unified Diff: blimp/client/public/session/assignment.cc

Issue 2211613002: Add AssignmentSource to BlimpClientContextImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge origin/master Created 4 years, 4 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
« no previous file with comments | « blimp/client/public/session/assignment.h ('k') | blimp/client/session/blimp_client_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/public/session/assignment.cc
diff --git a/blimp/client/public/session/assignment.cc b/blimp/client/public/session/assignment.cc
new file mode 100644
index 0000000000000000000000000000000000000000..333875fb2e07f0f8259853e2508ba73c84472225
--- /dev/null
+++ b/blimp/client/public/session/assignment.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "blimp/client/public/session/assignment.h"
+
+#include "net/cert/x509_certificate.h"
+
+namespace blimp {
+namespace client {
+
+Assignment::Assignment() : transport_protocol(TransportProtocol::UNKNOWN) {}
+
+Assignment::Assignment(const Assignment& other) = default;
+
+Assignment::~Assignment() {}
+
+bool Assignment::IsValid() const {
+ if (engine_endpoint.address().empty() || engine_endpoint.port() == 0 ||
+ transport_protocol == TransportProtocol::UNKNOWN) {
+ return false;
+ }
+ if (transport_protocol == TransportProtocol::SSL && !cert) {
+ return false;
+ }
+ return true;
+}
+
+} // namespace client
+} // namespace blimp
« no previous file with comments | « blimp/client/public/session/assignment.h ('k') | blimp/client/session/blimp_client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698