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

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

Issue 2105553005: tools/gn: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 5 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/parser.cc ('k') | tools/gn/target.cc » ('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/scope.h" 5 #include "tools/gn/scope.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "tools/gn/parse_tree.h" 9 #include "tools/gn/parse_tree.h"
10 #include "tools/gn/template.h" 10 #include "tools/gn/template.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 mode_flags_(0), 62 mode_flags_(0),
63 item_collector_(nullptr) { 63 item_collector_(nullptr) {
64 } 64 }
65 65
66 Scope::~Scope() { 66 Scope::~Scope() {
67 } 67 }
68 68
69 const Value* Scope::GetValue(const base::StringPiece& ident, 69 const Value* Scope::GetValue(const base::StringPiece& ident,
70 bool counts_as_used) { 70 bool counts_as_used) {
71 // First check for programmatically-provided values. 71 // First check for programmatically-provided values.
72 for (const auto& provider : programmatic_providers_) { 72 for (auto* provider : programmatic_providers_) {
73 const Value* v = provider->GetProgrammaticValue(ident); 73 const Value* v = provider->GetProgrammaticValue(ident);
74 if (v) 74 if (v)
75 return v; 75 return v;
76 } 76 }
77 77
78 RecordMap::iterator found = values_.find(ident); 78 RecordMap::iterator found = values_.find(ident);
79 if (found != values_.end()) { 79 if (found != values_.end()) {
80 if (counts_as_used) 80 if (counts_as_used)
81 found->second.used = true; 81 found->second.used = true;
82 return &found->second.value; 82 return &found->second.value;
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 507 }
508 508
509 void Scope::AddProvider(ProgrammaticProvider* p) { 509 void Scope::AddProvider(ProgrammaticProvider* p) {
510 programmatic_providers_.insert(p); 510 programmatic_providers_.insert(p);
511 } 511 }
512 512
513 void Scope::RemoveProvider(ProgrammaticProvider* p) { 513 void Scope::RemoveProvider(ProgrammaticProvider* p) {
514 DCHECK(programmatic_providers_.find(p) != programmatic_providers_.end()); 514 DCHECK(programmatic_providers_.find(p) != programmatic_providers_.end());
515 programmatic_providers_.erase(p); 515 programmatic_providers_.erase(p);
516 } 516 }
OLDNEW
« no previous file with comments | « tools/gn/parser.cc ('k') | tools/gn/target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698