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

Unified Diff: chrome/common/stack_sampling_configuration.cc

Issue 2702463003: NativeStackSampler implementation for Mac. (Closed)
Patch Set: rev Created 3 years, 9 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
Index: chrome/common/stack_sampling_configuration.cc
diff --git a/chrome/common/stack_sampling_configuration.cc b/chrome/common/stack_sampling_configuration.cc
index c2b0786442b1541f0c0f2ec144f5b300a16f3585..a49de276e87c29a555723347409d35a895635181 100644
--- a/chrome/common/stack_sampling_configuration.cc
+++ b/chrome/common/stack_sampling_configuration.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/rand_util.h"
+#include "build/build_config.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_switches.h"
#include "components/version_info/version_info.h"
@@ -17,16 +18,27 @@ namespace {
base::LazyInstance<StackSamplingConfiguration>::Leaky g_configuration =
LAZY_INSTANCE_INITIALIZER;
-// The profiler is currently only implemented for Windows x64, and only runs on
-// trunk, canary, and dev.
+// The profiler is currently only implemented for Windows x64 and Mac x64.
bool IsProfilerSupported() {
-#if !defined(_WIN64)
- return false;
+#if defined(OS_WIN)
+ #if defined(GOOGLE_CHROME_BUILD)
+ // Only run on canary, and dev.
+ const version_info::Channel channel = chrome::GetChannel();
+ return channel == version_info::Channel::UNKNOWN ||
+ channel == version_info::Channel::CANARY ||
+ channel == version_info::Channel::DEV;
+ #else
+ return true;
+ #endif
+#elif defined(OS_MACOSX)
+ // This is experimental, so only run on trunk.
+ #if defined(GOOGLE_CHROME_BUILD)
+ return false;
+ #else
+ return true;
+ #endif
#else
- const version_info::Channel channel = chrome::GetChannel();
- return (channel == version_info::Channel::UNKNOWN ||
- channel == version_info::Channel::CANARY ||
- channel == version_info::Channel::DEV);
+ return false;
#endif
}

Powered by Google App Engine
This is Rietveld 408576698