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

Side by Side Diff: base/tracked_objects.h

Issue 1277683005: Turning return by const value to return by const ref in BirthOnThread::location() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <stack> 10 #include <stack>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 namespace tracked_objects { 193 namespace tracked_objects {
194 194
195 //------------------------------------------------------------------------------ 195 //------------------------------------------------------------------------------
196 // For a specific thread, and a specific birth place, the collection of all 196 // For a specific thread, and a specific birth place, the collection of all
197 // death info (with tallies for each death thread, to prevent access conflicts). 197 // death info (with tallies for each death thread, to prevent access conflicts).
198 class ThreadData; 198 class ThreadData;
199 class BASE_EXPORT BirthOnThread { 199 class BASE_EXPORT BirthOnThread {
200 public: 200 public:
201 BirthOnThread(const Location& location, const ThreadData& current); 201 BirthOnThread(const Location& location, const ThreadData& current);
202 202
203 const Location location() const { return location_; } 203 const Location& location() const { return location_; }
204 const ThreadData* birth_thread() const { return birth_thread_; } 204 const ThreadData* birth_thread() const { return birth_thread_; }
205 205
206 private: 206 private:
207 // File/lineno of birth. This defines the essence of the task, as the context 207 // File/lineno of birth. This defines the essence of the task, as the context
208 // of the birth (construction) often tell what the item is for. This field 208 // of the birth (construction) often tell what the item is for. This field
209 // is const, and hence safe to access from any thread. 209 // is const, and hence safe to access from any thread.
210 const Location location_; 210 const Location location_;
211 211
212 // The thread that records births into this object. Only this thread is 212 // The thread that records births into this object. Only this thread is
213 // allowed to update birth_count_ (which changes over time). 213 // allowed to update birth_count_ (which changes over time).
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 ProcessDataSnapshot(); 804 ProcessDataSnapshot();
805 ~ProcessDataSnapshot(); 805 ~ProcessDataSnapshot();
806 806
807 PhasedProcessDataSnapshotMap phased_snapshots; 807 PhasedProcessDataSnapshotMap phased_snapshots;
808 base::ProcessId process_id; 808 base::ProcessId process_id;
809 }; 809 };
810 810
811 } // namespace tracked_objects 811 } // namespace tracked_objects
812 812
813 #endif // BASE_TRACKED_OBJECTS_H_ 813 #endif // BASE_TRACKED_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698