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/basictypes.h" | |
17 #include "third_party/webrtc/overrides/webrtc/base/logging.h" | 16 #include "third_party/webrtc/overrides/webrtc/base/logging.h" |
18 #include "third_party/webrtc/system_wrappers/interface/cpu_info.h" | 17 #include "third_party/webrtc/system_wrappers/interface/cpu_info.h" |
19 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" | 18 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" |
20 | 19 |
21 const unsigned char* GetCategoryGroupEnabled(const char* category_group) { | 20 const unsigned char* GetCategoryGroupEnabled(const char* category_group) { |
22 return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); | 21 return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); |
23 } | 22 } |
24 | 23 |
25 void AddTraceEvent(char phase, | 24 void AddTraceEvent(char phase, |
26 const unsigned char* category_group_enabled, | 25 const unsigned char* category_group_enabled, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } // namespace webrtc | 78 } // namespace webrtc |
80 | 79 |
81 bool InitializeWebRtcModule() { | 80 bool InitializeWebRtcModule() { |
82 // Workaround for crbug.com/176522 | 81 // Workaround for crbug.com/176522 |
83 // 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 |
84 // initialized, so we call DetectNumberOfCores() here, to cache the value. | 83 // initialized, so we call DetectNumberOfCores() here, to cache the value. |
85 webrtc::CpuInfo::DetectNumberOfCores(); | 84 webrtc::CpuInfo::DetectNumberOfCores(); |
86 webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent); | 85 webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent); |
87 return true; | 86 return true; |
88 } | 87 } |
OLD | NEW |