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

Side by Side Diff: base/trace_event/trace_log.cc

Issue 2411333005: Remove the NOTREACHED introduced by crrev.com/2323483005. (Closed)
Patch Set: Created 4 years, 2 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 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 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 739
740 // Can't enable tracing when Flush() is in progress. 740 // Can't enable tracing when Flush() is in progress.
741 DCHECK(!flush_task_runner_); 741 DCHECK(!flush_task_runner_);
742 742
743 InternalTraceOptions new_options = 743 InternalTraceOptions new_options =
744 GetInternalOptionsFromTraceConfig(trace_config); 744 GetInternalOptionsFromTraceConfig(trace_config);
745 745
746 InternalTraceOptions old_options = trace_options(); 746 InternalTraceOptions old_options = trace_options();
747 747
748 if (dispatching_to_observer_list_) { 748 if (dispatching_to_observer_list_) {
749 NOTREACHED() 749 // TODO(ssid): Change to NOTREACHED after fixing crbug.com/625170.
750 DLOG(ERROR)
750 << "Cannot manipulate TraceLog::Enabled state from an observer."; 751 << "Cannot manipulate TraceLog::Enabled state from an observer.";
751 return; 752 return;
752 } 753 }
753 754
754 // Clear all filters from previous tracing session. These filters are not 755 // Clear all filters from previous tracing session. These filters are not
755 // cleared at the end of tracing because some threads which hit trace event 756 // cleared at the end of tracing because some threads which hit trace event
756 // when disabling, could try to use the filters. 757 // when disabling, could try to use the filters.
757 if (!enabled_modes_) 758 if (!enabled_modes_)
758 g_category_group_filters.Get().clear(); 759 g_category_group_filters.Get().clear();
759 760
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 SetDisabledWhileLocked(modes_to_disable); 869 SetDisabledWhileLocked(modes_to_disable);
869 } 870 }
870 871
871 void TraceLog::SetDisabledWhileLocked(uint8_t modes_to_disable) { 872 void TraceLog::SetDisabledWhileLocked(uint8_t modes_to_disable) {
872 lock_.AssertAcquired(); 873 lock_.AssertAcquired();
873 874
874 if (!(enabled_modes_ & modes_to_disable)) 875 if (!(enabled_modes_ & modes_to_disable))
875 return; 876 return;
876 877
877 if (dispatching_to_observer_list_) { 878 if (dispatching_to_observer_list_) {
878 NOTREACHED() 879 DLOG(ERROR)
Ilya Kulshin 2016/10/13 23:35:07 Add TODO here, similar to the previous call.
879 << "Cannot manipulate TraceLog::Enabled state from an observer."; 880 << "Cannot manipulate TraceLog::Enabled state from an observer.";
880 return; 881 return;
881 } 882 }
882 883
883 bool is_recording_mode_disabled = 884 bool is_recording_mode_disabled =
884 (enabled_modes_ & RECORDING_MODE) && (modes_to_disable & RECORDING_MODE); 885 (enabled_modes_ & RECORDING_MODE) && (modes_to_disable & RECORDING_MODE);
885 enabled_modes_ &= ~modes_to_disable; 886 enabled_modes_ &= ~modes_to_disable;
886 887
887 if (modes_to_disable & FILTERING_MODE) 888 if (modes_to_disable & FILTERING_MODE)
888 enabled_event_filters_.clear(); 889 enabled_event_filters_.clear();
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1971 } 1972 }
1972 1973
1973 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { 1974 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() {
1974 if (*category_group_enabled_) { 1975 if (*category_group_enabled_) {
1975 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, 1976 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_,
1976 event_handle_); 1977 event_handle_);
1977 } 1978 }
1978 } 1979 }
1979 1980
1980 } // namespace trace_event_internal 1981 } // namespace trace_event_internal
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