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

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

Issue 1885513003: GN: Use std::unique_ptr for owning pointers in Scope::NamedScopeMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | tools/gn/scope.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 #ifndef TOOLS_GN_SCOPE_H_ 5 #ifndef TOOLS_GN_SCOPE_H_
6 #define TOOLS_GN_SCOPE_H_ 6 #define TOOLS_GN_SCOPE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 const Settings* settings_; 326 const Settings* settings_;
327 327
328 // Bits set for different modes. See the flag definitions in the .cc file 328 // Bits set for different modes. See the flag definitions in the .cc file
329 // for more. 329 // for more.
330 unsigned mode_flags_; 330 unsigned mode_flags_;
331 331
332 typedef base::hash_map<base::StringPiece, Record, base::StringPieceHash> 332 typedef base::hash_map<base::StringPiece, Record, base::StringPieceHash>
333 RecordMap; 333 RecordMap;
334 RecordMap values_; 334 RecordMap values_;
335 335
336 // Owning pointers. Note that this can't use string pieces since the names 336 // Note that this can't use string pieces since the names are constructed from
337 // are constructed from Values which might be deallocated before this goes 337 // Values which might be deallocated before this goes out of scope.
338 // out of scope. 338 typedef base::hash_map<std::string, std::unique_ptr<Scope>> NamedScopeMap;
339 typedef base::hash_map<std::string, Scope*> NamedScopeMap;
340 NamedScopeMap target_defaults_; 339 NamedScopeMap target_defaults_;
341 340
342 // Null indicates not set and that we should fallback to the containing 341 // Null indicates not set and that we should fallback to the containing
343 // scope's filter. 342 // scope's filter.
344 std::unique_ptr<PatternList> sources_assignment_filter_; 343 std::unique_ptr<PatternList> sources_assignment_filter_;
345 344
346 // Owning pointers, must be deleted. 345 // Owning pointers, must be deleted.
347 typedef std::map<std::string, scoped_refptr<const Template> > TemplateMap; 346 typedef std::map<std::string, scoped_refptr<const Template> > TemplateMap;
348 TemplateMap templates_; 347 TemplateMap templates_;
349 348
350 ItemVector* item_collector_; 349 ItemVector* item_collector_;
351 350
352 // Opaque pointers. See SetProperty() above. 351 // Opaque pointers. See SetProperty() above.
353 typedef std::map<const void*, void*> PropertyMap; 352 typedef std::map<const void*, void*> PropertyMap;
354 PropertyMap properties_; 353 PropertyMap properties_;
355 354
356 typedef std::set<ProgrammaticProvider*> ProviderSet; 355 typedef std::set<ProgrammaticProvider*> ProviderSet;
357 ProviderSet programmatic_providers_; 356 ProviderSet programmatic_providers_;
358 357
359 SourceDir source_dir_; 358 SourceDir source_dir_;
360 359
361 DISALLOW_COPY_AND_ASSIGN(Scope); 360 DISALLOW_COPY_AND_ASSIGN(Scope);
362 }; 361 };
363 362
364 #endif // TOOLS_GN_SCOPE_H_ 363 #endif // TOOLS_GN_SCOPE_H_
OLDNEW
« no previous file with comments | « no previous file | tools/gn/scope.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698