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

Side by Side Diff: chrome/browser/chromeos/dom_ui/system_settings_provider.cc

Issue 6142009: Upating the app, ceee, chrome, ipc, media, and net directories to use the correct lock.h file. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Unified patch updating all references to the new base/synchronization/lock.h Created 9 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/child_process_security_policy.cc ('k') | chrome/browser/chromeos/login/camera.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/dom_ui/system_settings_provider.h" 5 #include "chrome/browser/chromeos/dom_ui/system_settings_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
11 #include "base/lock.h"
12 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
13 #include "base/stl_util-inl.h" 12 #include "base/stl_util-inl.h"
14 #include "base/string_util.h" 13 #include "base/string_util.h"
15 #include "base/stringprintf.h" 14 #include "base/stringprintf.h"
15 #include "base/synchronization/lock.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "base/values.h" 18 #include "base/values.h"
19 #include "chrome/browser/chromeos/cros/cros_library.h" 19 #include "chrome/browser/chromeos/cros/cros_library.h"
20 #include "chrome/browser/chromeos/cros_settings.h" 20 #include "chrome/browser/chromeos/cros_settings.h"
21 #include "chrome/browser/chromeos/cros_settings_names.h" 21 #include "chrome/browser/chromeos/cros_settings_names.h"
22 #include "chrome/browser/chromeos/login/ownership_service.h" 22 #include "chrome/browser/chromeos/login/ownership_service.h"
23 #include "grit/generated_resources.h" 23 #include "grit/generated_resources.h"
24 #include "unicode/calendar.h" 24 #include "unicode/calendar.h"
25 #include "unicode/timezone.h" 25 #include "unicode/timezone.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 "Australia/Hobart", 113 "Australia/Hobart",
114 "Australia/Sydney", 114 "Australia/Sydney",
115 "Asia/Vladivostok", 115 "Asia/Vladivostok",
116 "Pacific/Guam", 116 "Pacific/Guam",
117 "Asia/Magadan", 117 "Asia/Magadan",
118 "Pacific/Auckland", 118 "Pacific/Auckland",
119 "Pacific/Fiji", 119 "Pacific/Fiji",
120 "Pacific/Tongatapu", 120 "Pacific/Tongatapu",
121 }; 121 };
122 122
123 static Lock timezone_bundle_lock; 123 static base::Lock timezone_bundle_lock;
124 124
125 struct UResClose { 125 struct UResClose {
126 inline void operator() (UResourceBundle* b) const { 126 inline void operator() (UResourceBundle* b) const {
127 ures_close(b); 127 ures_close(b);
128 } 128 }
129 }; 129 };
130 130
131 string16 GetExemplarCity(const icu::TimeZone& zone) { 131 string16 GetExemplarCity(const icu::TimeZone& zone) {
132 // TODO(jungshik): After upgrading to ICU 4.6, use U_ICUDATA_ZONE 132 // TODO(jungshik): After upgrading to ICU 4.6, use U_ICUDATA_ZONE
133 static const char* zone_bundle_name = NULL; 133 static const char* zone_bundle_name = NULL;
134 134
135 // These will be leaked at the end. 135 // These will be leaked at the end.
136 static UResourceBundle *zone_bundle = NULL; 136 static UResourceBundle *zone_bundle = NULL;
137 static UResourceBundle *zone_strings = NULL; 137 static UResourceBundle *zone_strings = NULL;
138 138
139 UErrorCode status = U_ZERO_ERROR; 139 UErrorCode status = U_ZERO_ERROR;
140 { 140 {
141 AutoLock lock(timezone_bundle_lock); 141 base::AutoLock lock(timezone_bundle_lock);
142 if (zone_bundle == NULL) 142 if (zone_bundle == NULL)
143 zone_bundle = ures_open(zone_bundle_name, uloc_getDefault(), &status); 143 zone_bundle = ures_open(zone_bundle_name, uloc_getDefault(), &status);
144 144
145 if (zone_strings == NULL) 145 if (zone_strings == NULL)
146 zone_strings = ures_getByKey(zone_bundle, "zone_strings", NULL, &status); 146 zone_strings = ures_getByKey(zone_bundle, "zone_strings", NULL, &status);
147 } 147 }
148 148
149 icu::UnicodeString zone_id; 149 icu::UnicodeString zone_id;
150 zone.getID(zone_id); 150 zone.getID(zone_id);
151 std::string zone_id_str; 151 std::string zone_id_str;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 const icu::TimeZone* known_timezone = *iter; 307 const icu::TimeZone* known_timezone = *iter;
308 if (known_timezone->hasSameRules(timezone)) 308 if (known_timezone->hasSameRules(timezone))
309 return GetTimezoneID(*known_timezone); 309 return GetTimezoneID(*known_timezone);
310 } 310 }
311 311
312 // Not able to find a matching timezone in our list. 312 // Not able to find a matching timezone in our list.
313 return string16(); 313 return string16();
314 } 314 }
315 315
316 } // namespace chromeos 316 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/child_process_security_policy.cc ('k') | chrome/browser/chromeos/login/camera.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698