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

Unified Diff: tools/gn/input_file_manager.h

Issue 1877253003: GN: Use std::unique_ptr for owning pointers in InputFileManager. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gn/input_file_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/input_file_manager.h
diff --git a/tools/gn/input_file_manager.h b/tools/gn/input_file_manager.h
index ba055e219c57bbc18ce2943ffcdd14491fec9b0c..dd166048e9b030e2405319f81d9da3533ba0841f 100644
--- a/tools/gn/input_file_manager.h
+++ b/tools/gn/input_file_manager.h
@@ -137,7 +137,8 @@ class InputFileManager : public base::RefCountedThreadSafe<InputFileManager> {
mutable base::Lock lock_;
// Maps repo-relative filenames to the corresponding owned pointer.
- typedef base::hash_map<SourceFile, InputFileData*> InputFileMap;
+ typedef base::hash_map<SourceFile, std::unique_ptr<InputFileData>>
+ InputFileMap;
InputFileMap input_files_;
// Tracks all dynamic inputs. The data are holders for memory management
@@ -146,9 +147,7 @@ class InputFileManager : public base::RefCountedThreadSafe<InputFileManager> {
// charge of the threadsafety requirements.
//
// See AddDynamicInput().
- //
- // Owning pointers.
- std::vector<InputFileData*> dynamic_inputs_;
+ std::vector<std::unique_ptr<InputFileData>> dynamic_inputs_;
DISALLOW_COPY_AND_ASSIGN(InputFileManager);
};
« no previous file with comments | « no previous file | tools/gn/input_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698