| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 260 |
| 261 static base::LazyInstance<base::Lock>::Leaky | 261 static base::LazyInstance<base::Lock>::Leaky |
| 262 g_lang_set_lock = LAZY_INSTANCE_INITIALIZER; | 262 g_lang_set_lock = LAZY_INSTANCE_INITIALIZER; |
| 263 | 263 |
| 264 // Returns true if all the characters in component_characters are used by | 264 // Returns true if all the characters in component_characters are used by |
| 265 // the language |lang|. | 265 // the language |lang|. |
| 266 bool IsComponentCoveredByLang(const icu::UnicodeSet& component_characters, | 266 bool IsComponentCoveredByLang(const icu::UnicodeSet& component_characters, |
| 267 const std::string& lang) { | 267 const std::string& lang) { |
| 268 CR_DEFINE_STATIC_LOCAL( | 268 CR_DEFINE_STATIC_LOCAL( |
| 269 const icu::UnicodeSet, kASCIILetters, ('a', 'z')); | 269 const icu::UnicodeSet, kASCIILetters, ('a', 'z')); |
| 270 icu::UnicodeSet* lang_set; | 270 icu::UnicodeSet* lang_set = NULL; |
| 271 // We're called from both the UI thread and the history thread. | 271 // We're called from both the UI thread and the history thread. |
| 272 { | 272 { |
| 273 base::AutoLock lock(g_lang_set_lock.Get()); | 273 base::AutoLock lock(g_lang_set_lock.Get()); |
| 274 if (!GetExemplarSetForLang(lang, &lang_set)) { | 274 if (!GetExemplarSetForLang(lang, &lang_set)) { |
| 275 UErrorCode status = U_ZERO_ERROR; | 275 UErrorCode status = U_ZERO_ERROR; |
| 276 ULocaleData* uld = ulocdata_open(lang.c_str(), &status); | 276 ULocaleData* uld = ulocdata_open(lang.c_str(), &status); |
| 277 // TODO(jungshik) Turn this check on when the ICU data file is | 277 // TODO(jungshik) Turn this check on when the ICU data file is |
| 278 // rebuilt with the minimal subset of locale data for languages | 278 // rebuilt with the minimal subset of locale data for languages |
| 279 // to which Chrome is not localized but which we offer in the list | 279 // to which Chrome is not localized but which we offer in the list |
| 280 // of languages selectable for Accept-Languages. With the rebuilt ICU | 280 // of languages selectable for Accept-Languages. With the rebuilt ICU |
| (...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 | 2224 |
| 2225 NetworkInterface::NetworkInterface(const std::string& name, | 2225 NetworkInterface::NetworkInterface(const std::string& name, |
| 2226 const IPAddressNumber& address) | 2226 const IPAddressNumber& address) |
| 2227 : name(name), address(address) { | 2227 : name(name), address(address) { |
| 2228 } | 2228 } |
| 2229 | 2229 |
| 2230 NetworkInterface::~NetworkInterface() { | 2230 NetworkInterface::~NetworkInterface() { |
| 2231 } | 2231 } |
| 2232 | 2232 |
| 2233 } // namespace net | 2233 } // namespace net |
| OLD | NEW |