summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorruuda <ruuda@google.com>2015-08-17 10:01:59 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-17 17:02:36 +0000
commitda965e85fdb2008392c3d313a04a67f8e794ddad (patch)
treeaec2abe12b7bc34bb0f85d1e9258eb0a2b79521e /components
parent64202083a339fc6bd939fd75210cc29ac3aeda9c (diff)
downloadchromium_src-da965e85fdb2008392c3d313a04a67f8e794ddad.zip
chromium_src-da965e85fdb2008392c3d313a04a67f8e794ddad.tar.gz
chromium_src-da965e85fdb2008392c3d313a04a67f8e794ddad.tar.bz2
Convert components/tracing from static lib to component
This is a prerequisite for https://crrev.com/1292583002. BUG=518823 Review URL: https://codereview.chromium.org/1298683002 Cr-Commit-Position: refs/heads/master@{#343700}
Diffstat (limited to 'components')
-rw-r--r--components/tracing.gyp6
-rw-r--r--components/tracing/BUILD.gn10
-rw-r--r--components/tracing/child_trace_message_filter.h3
-rw-r--r--components/tracing/startup_tracing.h4
-rw-r--r--components/tracing/tracing_export.h29
-rw-r--r--components/tracing/tracing_messages.h3
6 files changed, 50 insertions, 5 deletions
diff --git a/components/tracing.gyp b/components/tracing.gyp
index 7857830..32b1bb7 100644
--- a/components/tracing.gyp
+++ b/components/tracing.gyp
@@ -14,7 +14,7 @@
'targets' : [
{
'target_name': 'tracing',
- 'type': 'static_library',
+ 'type': '<(component)',
'dependencies': [
'../base/base.gyp:base',
'../ipc/ipc.gyp:ipc',
@@ -22,11 +22,15 @@
'include_dirs': [
'..',
],
+ 'defines': [
+ 'TRACING_IMPLEMENTATION=1',
+ ],
'sources': [
'tracing/child_memory_dump_manager_delegate_impl.cc',
'tracing/child_memory_dump_manager_delegate_impl.h',
'tracing/child_trace_message_filter.cc',
'tracing/child_trace_message_filter.h',
+ 'tracing/tracing_export.h',
'tracing/startup_tracing.cc',
'tracing/startup_tracing.h',
'tracing/tracing_messages.cc',
diff --git a/components/tracing/BUILD.gn b/components/tracing/BUILD.gn
index 336f5cb..b3186d9 100644
--- a/components/tracing/BUILD.gn
+++ b/components/tracing/BUILD.gn
@@ -2,28 +2,34 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-source_set("tracing") {
+component("tracing") {
sources = [
"child_memory_dump_manager_delegate_impl.cc",
"child_memory_dump_manager_delegate_impl.h",
"child_trace_message_filter.cc",
"child_trace_message_filter.h",
+ "tracing_export.h",
"tracing_messages.cc",
"tracing_messages.h",
]
+ defines = [ "TRACING_IMPLEMENTATION" ]
+
deps = [
"//base",
"//ipc",
]
}
-source_set("startup_tracing") {
+component("startup_tracing") {
sources = [
"startup_tracing.cc",
"startup_tracing.h",
+ "tracing_export.h",
]
+ defines = [ "TRACING_IMPLEMENTATION" ]
+
deps = [
"//base",
]
diff --git a/components/tracing/child_trace_message_filter.h b/components/tracing/child_trace_message_filter.h
index 0686de5..06c276d 100644
--- a/components/tracing/child_trace_message_filter.h
+++ b/components/tracing/child_trace_message_filter.h
@@ -10,6 +10,7 @@
#include "base/metrics/histogram.h"
#include "base/time/time.h"
#include "base/trace_event/memory_dump_request_args.h"
+#include "components/tracing/tracing_export.h"
#include "ipc/message_filter.h"
namespace base {
@@ -19,7 +20,7 @@ class SingleThreadTaskRunner;
namespace tracing {
// This class sends and receives trace messages on child processes.
-class ChildTraceMessageFilter : public IPC::MessageFilter {
+class TRACING_EXPORT ChildTraceMessageFilter : public IPC::MessageFilter {
public:
explicit ChildTraceMessageFilter(
base::SingleThreadTaskRunner* ipc_task_runner);
diff --git a/components/tracing/startup_tracing.h b/components/tracing/startup_tracing.h
index ae68f6f..5d1c74d 100644
--- a/components/tracing/startup_tracing.h
+++ b/components/tracing/startup_tracing.h
@@ -5,13 +5,15 @@
#ifndef COMPONENTS_TRACING_STARTUP_TRACING_H_
#define COMPONENTS_TRACING_STARTUP_TRACING_H_
+#include "components/tracing/tracing_export.h"
+
namespace tracing {
// Enable startup tracing according to the trace config file. If the trace
// config file does not exist, it will do nothing. This is designed to be used
// by Telemetry. Telemetry will stop tracing via DevTools later. To avoid
// conflict, this should not be used when --trace-startup is enabled.
-void EnableStartupTracingIfConfigFileExists();
+void TRACING_EXPORT EnableStartupTracingIfConfigFileExists();
} // namespace tracing
diff --git a/components/tracing/tracing_export.h b/components/tracing/tracing_export.h
new file mode 100644
index 0000000..ac24e30
--- /dev/null
+++ b/components/tracing/tracing_export.h
@@ -0,0 +1,29 @@
+// 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.
+
+#ifndef COMPONENTS_TRACING_TRACING_EXPORT_H_
+#define COMPONENTS_TRACING_TRACING_EXPORT_H_
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+
+#if defined(TRACING_IMPLEMENTATION)
+#define TRACING_EXPORT __declspec(dllexport)
+#else
+#define TRACING_EXPORT __declspec(dllimport)
+#endif // defined(TRACING_IMPLEMENTATION)
+
+#else // defined(WIN32)
+#if defined(TRACING_IMPLEMENTATION)
+#define TRACING_EXPORT __attribute__((visibility("default")))
+#else
+#define TRACING_EXPORT
+#endif // defined(TRACING_IMPLEMENTATION)
+#endif
+
+#else // defined(COMPONENT_BUILD)
+#define TRACING_EXPORT
+#endif
+
+#endif // COMPONENTS_TRACING_TRACING_EXPORT_H_
diff --git a/components/tracing/tracing_messages.h b/components/tracing/tracing_messages.h
index 7b24442..b14254e 100644
--- a/components/tracing/tracing_messages.h
+++ b/components/tracing/tracing_messages.h
@@ -11,11 +11,14 @@
#include "base/sync_socket.h"
#include "base/trace_event/memory_dump_request_args.h"
#include "base/trace_event/trace_event_impl.h"
+#include "components/tracing/tracing_export.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_platform_file.h"
+#undef IPC_MESSAGE_EXPORT
+#define IPC_MESSAGE_EXPORT TRACING_EXPORT
#define IPC_MESSAGE_START TracingMsgStart
IPC_STRUCT_TRAITS_BEGIN(base::trace_event::TraceLogStatus)