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

Side by Side Diff: base/tracked_objects.h

Issue 2830093003: Replace uses of hash_map in //base (Closed)
Patch Set: iOS Created 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <set> 11 #include <set>
12 #include <stack> 12 #include <stack>
13 #include <string> 13 #include <string>
14 #include <unordered_map>
14 #include <utility> 15 #include <utility>
15 #include <vector> 16 #include <vector>
16 17
17 #include "base/allocator/features.h" 18 #include "base/allocator/features.h"
18 #include "base/atomicops.h" 19 #include "base/atomicops.h"
19 #include "base/base_export.h" 20 #include "base/base_export.h"
20 #include "base/containers/hash_tables.h" 21 #include "base/containers/hash_tables.h"
21 #include "base/debug/debugging_flags.h" 22 #include "base/debug/debugging_flags.h"
22 #include "base/debug/thread_heap_usage_tracker.h" 23 #include "base/debug/thread_heap_usage_tracker.h"
23 #include "base/gtest_prod_util.h" 24 #include "base/gtest_prod_util.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 // Current allowable states of the tracking system. The states can vary 516 // Current allowable states of the tracking system. The states can vary
516 // between ACTIVE and DEACTIVATED, but can never go back to UNINITIALIZED. 517 // between ACTIVE and DEACTIVATED, but can never go back to UNINITIALIZED.
517 enum Status { 518 enum Status {
518 UNINITIALIZED, // Pristine, link-time state before running. 519 UNINITIALIZED, // Pristine, link-time state before running.
519 DORMANT_DURING_TESTS, // Only used during testing. 520 DORMANT_DURING_TESTS, // Only used during testing.
520 DEACTIVATED, // No longer recording profiling. 521 DEACTIVATED, // No longer recording profiling.
521 PROFILING_ACTIVE, // Recording profiles. 522 PROFILING_ACTIVE, // Recording profiles.
522 STATUS_LAST = PROFILING_ACTIVE 523 STATUS_LAST = PROFILING_ACTIVE
523 }; 524 };
524 525
525 typedef base::hash_map<Location, Births*, Location::Hash> BirthMap; 526 typedef std::unordered_map<Location, Births*, Location::Hash> BirthMap;
526 typedef std::map<const Births*, DeathData> DeathMap; 527 typedef std::map<const Births*, DeathData> DeathMap;
527 528
528 // Initialize the current thread context with a new instance of ThreadData. 529 // Initialize the current thread context with a new instance of ThreadData.
529 // This is used by all threads that have names, and should be explicitly 530 // This is used by all threads that have names, and should be explicitly
530 // set *before* any births on the threads have taken place. 531 // set *before* any births on the threads have taken place.
531 static void InitializeThreadContext(const std::string& thread_name); 532 static void InitializeThreadContext(const std::string& thread_name);
532 533
533 // Using Thread Local Store, find the current instance for collecting data. 534 // Using Thread Local Store, find the current instance for collecting data.
534 // If an instance does not exist, construct one (and remember it for use on 535 // If an instance does not exist, construct one (and remember it for use on
535 // this thread. 536 // this thread.
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 ProcessDataSnapshot(const ProcessDataSnapshot& other); 890 ProcessDataSnapshot(const ProcessDataSnapshot& other);
890 ~ProcessDataSnapshot(); 891 ~ProcessDataSnapshot();
891 892
892 PhasedProcessDataSnapshotMap phased_snapshots; 893 PhasedProcessDataSnapshotMap phased_snapshots;
893 base::ProcessId process_id; 894 base::ProcessId process_id;
894 }; 895 };
895 896
896 } // namespace tracked_objects 897 } // namespace tracked_objects
897 898
898 #endif // BASE_TRACKED_OBJECTS_H_ 899 #endif // BASE_TRACKED_OBJECTS_H_
OLDNEW
« no previous file with comments | « base/trace_event/trace_log.cc ('k') | chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698