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

Unified Diff: net/websockets/websocket_extension.cc

Issue 23872029: Implement WebSocketExtensionParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 | « net/websockets/websocket_extension.h ('k') | net/websockets/websocket_extension_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_extension.cc
diff --git a/net/websockets/websocket_extension.cc b/net/websockets/websocket_extension.cc
new file mode 100644
index 0000000000000000000000000000000000000000..edcd8e8657fbbcaa09ffc2234b305e44ec6b13d6
--- /dev/null
+++ b/net/websockets/websocket_extension.cc
@@ -0,0 +1,43 @@
+// Copyright 2013 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 "net/websockets/websocket_extension.h"
+
+#include <string>
+
+#include "base/logging.h"
+
+namespace net {
+
+WebSocketExtension::Parameter::Parameter(const std::string& name)
+ : name_(name) {}
+
+WebSocketExtension::Parameter::Parameter(const std::string& name,
+ const std::string& value)
+ : name_(name), value_(value) {
+ DCHECK(!value.empty());
+}
+
+bool WebSocketExtension::Parameter::Equals(const Parameter& other) const {
+ return name_ == other.name_ && value_ == other.value_;
+}
+
+WebSocketExtension::WebSocketExtension() {}
+
+WebSocketExtension::WebSocketExtension(const std::string& name)
+ : name_(name) {}
+
+WebSocketExtension::~WebSocketExtension() {}
+
+bool WebSocketExtension::Equals(const WebSocketExtension& other) const {
+ if (name_ != other.name_) return false;
+ if (parameters_.size() != other.parameters_.size()) return false;
+ for (size_t i = 0; i < other.parameters_.size(); ++i) {
+ if (!parameters_[i].Equals(other.parameters_[i]))
+ return false;
+ }
+ return true;
+}
+
+} // namespace net
« no previous file with comments | « net/websockets/websocket_extension.h ('k') | net/websockets/websocket_extension_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698