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

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

Issue 2559243003: Extend with a language code in http accept languages
Patch Set: Rebased and used namespcace instead of class 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 namespace http_util_icu {
Ryan Sleevi 2016/12/15 23:44:07 line break between 12/13
Yirui Huang 2016/12/16 08:00:08 Done.
jungshik at Google 2016/12/16 08:01:45 Do we need '_icu' suffix in the namespace? And,
14 // Given a comma separated ordered list of language codes, return the list
15 // with a q-value appended to each language. The way q-values are assigned is
16 // rather simple. The q-value starts with 1.0 and is decremented by 0.2 for
17 // each successive entry in the list until it reaches 0.2. All the entries
18 // after that are assigned the same q-value of 0.2. Also, note that 1st
19 // language will not have a q-value added because the absence of a q-value
20 // implicitly means q=1.0.
21 //
22 // When making a http request, this should be used to determine what to put in
23 // Accept-Language header. If a comma separated list of language codes
24 // *without* q-value is sent, web servers regard all of them as having q=1.0
25 // and pick one of them even though it may not be at the beginning of the list
26 // (see http://crbug.com/5899).
27 std::string NET_EXPORT
Ryan Sleevi 2016/12/15 23:44:07 NET_EXPORT std::string
Yirui Huang 2016/12/16 08:00:08 Done.
28 GenerateAcceptLanguageHeader(const std::string& raw_language_list);
29 } // namespace http_util_icu
30 } // namespace net
Ryan Sleevi 2016/12/15 23:44:07 line breaks between 28/29 and 29/30
Yirui Huang 2016/12/16 08:00:08 Done.
31
32 #endif // NET_HTTP_HTTP_UTIL_ICU_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698