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

Side by Side Diff: net/spdy/spdy_http_utils.cc

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply fixups Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « net/socket/socks_client_socket.cc ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/spdy/spdy_http_utils.h" 5 #include "net/spdy/spdy_http_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 (*headers)[status_key] = std::string(after_version + 1, status_line.end()); 153 (*headers)[status_key] = std::string(after_version + 1, status_line.end());
154 154
155 void* iter = NULL; 155 void* iter = NULL;
156 std::string raw_name, value; 156 std::string raw_name, value;
157 while (response_headers.EnumerateHeaderLines(&iter, &raw_name, &value)) { 157 while (response_headers.EnumerateHeaderLines(&iter, &raw_name, &value)) {
158 std::string name = base::StringToLowerASCII(raw_name); 158 std::string name = base::StringToLowerASCII(raw_name);
159 AddSpdyHeader(name, value, headers); 159 AddSpdyHeader(name, value, headers);
160 } 160 }
161 } 161 }
162 162
163 163 static_assert(HIGHEST - LOWEST < 4 && HIGHEST - MINIMUM_PRIORITY < 5,
164 COMPILE_ASSERT(HIGHEST - LOWEST < 4 && 164 "request priority incompatible with spdy");
165 HIGHEST - MINIMUM_PRIORITY < 5,
166 request_priority_incompatible_with_spdy);
167 165
168 SpdyPriority ConvertRequestPriorityToSpdyPriority( 166 SpdyPriority ConvertRequestPriorityToSpdyPriority(
169 const RequestPriority priority, 167 const RequestPriority priority,
170 SpdyMajorVersion protocol_version) { 168 SpdyMajorVersion protocol_version) {
171 DCHECK_GE(priority, MINIMUM_PRIORITY); 169 DCHECK_GE(priority, MINIMUM_PRIORITY);
172 DCHECK_LE(priority, MAXIMUM_PRIORITY); 170 DCHECK_LE(priority, MAXIMUM_PRIORITY);
173 return static_cast<SpdyPriority>(MAXIMUM_PRIORITY - priority); 171 return static_cast<SpdyPriority>(MAXIMUM_PRIORITY - priority);
174 } 172 }
175 173
176 NET_EXPORT_PRIVATE RequestPriority ConvertSpdyPriorityToRequestPriority( 174 NET_EXPORT_PRIVATE RequestPriority ConvertSpdyPriorityToRequestPriority(
(...skipping 27 matching lines...) Expand all
204 if (it != headers.end()) 202 if (it != headers.end())
205 path = it->second; 203 path = it->second;
206 204
207 std::string url = (scheme.empty() || host_port.empty() || path.empty()) 205 std::string url = (scheme.empty() || host_port.empty() || path.empty())
208 ? std::string() 206 ? std::string()
209 : scheme + "://" + host_port + path; 207 : scheme + "://" + host_port + path;
210 return GURL(url); 208 return GURL(url);
211 } 209 }
212 210
213 } // namespace net 211 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socks_client_socket.cc ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698