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

Unified Diff: webrtc/rtc_base/event_tracer.cc

Issue 2961663002: Trace loggging: Check for g_event_logger is not null before calling it. (Closed)
Patch Set: Revert change. Created 3 years, 5 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 | « no previous file | webrtc/sdk/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/rtc_base/event_tracer.cc
diff --git a/webrtc/rtc_base/event_tracer.cc b/webrtc/rtc_base/event_tracer.cc
index 8a6a7d5731a2aa76ea6a64d5eedf28aa9d2ff70f..008e69845545227698bfcb212dd1ce02251a7512 100644
--- a/webrtc/rtc_base/event_tracer.cc
+++ b/webrtc/rtc_base/event_tracer.cc
@@ -374,10 +374,15 @@ void SetupInternalTracer() {
}
void StartInternalCaptureToFile(FILE* file) {
- g_event_logger->Start(file, false);
+ if (g_event_logger) {
+ g_event_logger->Start(file, false);
+ }
}
bool StartInternalCapture(const char* filename) {
+ if (!g_event_logger)
+ return false;
+
FILE* file = fopen(filename, "w");
if (!file) {
LOG(LS_ERROR) << "Failed to open trace file '" << filename
@@ -389,7 +394,9 @@ bool StartInternalCapture(const char* filename) {
}
void StopInternalCapture() {
- g_event_logger->Stop();
+ if (g_event_logger) {
+ g_event_logger->Stop();
+ }
}
void ShutdownInternalTracer() {
« no previous file with comments | « no previous file | webrtc/sdk/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698