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

Unified Diff: base/profiler/test_support_library.cc

Issue 1423583002: Stack sampling profiler: handle unloaded and unloading modules (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: fix gcc compile Created 5 years, 1 month 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
« no previous file with comments | « base/profiler/stack_sampling_profiler_unittest.cc ('k') | base/profiler/win32_stack_frame_unwinder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/test_support_library.cc
diff --git a/base/profiler/test_support_library.cc b/base/profiler/test_support_library.cc
new file mode 100644
index 0000000000000000000000000000000000000000..035f8f70c053a46d0e50499d3b7b334a5475136b
--- /dev/null
+++ b/base/profiler/test_support_library.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Note: there is intentionally no header file associated with this library so
+// we don't risk implicitly demand loading it by accessing a symbol.
+
+#if defined(WIN32)
+#define BASE_PROFILER_TEST_SUPPORT_LIBRARY_EXPORT __declspec(dllexport)
+#else // defined(WIN32)
+#define BASE_PROFILER_TEST_SUPPORT_LIBRARY_EXPORT __attribute__((visibility("default")))
+#endif
+
+namespace base {
+
+// Must be defined in an extern "C" block so we can look up the unmangled name.
+extern "C" {
+
+BASE_PROFILER_TEST_SUPPORT_LIBRARY_EXPORT void InvokeCallbackFunction(
+ void (*function)(void*),
+ void* arg) {
+ function(arg);
+ // Prevent tail call.
+ volatile int i = 0;
+ i = 1;
+}
+
+} // extern "C"
+
+} // namespace base
« no previous file with comments | « base/profiler/stack_sampling_profiler_unittest.cc ('k') | base/profiler/win32_stack_frame_unwinder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698