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

Side by Side Diff: base/tracked_objects.h

Issue 9297010: Make it possible to use ThreadLocalStorage::Slot as a static without (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « base/threading/thread_local_storage_win.cc ('k') | base/tracked_objects.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) 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 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 // using the data structures, then the |leak| argument should be passed in as 537 // using the data structures, then the |leak| argument should be passed in as
538 // true, and the data structures (birth maps, death maps, ThreadData 538 // true, and the data structures (birth maps, death maps, ThreadData
539 // insntances, etc.) will be leaked and not deleted. If you have joined all 539 // insntances, etc.) will be leaked and not deleted. If you have joined all
540 // threads since the time that InitializeAndSetTrackingStatus() was called, 540 // threads since the time that InitializeAndSetTrackingStatus() was called,
541 // then you can pass in a |leak| value of false, and this function will 541 // then you can pass in a |leak| value of false, and this function will
542 // delete recursively all data structures, starting with the list of 542 // delete recursively all data structures, starting with the list of
543 // ThreadData instances. 543 // ThreadData instances.
544 static void ShutdownSingleThreadedCleanup(bool leak); 544 static void ShutdownSingleThreadedCleanup(bool leak);
545 545
546 // We use thread local store to identify which ThreadData to interact with. 546 // We use thread local store to identify which ThreadData to interact with.
547 static base::ThreadLocalStorage::Slot tls_index_; 547 static base::ThreadLocalStorage::StaticSlot tls_index_;
548 548
549 // List of ThreadData instances for use with worker threads. When a worker 549 // List of ThreadData instances for use with worker threads. When a worker
550 // thread is done (terminated), we push it onto this llist. When a new worker 550 // thread is done (terminated), we push it onto this llist. When a new worker
551 // thread is created, we first try to re-use a ThreadData instance from the 551 // thread is created, we first try to re-use a ThreadData instance from the
552 // list, and if none are available, construct a new one. 552 // list, and if none are available, construct a new one.
553 // This is only accessed while list_lock_ is held. 553 // This is only accessed while list_lock_ is held.
554 static ThreadData* first_retired_worker_; 554 static ThreadData* first_retired_worker_;
555 555
556 // Link to the most recently created instance (starts a null terminated list). 556 // Link to the most recently created instance (starts a null terminated list).
557 // The list is traversed by about:profiler when it needs to snapshot data. 557 // The list is traversed by about:profiler when it needs to snapshot data.
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 } 723 }
724 724
725 private: 725 private:
726 726
727 DISALLOW_COPY_AND_ASSIGN(AutoTracking); 727 DISALLOW_COPY_AND_ASSIGN(AutoTracking);
728 }; 728 };
729 729
730 } // namespace tracked_objects 730 } // namespace tracked_objects
731 731
732 #endif // BASE_TRACKED_OBJECTS_H_ 732 #endif // BASE_TRACKED_OBJECTS_H_
OLDNEW
« no previous file with comments | « base/threading/thread_local_storage_win.cc ('k') | base/tracked_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698