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

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

Issue 750183008: DevTools: Parallelize trace messages serialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | base/debug/trace_event_impl.cc » ('j') | base/debug/trace_event_impl.cc » ('J')
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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 bool check_buffer_is_full); 703 bool check_buffer_is_full);
704 void CheckIfBufferIsFullWhileLocked(); 704 void CheckIfBufferIsFullWhileLocked();
705 void SetDisabledWhileLocked(); 705 void SetDisabledWhileLocked();
706 706
707 TraceEvent* GetEventByHandleInternal(TraceEventHandle handle, 707 TraceEvent* GetEventByHandleInternal(TraceEventHandle handle,
708 OptionalAutoLock* lock); 708 OptionalAutoLock* lock);
709 709
710 // |generation| is used in the following callbacks to check if the callback 710 // |generation| is used in the following callbacks to check if the callback
711 // is called for the flush of the current |logged_events_|. 711 // is called for the flush of the current |logged_events_|.
712 void FlushCurrentThread(int generation); 712 void FlushCurrentThread(int generation);
713 void ConvertTraceEventsToTraceFormat(scoped_ptr<TraceBuffer> logged_events, 713 void ConvertTraceEventsToTraceFormat(
714 const TraceLog::OutputCallback& flush_output_callback); 714 const TraceLog::OutputCallback& flush_output_callback);
715 void FinishFlush(int generation); 715 void FinishFlush(int generation);
716 void OnFlushTimeout(int generation); 716 void OnFlushTimeout(int generation);
717 717
718 int generation() const { 718 int generation() const {
719 return static_cast<int>(subtle::NoBarrier_Load(&generation_)); 719 return static_cast<int>(subtle::NoBarrier_Load(&generation_));
720 } 720 }
721 bool CheckGeneration(int generation) const { 721 bool CheckGeneration(int generation) const {
722 return generation == this->generation(); 722 return generation == this->generation();
723 } 723 }
(...skipping 18 matching lines...) Expand all
742 // This lock protects TraceLog member accesses (except for members protected 742 // This lock protects TraceLog member accesses (except for members protected
743 // by thread_info_lock_) from arbitrary threads. 743 // by thread_info_lock_) from arbitrary threads.
744 mutable Lock lock_; 744 mutable Lock lock_;
745 // This lock protects accesses to thread_names_, thread_event_start_times_ 745 // This lock protects accesses to thread_names_, thread_event_start_times_
746 // and thread_colors_. 746 // and thread_colors_.
747 Lock thread_info_lock_; 747 Lock thread_info_lock_;
748 int locked_line_; 748 int locked_line_;
749 Mode mode_; 749 Mode mode_;
750 int num_traces_recorded_; 750 int num_traces_recorded_;
751 scoped_ptr<TraceBuffer> logged_events_; 751 scoped_ptr<TraceBuffer> logged_events_;
752 scoped_ptr<TraceBuffer> previous_logged_events_;
Sami 2014/12/05 16:33:01 I'm not sure I understand why this should become a
loislo 2014/12/05 21:38:45 The compilation fails with error deeply in Bind te
Sami 2014/12/08 14:35:36 You can use Passed() to have the bind transfer own
752 subtle::AtomicWord /* EventCallback */ event_callback_; 753 subtle::AtomicWord /* EventCallback */ event_callback_;
753 bool dispatching_to_observer_list_; 754 bool dispatching_to_observer_list_;
754 std::vector<EnabledStateObserver*> enabled_state_observer_list_; 755 std::vector<EnabledStateObserver*> enabled_state_observer_list_;
755 756
756 std::string process_name_; 757 std::string process_name_;
757 base::hash_map<int, std::string> process_labels_; 758 base::hash_map<int, std::string> process_labels_;
758 int process_sort_index_; 759 int process_sort_index_;
759 base::hash_map<int, int> thread_sort_indices_; 760 base::hash_map<int, int> thread_sort_indices_;
760 base::hash_map<int, std::string> thread_names_; 761 base::hash_map<int, std::string> thread_names_;
761 762
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; 806 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_;
806 subtle::AtomicWord generation_; 807 subtle::AtomicWord generation_;
807 808
808 DISALLOW_COPY_AND_ASSIGN(TraceLog); 809 DISALLOW_COPY_AND_ASSIGN(TraceLog);
809 }; 810 };
810 811
811 } // namespace debug 812 } // namespace debug
812 } // namespace base 813 } // namespace base
813 814
814 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ 815 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | base/debug/trace_event_impl.cc » ('j') | base/debug/trace_event_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698