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

Side by Side Diff: base/tracked_objects.h

Issue 6877053: Base: More adjustments to BASE_API and project dependencies to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « base/string_util.h ('k') | base/utf_offset_string_conversions.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 10 #include <string>
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 // Provide simple way to to start global tracking, and to tear down tracking 623 // Provide simple way to to start global tracking, and to tear down tracking
624 // when done. Note that construction and destruction of this object must be 624 // when done. Note that construction and destruction of this object must be
625 // done when running in threaded mode (before spawning a lot of threads 625 // done when running in threaded mode (before spawning a lot of threads
626 // for construction, and after shutting down all the threads for destruction). 626 // for construction, and after shutting down all the threads for destruction).
627 627
628 // To prevent grabbing thread local store resources time and again if someone 628 // To prevent grabbing thread local store resources time and again if someone
629 // chooses to try to re-run the browser many times, we maintain global state and 629 // chooses to try to re-run the browser many times, we maintain global state and
630 // only allow the tracking system to be started up at most once, and shutdown 630 // only allow the tracking system to be started up at most once, and shutdown
631 // at most once. See bug 31344 for an example. 631 // at most once. See bug 31344 for an example.
632 632
633 class AutoTracking { 633 class BASE_API AutoTracking {
634 public: 634 public:
635 AutoTracking() { 635 AutoTracking() {
636 if (state_ != kNeverBeenRun) 636 if (state_ != kNeverBeenRun)
637 return; 637 return;
638 ThreadData::StartTracking(true); 638 ThreadData::StartTracking(true);
639 state_ = kRunning; 639 state_ = kRunning;
640 } 640 }
641 641
642 ~AutoTracking() { 642 ~AutoTracking() {
643 #ifndef NDEBUG 643 #ifndef NDEBUG
(...skipping 14 matching lines...) Expand all
658 }; 658 };
659 static State state_; 659 static State state_;
660 660
661 DISALLOW_COPY_AND_ASSIGN(AutoTracking); 661 DISALLOW_COPY_AND_ASSIGN(AutoTracking);
662 }; 662 };
663 663
664 664
665 } // namespace tracked_objects 665 } // namespace tracked_objects
666 666
667 #endif // BASE_TRACKED_OBJECTS_H_ 667 #endif // BASE_TRACKED_OBJECTS_H_
OLDNEW
« no previous file with comments | « base/string_util.h ('k') | base/utf_offset_string_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698