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

Unified Diff: net/http/http_stream_factory.h

Issue 8156001: net: rework the NPN patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 2 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: net/http/http_stream_factory.h
diff --git a/net/http/http_stream_factory.h b/net/http/http_stream_factory.h
index ef78a70e23ad6f4c93670d1d43c9a47275df4de1..f92c11e389a5b664d0d935529fca422fb8fa787b 100644
--- a/net/http/http_stream_factory.h
+++ b/net/http/http_stream_factory.h
@@ -7,6 +7,7 @@
#include <list>
#include <string>
+#include <vector>
#include "base/memory/ref_counted.h"
#include "base/string16.h"
@@ -180,8 +181,10 @@ class NET_EXPORT HttpStreamFactory {
// Turns spdy on or off.
static void set_spdy_enabled(bool value) {
spdy_enabled_ = value;
- if (value == false)
- set_next_protos("");
+ if (!spdy_enabled_) {
+ delete next_protos_;
+ next_protos_ = NULL;
+ }
}
static bool spdy_enabled() { return spdy_enabled_; }
@@ -211,11 +214,15 @@ class NET_EXPORT HttpStreamFactory {
static bool HasSpdyExclusion(const HostPortPair& endpoint);
// Sets the next protocol negotiation value used during the SSL handshake.
- static void set_next_protos(const std::string& value) {
- delete next_protos_;
- next_protos_ = new std::string(value);
+ static void set_next_protos(const std::vector<std::string>& value) {
+ if (!next_protos_)
+ next_protos_ = new std::vector<std::string>;
+ *next_protos_ = value;
+ }
+ static bool has_next_protos() { return next_protos_ != NULL; }
+ static const std::vector<std::string>& next_protos() {
+ return *next_protos_;
}
- static const std::string* next_protos() { return next_protos_; }
// Sets the HttpStreamFactoryImpl into a mode where it can ignore certificate
// errors. This is for testing.
@@ -235,7 +242,7 @@ class NET_EXPORT HttpStreamFactory {
static const HostMappingRules& host_mapping_rules();
static const HostMappingRules* host_mapping_rules_;
- static const std::string* next_protos_;
+ static std::vector<std::string>* next_protos_;
static bool spdy_enabled_;
static bool use_alternate_protocols_;
static bool force_spdy_over_ssl_;

Powered by Google App Engine
This is Rietveld 408576698