OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 BASE_TRACKED_OBJECTS_H_ | 5 #ifndef BASE_TRACKED_OBJECTS_H_ |
6 #define BASE_TRACKED_OBJECTS_H_ | 6 #define BASE_TRACKED_OBJECTS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 // Check to see if the items are sort equivalents (should be aggregated). | 249 // Check to see if the items are sort equivalents (should be aggregated). |
250 bool Equivalent(const Snapshot& left, const Snapshot& right) const; | 250 bool Equivalent(const Snapshot& left, const Snapshot& right) const; |
251 | 251 |
252 // Check to see if all required fields are present in the given sample. | 252 // Check to see if all required fields are present in the given sample. |
253 bool Acceptable(const Snapshot& sample) const; | 253 bool Acceptable(const Snapshot& sample) const; |
254 | 254 |
255 // A comparator can be refined by specifying what to do if the selected basis | 255 // A comparator can be refined by specifying what to do if the selected basis |
256 // for comparison is insufficient to establish an ordering. This call adds | 256 // for comparison is insufficient to establish an ordering. This call adds |
257 // the indicated attribute as the new "least significant" basis of comparison. | 257 // the indicated attribute as the new "least significant" basis of comparison. |
258 void SetTiebreaker(Selector selector, const std::string required); | 258 void SetTiebreaker(Selector selector, const std::string& required); |
259 | 259 |
260 // Indicate if this instance is set up to sort by the given Selector, thereby | 260 // Indicate if this instance is set up to sort by the given Selector, thereby |
261 // putting that information in the SortGrouping, so it is not needed in each | 261 // putting that information in the SortGrouping, so it is not needed in each |
262 // printed line. | 262 // printed line. |
263 bool IsGroupedBy(Selector selector) const; | 263 bool IsGroupedBy(Selector selector) const; |
264 | 264 |
265 // Using the tiebreakers as set above, we mostly get an ordering, which | 265 // Using the tiebreakers as set above, we mostly get an ordering, which |
266 // equivalent groups. If those groups are displayed (rather than just being | 266 // equivalent groups. If those groups are displayed (rather than just being |
267 // aggregated, then the following is used to order them (within the group). | 267 // aggregated, then the following is used to order them (within the group). |
268 void SetSubgroupTiebreaker(Selector selector); | 268 void SetSubgroupTiebreaker(Selector selector); |
269 | 269 |
270 // Translate a keyword and restriction in URL path to a selector for sorting. | 270 // Translate a keyword and restriction in URL path to a selector for sorting. |
271 void ParseKeyphrase(const std::string key_phrase); | 271 void ParseKeyphrase(const std::string& key_phrase); |
272 | 272 |
273 // Parse a query in an about:objects URL to decide on sort ordering. | 273 // Parse a query in an about:objects URL to decide on sort ordering. |
274 bool ParseQuery(const std::string query); | 274 bool ParseQuery(const std::string& query); |
275 | 275 |
276 // Output a header line that can be used to indicated what items will be | 276 // Output a header line that can be used to indicated what items will be |
277 // collected in the group. It lists all (potentially) tested attributes and | 277 // collected in the group. It lists all (potentially) tested attributes and |
278 // their values (in the sample item). | 278 // their values (in the sample item). |
279 bool WriteSortGrouping(const Snapshot& sample, std::string* output) const; | 279 bool WriteSortGrouping(const Snapshot& sample, std::string* output) const; |
280 | 280 |
281 // Output a sample, with SortGroup details not displayed. | 281 // Output a sample, with SortGroup details not displayed. |
282 void WriteSnapshot(const Snapshot& sample, std::string* output) const; | 282 void WriteSnapshot(const Snapshot& sample, std::string* output) const; |
283 | 283 |
284 private: | 284 private: |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 505 } |
506 | 506 |
507 private: | 507 private: |
508 DISALLOW_COPY_AND_ASSIGN(AutoTracking); | 508 DISALLOW_COPY_AND_ASSIGN(AutoTracking); |
509 }; | 509 }; |
510 | 510 |
511 | 511 |
512 } // namespace tracked_objects | 512 } // namespace tracked_objects |
513 | 513 |
514 #endif // BASE_TRACKED_OBJECTS_H_ | 514 #endif // BASE_TRACKED_OBJECTS_H_ |
OLD | NEW |