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 #include "tools/gn/loader.h" | 4 #include "tools/gn/loader.h" |
5 | 5 |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
9 #include "tools/gn/build_settings.h" | 9 #include "tools/gn/build_settings.h" |
10 #include "tools/gn/err.h" | 10 #include "tools/gn/err.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 our_scope.CheckForUnusedVars(&err); | 271 our_scope.CheckForUnusedVars(&err); |
272 | 272 |
273 if (err.has_error()) { | 273 if (err.has_error()) { |
274 if (!origin.is_null()) | 274 if (!origin.is_null()) |
275 err.AppendSubErr(Err(origin, "which caused the file to be included.")); | 275 err.AppendSubErr(Err(origin, "which caused the file to be included.")); |
276 g_scheduler->FailWithError(err); | 276 g_scheduler->FailWithError(err); |
277 } | 277 } |
278 | 278 |
279 | 279 |
280 // Pass all of the items that were defined off to the builder. | 280 // Pass all of the items that were defined off to the builder. |
281 for (auto*& item : collected_items) { | 281 for (auto& item : collected_items) |
282 settings->build_settings()->ItemDefined(base::WrapUnique(item)); | 282 settings->build_settings()->ItemDefined(std::move(item)); |
283 item = nullptr; | |
284 } | |
285 | 283 |
286 trace.Done(); | 284 trace.Done(); |
287 | 285 |
288 task_runner_->PostTask(FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this)); | 286 task_runner_->PostTask(FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this)); |
289 } | 287 } |
290 | 288 |
291 void LoaderImpl::BackgroundLoadBuildConfig( | 289 void LoaderImpl::BackgroundLoadBuildConfig( |
292 Settings* settings, | 290 Settings* settings, |
293 const Scope::KeyValueMap& toolchain_overrides, | 291 const Scope::KeyValueMap& toolchain_overrides, |
294 const ParseNode* root) { | 292 const ParseNode* root) { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 const SourceFile& file_name, | 423 const SourceFile& file_name, |
426 const base::Callback<void(const ParseNode*)>& callback, | 424 const base::Callback<void(const ParseNode*)>& callback, |
427 Err* err) { | 425 Err* err) { |
428 if (async_load_file_.is_null()) { | 426 if (async_load_file_.is_null()) { |
429 return g_scheduler->input_file_manager()->AsyncLoadFile( | 427 return g_scheduler->input_file_manager()->AsyncLoadFile( |
430 origin, build_settings, file_name, callback, err); | 428 origin, build_settings, file_name, callback, err); |
431 } | 429 } |
432 return async_load_file_.Run( | 430 return async_load_file_.Run( |
433 origin, build_settings, file_name, callback, err); | 431 origin, build_settings, file_name, callback, err); |
434 } | 432 } |
OLD | NEW |