OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "base/trace_event/trace_log.h" | 5 #include "base/trace_event/trace_log.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 int generation = this->generation(); | 876 int generation = this->generation(); |
877 // Copy of thread_message_loops_ to be used without locking. | 877 // Copy of thread_message_loops_ to be used without locking. |
878 std::vector<scoped_refptr<SingleThreadTaskRunner>> | 878 std::vector<scoped_refptr<SingleThreadTaskRunner>> |
879 thread_message_loop_task_runners; | 879 thread_message_loop_task_runners; |
880 { | 880 { |
881 AutoLock lock(lock_); | 881 AutoLock lock(lock_); |
882 DCHECK(!flush_task_runner_); | 882 DCHECK(!flush_task_runner_); |
883 flush_task_runner_ = ThreadTaskRunnerHandle::IsSet() | 883 flush_task_runner_ = ThreadTaskRunnerHandle::IsSet() |
884 ? ThreadTaskRunnerHandle::Get() | 884 ? ThreadTaskRunnerHandle::Get() |
885 : nullptr; | 885 : nullptr; |
886 DCHECK_IMPLIES(thread_message_loops_.size(), flush_task_runner_); | 886 DCHECK(!thread_message_loops_.size() || flush_task_runner_); |
887 flush_output_callback_ = cb; | 887 flush_output_callback_ = cb; |
888 | 888 |
889 if (thread_shared_chunk_) { | 889 if (thread_shared_chunk_) { |
890 logged_events_->ReturnChunk(thread_shared_chunk_index_, | 890 logged_events_->ReturnChunk(thread_shared_chunk_index_, |
891 thread_shared_chunk_.Pass()); | 891 thread_shared_chunk_.Pass()); |
892 } | 892 } |
893 | 893 |
894 if (thread_message_loops_.size()) { | 894 if (thread_message_loops_.size()) { |
895 for (hash_set<MessageLoop*>::const_iterator it = | 895 for (hash_set<MessageLoop*>::const_iterator it = |
896 thread_message_loops_.begin(); | 896 thread_message_loops_.begin(); |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 } | 1725 } |
1726 | 1726 |
1727 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1727 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1728 if (*category_group_enabled_) { | 1728 if (*category_group_enabled_) { |
1729 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1729 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1730 event_handle_); | 1730 event_handle_); |
1731 } | 1731 } |
1732 } | 1732 } |
1733 | 1733 |
1734 } // namespace trace_event_internal | 1734 } // namespace trace_event_internal |
OLD | NEW |