diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2020-03-04 15:35:43 +0100 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2020-03-06 09:28:09 +0000 |
commit | 468c292d227f555b929911c533db2e465a1489a0 (patch) | |
tree | 7d35330fafd476dcafa77b63278bea46742ec885 | |
parent | 3239a38a9b35d29e483b7bd67b786b4f9d109908 (diff) | |
download | qtwebengine-chromium-468c292d227f555b929911c533db2e465a1489a0.tar.gz |
FIXUP: Fix build with gcc 5
Restore tracing service.
Seems std::tuple in gcc 5 does not support direct construction of the elements,
so instead the elements have to be convertible and movable.
Task-number: QTBUG-81767
Change-Id: I6f700e0776c082cec82e1b1c8731d77a26f783d1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
6 files changed, 12 insertions, 31 deletions
diff --git a/chromium/base/containers/mru_cache.h b/chromium/base/containers/mru_cache.h index 4a9f44e868e..8d88c8d5c93 100644 --- a/chromium/base/containers/mru_cache.h +++ b/chromium/base/containers/mru_cache.h @@ -81,6 +81,7 @@ class MRUCacheBase { // example, maybe it has special work to do when something is evicted), it // can pass NO_AUTO_EVICT to not restrict the cache size. explicit MRUCacheBase(size_type max_size) : max_size_(max_size) {} + MRUCacheBase(MRUCacheBase&&) = default; virtual ~MRUCacheBase() = default; @@ -228,8 +229,9 @@ class MRUCache : public MRUCacheBase<KeyType, PayloadType, CompareType> { public: // See MRUCacheBase, noting the possibility of using NO_AUTO_EVICT. - explicit MRUCache(typename ParentType::size_type max_size) + MRUCache(typename ParentType::size_type max_size) : ParentType(max_size) {} + MRUCache(MRUCache&&) = default; virtual ~MRUCache() = default; private: diff --git a/chromium/services/tracing/public/cpp/BUILD.gn b/chromium/services/tracing/public/cpp/BUILD.gn index c73c16d1e70..5876a6bcb13 100644 --- a/chromium/services/tracing/public/cpp/BUILD.gn +++ b/chromium/services/tracing/public/cpp/BUILD.gn @@ -33,7 +33,7 @@ if (!is_nacl && !is_ios) { "base_agent.h", "perfetto/dummy_producer.cc", "perfetto/dummy_producer.h", -# "perfetto/interning_index.h", + "perfetto/interning_index.h", "perfetto/java_heap_profiler/java_heap_profiler_android.cc", "perfetto/java_heap_profiler/java_heap_profiler_android.h", "perfetto/perfetto_config.cc", @@ -57,10 +57,10 @@ if (!is_nacl && !is_ios) { "perfetto/trace_event_data_source.h", "perfetto/traced_value_proto_writer.cc", "perfetto/traced_value_proto_writer.h", -# "perfetto/track_event_thread_local_event_sink.cc", -# "perfetto/track_event_thread_local_event_sink.h", -# "stack_sampling/tracing_sampler_profiler.cc", -# "stack_sampling/tracing_sampler_profiler.h", + "perfetto/track_event_thread_local_event_sink.cc", + "perfetto/track_event_thread_local_event_sink.h", + "stack_sampling/tracing_sampler_profiler.cc", + "stack_sampling/tracing_sampler_profiler.h", "trace_event_agent.cc", "trace_event_agent.h", "trace_event_args_whitelist.cc", diff --git a/chromium/services/tracing/public/cpp/perfetto/interning_index.h b/chromium/services/tracing/public/cpp/perfetto/interning_index.h index c28edd6f7c1..525cdb61658 100644 --- a/chromium/services/tracing/public/cpp/perfetto/interning_index.h +++ b/chromium/services/tracing/public/cpp/perfetto/interning_index.h @@ -47,7 +47,7 @@ class COMPONENT_EXPORT(TRACING_CPP) InterningIndex { // InterningIndex<char*, std::string> index(1000, 100); template <typename... SizeType> InterningIndex(SizeType... max_entry_counts) - : entry_caches_(std::make_tuple<IndexCache<ValueTypes>...>(max_entry_counts...)) {} + : entry_caches_(max_entry_counts...) {} // Returns the entry for the given interned |value|, adding it to the index if // it didn't exist previously or was evicted from the index. Entries may be diff --git a/chromium/services/tracing/public/cpp/perfetto/trace_event_data_source.cc b/chromium/services/tracing/public/cpp/perfetto/trace_event_data_source.cc index 7607af9e4cd..2278c5bf23d 100644 --- a/chromium/services/tracing/public/cpp/perfetto/trace_event_data_source.cc +++ b/chromium/services/tracing/public/cpp/perfetto/trace_event_data_source.cc @@ -754,15 +754,12 @@ void TraceEventDataSource::Flush( } void TraceEventDataSource::ClearIncrementalState() { -#ifndef TOOLKIT_QT TrackEventThreadLocalEventSink::ClearIncrementalState(); -#endif EmitProcessDescriptor(); } std::unique_ptr<perfetto::StartupTraceWriter> TraceEventDataSource::CreateTraceWriterLocked() { -#ifndef TOOLKIT_QT lock_.AssertAcquired(); // The call to CreateTraceWriter() below posts a task which is not allowed @@ -788,14 +785,10 @@ TraceEventDataSource::CreateTraceWriterLocked() { producer_->CreateTraceWriter(target_buffer_)); } return trace_writer; -#else - return nullptr; -#endif } ThreadLocalEventSink* TraceEventDataSource::CreateThreadLocalEventSink( bool thread_will_flush) { -#ifndef TOOLKIT_QT base::AutoLock lock(lock_); uint32_t session_id = session_id_.load(std::memory_order_relaxed); @@ -807,9 +800,6 @@ ThreadLocalEventSink* TraceEventDataSource::CreateThreadLocalEventSink( return new TrackEventThreadLocalEventSink(std::move(trace_writer), session_id, disable_interning_, privacy_filtering_enabled_); -#else - return nullptr; -#endif } // static diff --git a/chromium/services/tracing/public/cpp/trace_event_agent.cc b/chromium/services/tracing/public/cpp/trace_event_agent.cc index 48d30254f03..ba0219a055d 100644 --- a/chromium/services/tracing/public/cpp/trace_event_agent.cc +++ b/chromium/services/tracing/public/cpp/trace_event_agent.cc @@ -20,13 +20,10 @@ #include "build/build_config.h" #include "services/tracing/public/cpp/perfetto/perfetto_traced_process.h" #include "services/tracing/public/cpp/perfetto/trace_event_data_source.h" +#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h" #include "services/tracing/public/cpp/trace_event_args_whitelist.h" #include "services/tracing/public/cpp/tracing_features.h" -#ifndef TOOLKIT_QT -#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h" -#endif - namespace { const char kTraceEventLabel[] = "traceEvents"; @@ -61,9 +58,7 @@ TraceEventAgent::TraceEventAgent() PerfettoTracedProcess::Get()->AddDataSource( TraceEventDataSource::GetInstance()); -#ifndef TOOLKIT_QT TracingSamplerProfiler::RegisterDataSource(); -#endif } TraceEventAgent::~TraceEventAgent() = default; diff --git a/chromium/services/tracing/public/cpp/trace_startup.cc b/chromium/services/tracing/public/cpp/trace_startup.cc index b26e0eba2cc..a9b0f7ea885 100644 --- a/chromium/services/tracing/public/cpp/trace_startup.cc +++ b/chromium/services/tracing/public/cpp/trace_startup.cc @@ -12,14 +12,11 @@ #include "components/tracing/common/trace_to_console.h" #include "components/tracing/common/tracing_switches.h" #include "services/tracing/public/cpp/perfetto/trace_event_data_source.h" +#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h" #include "services/tracing/public/cpp/trace_event_agent.h" #include "services/tracing/public/cpp/trace_event_args_whitelist.h" #include "services/tracing/public/cpp/tracing_features.h" -#ifndef TOOLKIT_QT -#include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h" -#endif - namespace tracing { namespace { using base::trace_event::TraceConfig; @@ -45,7 +42,6 @@ void EnableStartupTracingIfNeeded() { // Ensure TraceLog is initialized first. // https://crbug.com/764357 auto* trace_log = TraceLog::GetInstance(); -#ifndef TOOLKIT_QT auto* startup_config = TraceStartupConfig::GetInstance(); if (startup_config->IsEnabled()) { @@ -82,9 +78,7 @@ void EnableStartupTracingIfNeeded() { if (!trace_config.event_filters().empty()) modes |= TraceLog::FILTERING_MODE; trace_log->SetEnabled(trace_config, modes); - } else -#endif - if (command_line.HasSwitch(switches::kTraceToConsole)) { + } else if (command_line.HasSwitch(switches::kTraceToConsole)) { // TODO(eseckler): Remove ability to trace to the console, perfetto doesn't // support this and noone seems to use it. TraceConfig trace_config = GetConfigForTraceToConsole(); |