| 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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 our_scope.CheckForUnusedVars(&err); | 266 our_scope.CheckForUnusedVars(&err); |
| 267 | 267 |
| 268 if (err.has_error()) { | 268 if (err.has_error()) { |
| 269 if (!origin.is_null()) | 269 if (!origin.is_null()) |
| 270 err.AppendSubErr(Err(origin, "which caused the file to be included.")); | 270 err.AppendSubErr(Err(origin, "which caused the file to be included.")); |
| 271 g_scheduler->FailWithError(err); | 271 g_scheduler->FailWithError(err); |
| 272 } | 272 } |
| 273 | 273 |
| 274 | 274 |
| 275 // Pass all of the items that were defined off to the builder. | 275 // Pass all of the items that were defined off to the builder. |
| 276 for (auto& item : collected_items) { | 276 for (auto*& item : collected_items) { |
| 277 settings->build_settings()->ItemDefined(base::WrapUnique(item)); | 277 settings->build_settings()->ItemDefined(base::WrapUnique(item)); |
| 278 item = nullptr; | 278 item = nullptr; |
| 279 } | 279 } |
| 280 | 280 |
| 281 trace.Done(); | 281 trace.Done(); |
| 282 | 282 |
| 283 main_loop_->task_runner()->PostTask( | 283 main_loop_->task_runner()->PostTask( |
| 284 FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this)); | 284 FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this)); |
| 285 } | 285 } |
| 286 | 286 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 const SourceFile& file_name, | 421 const SourceFile& file_name, |
| 422 const base::Callback<void(const ParseNode*)>& callback, | 422 const base::Callback<void(const ParseNode*)>& callback, |
| 423 Err* err) { | 423 Err* err) { |
| 424 if (async_load_file_.is_null()) { | 424 if (async_load_file_.is_null()) { |
| 425 return g_scheduler->input_file_manager()->AsyncLoadFile( | 425 return g_scheduler->input_file_manager()->AsyncLoadFile( |
| 426 origin, build_settings, file_name, callback, err); | 426 origin, build_settings, file_name, callback, err); |
| 427 } | 427 } |
| 428 return async_load_file_.Run( | 428 return async_load_file_.Run( |
| 429 origin, build_settings, file_name, callback, err); | 429 origin, build_settings, file_name, callback, err); |
| 430 } | 430 } |
| OLD | NEW |