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 { | |
Ryan Sleevi
2016/12/14 20:02:30
https://google.github.io/styleguide/cppguide.html#
Yirui Huang
2016/12/15 02:37:10
Done.
| |
15 public: | |
16 // Given a comma separated ordered list of language codes, return the list | |
17 // with a q-value appended to each language. The way q-values are assigned is | |
18 // rather simple. The q-value starts with 1.0 and is decremented by 0.2 for | |
19 // each successive entry in the list until it reaches 0.2. All the entries | |
20 // after that are assigned the same q-value of 0.2. Also, note that 1st | |
21 // language will not have a q-value added because the absence of a q-value | |
22 // implicitly means q=1.0. | |
23 // | |
24 // When making a http request, this should be used to determine what to put in | |
25 // Accept-Language header. If a comma separated list of language codes | |
26 // *without* q-value is sent, web servers regard all of them as having q=1.0 | |
27 // and pick one of them even though it may not be at the beginning of the list | |
28 // (see http://crbug.com/5899). | |
29 static std::string GenerateAcceptLanguageHeader( | |
30 const std::string& raw_language_list); | |
31 }; | |
32 } // namespace net | |
33 | |
34 #endif // NET_HTTP_HTTP_UTIL_ICU_H_ | |
OLD | NEW |