OLD | NEW |
---|---|
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/loader.h" | 5 #include "tools/gn/loader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "tools/gn/build_settings.h" | 10 #include "tools/gn/build_settings.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 | 258 |
259 Err err; | 259 Err err; |
260 root->Execute(&our_scope, &err); | 260 root->Execute(&our_scope, &err); |
261 if (err.has_error()) | 261 if (err.has_error()) |
262 g_scheduler->FailWithError(err); | 262 g_scheduler->FailWithError(err); |
263 | 263 |
264 if (!our_scope.CheckForUnusedVars(&err)) | 264 if (!our_scope.CheckForUnusedVars(&err)) |
265 g_scheduler->FailWithError(err); | 265 g_scheduler->FailWithError(err); |
266 | 266 |
267 // Pass all of the items that were defined off to the builder. | 267 // Pass all of the items that were defined off to the builder. |
268 for (const auto& item : collected_items) | 268 for (auto& item : collected_items) { |
269 settings->build_settings()->ItemDefined(item->Pass()); | 269 settings->build_settings()->ItemDefined(make_scoped_ptr(item)); |
dcheng
2014/10/15 20:26:09
This is a bit awkward, but I don't know of a bette
| |
270 item = nullptr; | |
271 } | |
270 | 272 |
271 trace.Done(); | 273 trace.Done(); |
272 | 274 |
273 main_loop_->PostTask(FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this)); | 275 main_loop_->PostTask(FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this)); |
274 } | 276 } |
275 | 277 |
276 void LoaderImpl::BackgroundLoadBuildConfig( | 278 void LoaderImpl::BackgroundLoadBuildConfig( |
277 Settings* settings, | 279 Settings* settings, |
278 const Scope::KeyValueMap& toolchain_overrides, | 280 const Scope::KeyValueMap& toolchain_overrides, |
279 const ParseNode* root) { | 281 const ParseNode* root) { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 const SourceFile& file_name, | 411 const SourceFile& file_name, |
410 const base::Callback<void(const ParseNode*)>& callback, | 412 const base::Callback<void(const ParseNode*)>& callback, |
411 Err* err) { | 413 Err* err) { |
412 if (async_load_file_.is_null()) { | 414 if (async_load_file_.is_null()) { |
413 return g_scheduler->input_file_manager()->AsyncLoadFile( | 415 return g_scheduler->input_file_manager()->AsyncLoadFile( |
414 origin, build_settings, file_name, callback, err); | 416 origin, build_settings, file_name, callback, err); |
415 } | 417 } |
416 return async_load_file_.Run( | 418 return async_load_file_.Run( |
417 origin, build_settings, file_name, callback, err); | 419 origin, build_settings, file_name, callback, err); |
418 } | 420 } |
OLD | NEW |