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

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

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> Created 4 years, 8 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 | « tools/gn/builder.h ('k') | tools/gn/builder_record.h » ('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) 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/builder.h" 5 #include "tools/gn/builder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "tools/gn/config.h" 10 #include "tools/gn/config.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 54
55 Builder::Builder(Loader* loader) : loader_(loader) { 55 Builder::Builder(Loader* loader) : loader_(loader) {
56 } 56 }
57 57
58 Builder::~Builder() { 58 Builder::~Builder() {
59 } 59 }
60 60
61 void Builder::ItemDefined(scoped_ptr<Item> item) { 61 void Builder::ItemDefined(std::unique_ptr<Item> item) {
62 ScopedTrace trace(TraceItem::TRACE_DEFINE_TARGET, item->label()); 62 ScopedTrace trace(TraceItem::TRACE_DEFINE_TARGET, item->label());
63 trace.SetToolchain(item->settings()->toolchain_label()); 63 trace.SetToolchain(item->settings()->toolchain_label());
64 64
65 BuilderRecord::ItemType type = BuilderRecord::TypeOfItem(item.get()); 65 BuilderRecord::ItemType type = BuilderRecord::TypeOfItem(item.get());
66 66
67 Err err; 67 Err err;
68 BuilderRecord* record = 68 BuilderRecord* record =
69 GetOrCreateRecordOfType(item->label(), item->defined_from(), type, &err); 69 GetOrCreateRecordOfType(item->label(), item->defined_from(), type, &err);
70 if (!record) { 70 if (!record) {
71 g_scheduler->FailWithError(err); 71 g_scheduler->FailWithError(err);
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 std::string ret; 506 std::string ret;
507 for (size_t i = 0; i < cycle.size(); i++) { 507 for (size_t i = 0; i < cycle.size(); i++) {
508 ret += " " + cycle[i]->label().GetUserVisibleName(false); 508 ret += " " + cycle[i]->label().GetUserVisibleName(false);
509 if (i != cycle.size() - 1) 509 if (i != cycle.size() - 1)
510 ret += " ->"; 510 ret += " ->";
511 ret += "\n"; 511 ret += "\n";
512 } 512 }
513 513
514 return ret; 514 return ret;
515 } 515 }
OLDNEW
« no previous file with comments | « tools/gn/builder.h ('k') | tools/gn/builder_record.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698