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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 int generation = this->generation(); | 872 int generation = this->generation(); |
873 // Copy of thread_message_loops_ to be used without locking. | 873 // Copy of thread_message_loops_ to be used without locking. |
874 std::vector<scoped_refptr<SingleThreadTaskRunner>> | 874 std::vector<scoped_refptr<SingleThreadTaskRunner>> |
875 thread_message_loop_task_runners; | 875 thread_message_loop_task_runners; |
876 { | 876 { |
877 AutoLock lock(lock_); | 877 AutoLock lock(lock_); |
878 DCHECK(!flush_task_runner_); | 878 DCHECK(!flush_task_runner_); |
879 flush_task_runner_ = ThreadTaskRunnerHandle::IsSet() | 879 flush_task_runner_ = ThreadTaskRunnerHandle::IsSet() |
880 ? ThreadTaskRunnerHandle::Get() | 880 ? ThreadTaskRunnerHandle::Get() |
881 : nullptr; | 881 : nullptr; |
882 DCHECK(!thread_message_loops_.size() || flush_task_runner_); | 882 DCHECK_IMPLIES(thread_message_loops_.size(), flush_task_runner_); |
883 flush_output_callback_ = cb; | 883 flush_output_callback_ = cb; |
884 | 884 |
885 if (thread_shared_chunk_) { | 885 if (thread_shared_chunk_) { |
886 logged_events_->ReturnChunk(thread_shared_chunk_index_, | 886 logged_events_->ReturnChunk(thread_shared_chunk_index_, |
887 thread_shared_chunk_.Pass()); | 887 thread_shared_chunk_.Pass()); |
888 } | 888 } |
889 | 889 |
890 if (thread_message_loops_.size()) { | 890 if (thread_message_loops_.size()) { |
891 for (hash_set<MessageLoop*>::const_iterator it = | 891 for (hash_set<MessageLoop*>::const_iterator it = |
892 thread_message_loops_.begin(); | 892 thread_message_loops_.begin(); |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1696 } | 1696 } |
1697 | 1697 |
1698 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1698 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1699 if (*category_group_enabled_) { | 1699 if (*category_group_enabled_) { |
1700 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1700 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1701 event_handle_); | 1701 event_handle_); |
1702 } | 1702 } |
1703 } | 1703 } |
1704 | 1704 |
1705 } // namespace trace_event_internal | 1705 } // namespace trace_event_internal |
OLD | NEW |