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

Side by Side Diff: components/metrics/file_metrics_provider.h

Issue 2742193002: Harden allocator for file-backed memory. (Closed)
Patch Set: addressed final review comments Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ 5 #ifndef COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_
6 #define COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ 6 #define COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 // System could not map file into memory. 123 // System could not map file into memory.
124 ACCESS_RESULT_SYSTEM_MAP_FAILURE, 124 ACCESS_RESULT_SYSTEM_MAP_FAILURE,
125 125
126 // File had invalid contents. 126 // File had invalid contents.
127 ACCESS_RESULT_INVALID_CONTENTS, 127 ACCESS_RESULT_INVALID_CONTENTS,
128 128
129 // File could not be opened. 129 // File could not be opened.
130 ACCESS_RESULT_NO_OPEN, 130 ACCESS_RESULT_NO_OPEN,
131 131
132 // File contents were internally deleted.
133 ACCESS_RESULT_MEMORY_DELETED,
134
132 ACCESS_RESULT_MAX 135 ACCESS_RESULT_MAX
133 }; 136 };
134 137
135 // Information about sources being monitored; defined and used exclusively 138 // Information about sources being monitored; defined and used exclusively
136 // inside the .cc file. 139 // inside the .cc file.
137 struct SourceInfo; 140 struct SourceInfo;
138 using SourceInfoList = std::list<std::unique_ptr<SourceInfo>>; 141 using SourceInfoList = std::list<std::unique_ptr<SourceInfo>>;
139 142
140 // Looks for the next file to read within a directory. Returns true if a 143 // Looks for the next file to read within a directory. Returns true if a
141 // file was found. This is part of CheckAndMapNewMetricSourcesOnTaskRunner 144 // file was found. This is part of CheckAndMapNewMetricSourcesOnTaskRunner
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 202
200 base::ThreadChecker thread_checker_; 203 base::ThreadChecker thread_checker_;
201 base::WeakPtrFactory<FileMetricsProvider> weak_factory_; 204 base::WeakPtrFactory<FileMetricsProvider> weak_factory_;
202 205
203 DISALLOW_COPY_AND_ASSIGN(FileMetricsProvider); 206 DISALLOW_COPY_AND_ASSIGN(FileMetricsProvider);
204 }; 207 };
205 208
206 } // namespace metrics 209 } // namespace metrics
207 210
208 #endif // COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ 211 #endif // COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_
OLDNEW
« no previous file with comments | « base/metrics/persistent_memory_allocator_unittest.cc ('k') | components/metrics/file_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698