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

Side by Side Diff: net/http/http_util_icu.h

Issue 2559243003: Extend with a language code in http accept languages
Patch Set: Rebased, fixed nits and handed over this CL :( Created 4 years 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/http/http_util.cc ('k') | net/http/http_util_icu.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 namespace http_util_icu {
15 // Given a comma separated ordered list of language codes, return the list
16 // with a q-value appended to each language. The way q-values are assigned is
17 // rather simple. The q-value starts with 1.0 and is decremented by 0.2 for
18 // each successive entry in the list until it reaches 0.2. All the entries
19 // after that are assigned the same q-value of 0.2. Also, note that 1st
20 // language will not have a q-value added because the absence of a q-value
21 // implicitly means q=1.0.
22 //
23 // When making a http request, this should be used to determine what to put in
24 // Accept-Language header. If a comma separated list of language codes
25 // *without* q-value is sent, web servers regard all of them as having q=1.0
26 // and pick one of them even though it may not be at the beginning of the list
27 // (see http://crbug.com/5899).
28 NET_EXPORT std::string GenerateAcceptLanguageHeader(
29 const std::string& raw_language_list);
30
31 } // namespace http_util_icu
32
33 } // namespace net
34
35 #endif // NET_HTTP_HTTP_UTIL_ICU_H_
OLDNEW
« no previous file with comments | « net/http/http_util.cc ('k') | net/http/http_util_icu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698