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

Side by Side Diff: base/sys_info_chromeos.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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 | « base/rand_util_posix.cc ('k') | base/third_party/dmg_fp/dtoa_wrapper.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 22 matching lines...) Expand all
33 parsed(false) { 33 parsed(false) {
34 } 34 }
35 35
36 int32 major_version; 36 int32 major_version;
37 int32 minor_version; 37 int32 minor_version;
38 int32 bugfix_version; 38 int32 bugfix_version;
39 bool parsed; 39 bool parsed;
40 }; 40 };
41 41
42 static base::LazyInstance<ChromeOSVersionNumbers> 42 static base::LazyInstance<ChromeOSVersionNumbers>
43 g_chrome_os_version_numbers(base::LINKER_INITIALIZED); 43 g_chrome_os_version_numbers = LAZY_INSTANCE_INITIALIZER;
44 44
45 // static 45 // static
46 void SysInfo::OperatingSystemVersionNumbers(int32* major_version, 46 void SysInfo::OperatingSystemVersionNumbers(int32* major_version,
47 int32* minor_version, 47 int32* minor_version,
48 int32* bugfix_version) { 48 int32* bugfix_version) {
49 if (!g_chrome_os_version_numbers.Get().parsed) { 49 if (!g_chrome_os_version_numbers.Get().parsed) {
50 // The other implementations of SysInfo don't block on the disk. 50 // The other implementations of SysInfo don't block on the disk.
51 // See http://code.google.com/p/chromium/issues/detail?id=60394 51 // See http://code.google.com/p/chromium/issues/detail?id=60394
52 // Perhaps the caller ought to cache this? 52 // Perhaps the caller ought to cache this?
53 // Temporary allowing while we work the bug out. 53 // Temporary allowing while we work the bug out.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 minor_version); 106 minor_version);
107 } else { // 2 == i 107 } else { // 2 == i
108 StringToInt(tokenizer.token_begin(), 108 StringToInt(tokenizer.token_begin(),
109 tokenizer.token_end(), 109 tokenizer.token_end(),
110 bugfix_version); 110 bugfix_version);
111 } 111 }
112 } 112 }
113 } 113 }
114 114
115 } // namespace base 115 } // namespace base
OLDNEW
« no previous file with comments | « base/rand_util_posix.cc ('k') | base/third_party/dmg_fp/dtoa_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698