| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_network_layer.h" | 5 #include "net/http/http_network_layer.h" |
| 6 | 6 |
| 7 #include "base/field_trial.h" | 7 #include "base/field_trial.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "net/http/http_network_session.h" | 10 #include "net/http/http_network_session.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 static const char kEnableNpnHttpOnly[] = "npn-http"; | 144 static const char kEnableNpnHttpOnly[] = "npn-http"; |
| 145 | 145 |
| 146 // Except for the first element, the order is irrelevant. First element | 146 // Except for the first element, the order is irrelevant. First element |
| 147 // specifies the fallback in case nothing matches | 147 // specifies the fallback in case nothing matches |
| 148 // (SSLClientSocket::kNextProtoNoOverlap). Otherwise, the SSL library | 148 // (SSLClientSocket::kNextProtoNoOverlap). Otherwise, the SSL library |
| 149 // will choose the first overlapping protocol in the server's list, since | 149 // will choose the first overlapping protocol in the server's list, since |
| 150 // it presumedly has a better understanding of which protocol we should | 150 // it presumedly has a better understanding of which protocol we should |
| 151 // use, therefore the rest of the ordering here is not important. | 151 // use, therefore the rest of the ordering here is not important. |
| 152 static const char kNpnProtosFull[] = "\x08http/1.1\x06spdy/2"; | 152 static const char kNpnProtosFull[] = "\x08http/1.1\x06spdy/2"; |
| 153 // This is a temporary hack to pretend we support version 1. | 153 // This is a temporary hack to pretend we support version 1. |
| 154 static const char kNpnProtosFullV1[] = "\x08http/1.1\x06spdy/1\x06spdy/2"; | 154 static const char kNpnProtosFullV1[] = "\x08http/1.1\x06spdy/1"; |
| 155 // No spdy specified. | 155 // No spdy specified. |
| 156 static const char kNpnProtosHttpOnly[] = "\x08http/1.1\x07http1.1"; | 156 static const char kNpnProtosHttpOnly[] = "\x08http/1.1\x07http1.1"; |
| 157 | 157 |
| 158 std::vector<std::string> spdy_options; | 158 std::vector<std::string> spdy_options; |
| 159 SplitString(mode, ',', &spdy_options); | 159 SplitString(mode, ',', &spdy_options); |
| 160 | 160 |
| 161 bool use_alt_protocols = true; | 161 bool use_alt_protocols = true; |
| 162 | 162 |
| 163 for (std::vector<std::string>::iterator it = spdy_options.begin(); | 163 for (std::vector<std::string>::iterator it = spdy_options.begin(); |
| 164 it != spdy_options.end(); ++it) { | 164 it != spdy_options.end(); ++it) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 189 } else if (option == kEnableFlowControl) { | 189 } else if (option == kEnableFlowControl) { |
| 190 SpdySession::SetFlowControl(true); | 190 SpdySession::SetFlowControl(true); |
| 191 } else if (option.empty() && it == spdy_options.begin()) { | 191 } else if (option.empty() && it == spdy_options.begin()) { |
| 192 continue; | 192 continue; |
| 193 } else { | 193 } else { |
| 194 LOG(DFATAL) << "Unrecognized spdy option: " << option; | 194 LOG(DFATAL) << "Unrecognized spdy option: " << option; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 } // namespace net | 198 } // namespace net |
| OLD | NEW |