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

Unified Diff: base/trace_event/trace_event_etw_export_win.cc

Issue 1141793003: Update from https://crrev.com/329939 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/trace_event_etw_export_win.h ('k') | base/trace_event/trace_event_memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_etw_export_win.cc
diff --git a/base/trace_event/trace_event_etw_export_win.cc b/base/trace_event/trace_event_etw_export_win.cc
index f7f9eccaa4564194a0d40325d8895d80e0858e8a..1cb3b8c85fca13ccb6c8789a44acb9f056f801da 100644
--- a/base/trace_event/trace_event_etw_export_win.cc
+++ b/base/trace_event/trace_event_etw_export_win.cc
@@ -106,12 +106,14 @@ TraceEventETWExport* TraceEventETWExport::GetInstance() {
// static
void TraceEventETWExport::EnableETWExport() {
- GetInstance()->ETWExportEnabled_ = true;
+ if (GetInstance())
+ GetInstance()->ETWExportEnabled_ = true;
}
// static
void TraceEventETWExport::DisableETWExport() {
- GetInstance()->ETWExportEnabled_ = false;
+ if (GetInstance())
+ GetInstance()->ETWExportEnabled_ = false;
}
// static
@@ -126,7 +128,8 @@ void TraceEventETWExport::AddEvent(
const unsigned long long* arg_values,
const scoped_refptr<ConvertableToTraceFormat>* convertable_values) {
// We bail early in case exporting is disabled or no consumer is listening.
- if (!GetInstance()->ETWExportEnabled_ || !EventEnabledChromeEvent())
+ if (!GetInstance() || !GetInstance()->ETWExportEnabled_ ||
+ !EventEnabledChromeEvent())
return;
std::string phase_string;
@@ -224,7 +227,8 @@ void TraceEventETWExport::AddCustomEvent(const char* name,
const char* arg_value_2,
const char* arg_name_3,
const char* arg_value_3) {
- if (!GetInstance()->ETWExportEnabled_ || !EventEnabledChromeEvent())
+ if (!GetInstance() || !GetInstance()->ETWExportEnabled_ ||
+ !EventEnabledChromeEvent())
return;
EventWriteChromeEvent(name, phase, arg_name_1, arg_value_1, arg_name_2,
« no previous file with comments | « base/trace_event/trace_event_etw_export_win.h ('k') | base/trace_event/trace_event_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698