| 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" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 base::HistogramBase::kUmaTargetedHistogramFlag)); | 58 base::HistogramBase::kUmaTargetedHistogramFlag)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 Histogram* HistogramFactoryGetEnumeration( | 61 Histogram* HistogramFactoryGetEnumeration( |
| 62 const std::string& name, int boundary) { | 62 const std::string& name, int boundary) { |
| 63 return reinterpret_cast<Histogram*>( | 63 return reinterpret_cast<Histogram*>( |
| 64 base::LinearHistogram::FactoryGet(name, 1, boundary, boundary + 1, | 64 base::LinearHistogram::FactoryGet(name, 1, boundary, boundary + 1, |
| 65 base::HistogramBase::kUmaTargetedHistogramFlag)); | 65 base::HistogramBase::kUmaTargetedHistogramFlag)); |
| 66 } | 66 } |
| 67 | 67 |
| 68 const std::string& GetHistogramName(Histogram* histogram_pointer) { | 68 const char* GetHistogramName(Histogram* histogram_pointer) { |
| 69 base::HistogramBase* ptr = | 69 base::HistogramBase* ptr = |
| 70 reinterpret_cast<base::HistogramBase*>(histogram_pointer); | 70 reinterpret_cast<base::HistogramBase*>(histogram_pointer); |
| 71 return ptr->histogram_name(); | 71 return ptr->histogram_name(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void HistogramAdd(Histogram* histogram_pointer, int sample) { | 74 void HistogramAdd(Histogram* histogram_pointer, int sample) { |
| 75 base::HistogramBase* ptr = | 75 base::HistogramBase* ptr = |
| 76 reinterpret_cast<base::HistogramBase*>(histogram_pointer); | 76 reinterpret_cast<base::HistogramBase*>(histogram_pointer); |
| 77 ptr->Add(sample); | 77 ptr->Add(sample); |
| 78 } | 78 } |
| 79 } // namespace metrics | 79 } // namespace metrics |
| 80 } // namespace webrtc | 80 } // namespace webrtc |
| 81 | 81 |
| 82 bool InitializeWebRtcModule() { | 82 bool InitializeWebRtcModule() { |
| 83 // Workaround for crbug.com/176522 | 83 // Workaround for crbug.com/176522 |
| 84 // On Linux, we can't fetch the number of cores after the sandbox has been | 84 // On Linux, we can't fetch the number of cores after the sandbox has been |
| 85 // initialized, so we call DetectNumberOfCores() here, to cache the value. | 85 // initialized, so we call DetectNumberOfCores() here, to cache the value. |
| 86 webrtc::CpuInfo::DetectNumberOfCores(); | 86 webrtc::CpuInfo::DetectNumberOfCores(); |
| 87 webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent); | 87 webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent); |
| 88 return true; | 88 return true; |
| 89 } | 89 } |
| OLD | NEW |