OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "init_webrtc.h" | 5 #include "init_webrtc.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/native_library.h" | 13 #include "base/native_library.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
16 #include "third_party/webrtc/overrides/webrtc/base/logging.h" | 16 #include "third_party/webrtc_overrides/webrtc/base/logging.h" |
17 #include "third_party/webrtc/system_wrappers/interface/cpu_info.h" | 17 #include "third_party/webrtc/system_wrappers/interface/cpu_info.h" |
18 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" | 18 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" |
19 | 19 |
20 const unsigned char* GetCategoryGroupEnabled(const char* category_group) { | 20 const unsigned char* GetCategoryGroupEnabled(const char* category_group) { |
21 return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); | 21 return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); |
22 } | 22 } |
23 | 23 |
24 void AddTraceEvent(char phase, | 24 void AddTraceEvent(char phase, |
25 const unsigned char* category_group_enabled, | 25 const unsigned char* category_group_enabled, |
26 const char* name, | 26 const char* name, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } // namespace webrtc | 78 } // namespace webrtc |
79 | 79 |
80 bool InitializeWebRtcModule() { | 80 bool InitializeWebRtcModule() { |
81 // Workaround for crbug.com/176522 | 81 // Workaround for crbug.com/176522 |
82 // On Linux, we can't fetch the number of cores after the sandbox has been | 82 // On Linux, we can't fetch the number of cores after the sandbox has been |
83 // initialized, so we call DetectNumberOfCores() here, to cache the value. | 83 // initialized, so we call DetectNumberOfCores() here, to cache the value. |
84 webrtc::CpuInfo::DetectNumberOfCores(); | 84 webrtc::CpuInfo::DetectNumberOfCores(); |
85 webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent); | 85 webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent); |
86 return true; | 86 return true; |
87 } | 87 } |
OLD | NEW |