| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/common/stack_sampling_configuration.h" | 5 #include "chrome/common/stack_sampling_configuration.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" |
| 8 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 9 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| 10 #include "chrome/common/channel_info.h" | 11 #include "chrome/common/channel_info.h" |
| 11 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 12 #include "components/version_info/version_info.h" | 13 #include "components/version_info/version_info.h" |
| 13 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 base::LazyInstance<StackSamplingConfiguration>::Leaky g_configuration = | 18 base::LazyInstance<StackSamplingConfiguration>::Leaky g_configuration = |
| 18 LAZY_INSTANCE_INITIALIZER; | 19 LAZY_INSTANCE_INITIALIZER; |
| 19 | 20 |
| 20 // The profiler is currently only implemented for Windows x64, and only runs on | 21 // The profiler is currently only implemented for Windows x64 and Mac x64, and |
| 21 // trunk, canary, and dev. | 22 // only runs on trunk, canary, and dev. |
| 22 bool IsProfilerSupported() { | 23 bool IsProfilerSupported() { |
| 23 #if !defined(_WIN64) | 24 #if !defined(_WIN64) && !defined(OS_MACOSX) |
| 24 return false; | 25 return false; |
| 25 #else | 26 #else |
| 26 const version_info::Channel channel = chrome::GetChannel(); | 27 const version_info::Channel channel = chrome::GetChannel(); |
| 27 return (channel == version_info::Channel::UNKNOWN || | 28 return (channel == version_info::Channel::UNKNOWN || |
| 28 channel == version_info::Channel::CANARY || | 29 channel == version_info::Channel::CANARY || |
| 29 channel == version_info::Channel::DEV); | 30 channel == version_info::Channel::DEV); |
| 30 #endif | 31 #endif |
| 31 } | 32 } |
| 32 | 33 |
| 33 // Returns true if the current execution is taking place in the browser process. | 34 // Returns true if the current execution is taking place in the browser process. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 { PROFILE_GPU_PROCESS, 0}, | 193 { PROFILE_GPU_PROCESS, 0}, |
| 193 { PROFILE_BROWSER_AND_GPU_PROCESS, 80}, | 194 { PROFILE_BROWSER_AND_GPU_PROCESS, 80}, |
| 194 { PROFILE_CONTROL, 10}, | 195 { PROFILE_CONTROL, 10}, |
| 195 { PROFILE_DISABLED, 10} | 196 { PROFILE_DISABLED, 10} |
| 196 }); | 197 }); |
| 197 | 198 |
| 198 default: | 199 default: |
| 199 return PROFILE_DISABLED; | 200 return PROFILE_DISABLED; |
| 200 } | 201 } |
| 201 } | 202 } |
| OLD | NEW |