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

Side by Side Diff: tools/gn/args.cc

Issue 136783005: Acquire lock in Args::SetSystemVars() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "tools/gn/args.h" 5 #include "tools/gn/args.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "tools/gn/variables.h" 8 #include "tools/gn/variables.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 "The variable \"" + i->first.as_string() + "\" was set as a build " 156 "The variable \"" + i->first.as_string() + "\" was set as a build "
157 "argument\nbut never appeared in a declare_args() block in any " 157 "argument\nbut never appeared in a declare_args() block in any "
158 "buildfile."); 158 "buildfile.");
159 return false; 159 return false;
160 } 160 }
161 } 161 }
162 return true; 162 return true;
163 } 163 }
164 164
165 void Args::SetSystemVars(Scope* dest) const { 165 void Args::SetSystemVars(Scope* dest) const {
166 base::AutoLock lock(lock_);
167
166 // Host OS. 168 // Host OS.
167 const char* os = NULL; 169 const char* os = NULL;
168 #if defined(OS_WIN) 170 #if defined(OS_WIN)
169 os = "win"; 171 os = "win";
170 #elif defined(OS_MACOSX) 172 #elif defined(OS_MACOSX)
171 os = "mac"; 173 os = "mac";
172 #elif defined(OS_LINUX) 174 #elif defined(OS_LINUX)
173 os = "linux"; 175 os = "linux";
174 #else 176 #else
175 #error Unknown OS type. 177 #error Unknown OS type.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 i != values.end(); ++i) 242 i != values.end(); ++i)
241 scope->SetValue(i->first, i->second, i->second.origin()); 243 scope->SetValue(i->first, i->second, i->second.origin());
242 } 244 }
243 245
244 void Args::SaveOverrideRecord(const Scope::KeyValueMap& values) const { 246 void Args::SaveOverrideRecord(const Scope::KeyValueMap& values) const {
245 base::AutoLock lock(lock_); 247 base::AutoLock lock(lock_);
246 for (Scope::KeyValueMap::const_iterator i = values.begin(); 248 for (Scope::KeyValueMap::const_iterator i = values.begin();
247 i != values.end(); ++i) 249 i != values.end(); ++i)
248 all_overrides_[i->first] = i->second; 250 all_overrides_[i->first] = i->second;
249 } 251 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698