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

Side by Side Diff: base/debug/trace_event_impl.h

Issue 28593003: Avoid threading races on TraceSamplingThread's members (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed races on WaitableEvent Created 7 years, 1 month 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 | « no previous file | base/debug/trace_event_impl.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 5
6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_
7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_
8 8
9 #include <stack> 9 #include <stack>
10 #include <string> 10 #include <string>
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 void SetWatchEvent(const std::string& category_name, 529 void SetWatchEvent(const std::string& category_name,
530 const std::string& event_name); 530 const std::string& event_name);
531 // Cancel the watch event. If tracing is enabled, this may race with the 531 // Cancel the watch event. If tracing is enabled, this may race with the
532 // watch event notification firing. 532 // watch event notification firing.
533 void CancelWatchEvent(); 533 void CancelWatchEvent();
534 534
535 int process_id() const { return process_id_; } 535 int process_id() const { return process_id_; }
536 536
537 // Exposed for unittesting: 537 // Exposed for unittesting:
538 538
539 void InstallWaitableEventForSamplingTesting(WaitableEvent* waitable_event); 539 void WaitSamplingEventForTesting();
540 540
541 // Allows deleting our singleton instance. 541 // Allows deleting our singleton instance.
542 static void DeleteForTesting(); 542 static void DeleteForTesting();
543 543
544 // Allow tests to inspect TraceEvents. 544 // Allow tests to inspect TraceEvents.
545 size_t GetEventsSize() const { return logged_events_->Size(); } 545 size_t GetEventsSize() const { return logged_events_->Size(); }
546 TraceEvent* GetEventByHandle(TraceEventHandle handle); 546 TraceEvent* GetEventByHandle(TraceEventHandle handle);
547 547
548 void SetProcessID(int process_id); 548 void SetProcessID(int process_id);
549 549
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; 716 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_;
717 subtle::AtomicWord generation_; 717 subtle::AtomicWord generation_;
718 718
719 DISALLOW_COPY_AND_ASSIGN(TraceLog); 719 DISALLOW_COPY_AND_ASSIGN(TraceLog);
720 }; 720 };
721 721
722 } // namespace debug 722 } // namespace debug
723 } // namespace base 723 } // namespace base
724 724
725 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ 725 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | base/debug/trace_event_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698