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

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

Issue 2559243003: Extend with a language code in http accept languages
Patch Set: Removed unnecessary imports and checked develop path 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
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 class NET_EXPORT HttpUtilIcu {
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_
OLDNEW
« no previous file with comments | « net/http/http_util.cc ('k') | net/http/http_util_icu.cc » ('j') | net/http/http_util_icu.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698