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

Unified Diff: tools/gn/template.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/template.h ('k') | tools/gn/test_with_scope.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/template.cc
diff --git a/tools/gn/template.cc b/tools/gn/template.cc
index 012e71692f61e4a132cf09901c31763b0fc145ba..8b8ae692bc43791b5ec249dc40d2f215632aa31a 100644
--- a/tools/gn/template.cc
+++ b/tools/gn/template.cc
@@ -18,7 +18,7 @@ Template::Template(const Scope* scope, const FunctionCallNode* def)
definition_(def) {
}
-Template::Template(scoped_ptr<Scope> scope, const FunctionCallNode* def)
+Template::Template(std::unique_ptr<Scope> scope, const FunctionCallNode* def)
: closure_(std::move(scope)), definition_(def) {}
Template::~Template() {
@@ -36,7 +36,7 @@ Value Template::Invoke(Scope* scope,
// First run the invocation's block. Need to allocate the scope on the heap
// so we can pass ownership to the template.
- scoped_ptr<Scope> invocation_scope(new Scope(scope));
+ std::unique_ptr<Scope> invocation_scope(new Scope(scope));
if (!FillTargetBlockScope(scope, invocation,
invocation->function().value().as_string(),
block, args, invocation_scope.get(), err))
@@ -78,7 +78,7 @@ Value Template::Invoke(Scope* scope,
// if we instead create a value and then set the scope on it, the copy can
// be avoided.
const char kInvoker[] = "invoker";
- template_scope.SetValue(kInvoker, Value(nullptr, scoped_ptr<Scope>()),
+ template_scope.SetValue(kInvoker, Value(nullptr, std::unique_ptr<Scope>()),
invocation);
Value* invoker_value = template_scope.GetMutableValue(kInvoker, false);
invoker_value->SetScopeValue(std::move(invocation_scope));
« no previous file with comments | « tools/gn/template.h ('k') | tools/gn/test_with_scope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698