Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_HTTP_HTTP_UTIL_ICU_H_ | |
| 6 #define NET_HTTP_HTTP_UTIL_ICU_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "net/base/net_export.h" | |
| 11 | |
| 12 namespace net { | |
| 13 | |
| 14 class NET_EXPORT HttpUtilIcu { | |
| 15 public: | |
| 16 // Given a comma separated ordered list of language codes, return | |
|
Seigo Nonaka
2016/12/12 01:48:54
nit: continue line until 80 chars.
Yirui Huang
2016/12/12 06:50:41
Done.
| |
| 17 // the list with a qvalue appended to each language. | |
| 18 // The way qvalues are assigned is rather simple. The qvalue | |
| 19 // starts with 1.0 and is decremented by 0.2 for each successive entry | |
| 20 // in the list until it reaches 0.2. All the entries after that are | |
| 21 // assigned the same qvalue of 0.2. Also, note that the 1st language | |
| 22 // will not have a qvalue added because the absence of a qvalue implicitly | |
| 23 // means q=1.0. | |
| 24 // | |
| 25 // When making a http request, this should be used to determine what | |
| 26 // to put in Accept-Language header. If a comma separated list of language | |
| 27 // codes *without* qvalue is sent, web servers regard all | |
| 28 // of them as having q=1.0 and pick one of them even though it may not | |
| 29 // be at the beginning of the list (see http://crbug.com/5899). | |
| 30 static std::string GenerateAcceptLanguageHeader( | |
| 31 const std::string& raw_language_list); | |
| 32 }; | |
| 33 } // namespace net | |
| 34 | |
| 35 #endif // NET_HTTP_HTTP_UTIL_ICU_H_ | |
| OLD | NEW |