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

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed)

Created:
4 years, 10 months ago by Primiano Tucci (use gerrit)
Modified:
4 years, 9 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, cc-bugs_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

tracing: Make ConvertableToTraceFormat move-only Summary. This CL: - Makes TraceEvent ownership a move-only scoped_ptr. - Makes ConvertableToTraceFormat (CTTF) itself move-only scoped_ptr. - Updates all the codebase that uses CTTF in TRACE_EVENT macros to use move-only semantics. Background: Historically ConvertableToTraceFormat (CTTF) was RefCounted. The main reason seems to be supporting monitoring mode (now deprecated) where tracing needed to copy TraceEvents without flushing the TraceLog. Not what monitoring mode is gone, there is no reason why TraceEvent(s) should not be move-only. Unfortunately CTTF being RefCounted exposed that implementation detail to its public interface. Fortunately, most of the codebase doesn't care about the fact that CTTF is RefCounted. The only exceptions are: 1. Memory-infra heap profiler {StackFrame,TypeInfo}Deduplicator 2. cc::Layer DebugInfo 1) Is addressed creating a proxy class which delegates the CTTF methods to the duplicators inside MDSessionState. Essentially it makes the CTTF metadata events shared co-owners of the MDSessionState. 2) After an offline chat with danakj@, it seems OK to make DebugInfo(s) moved scoped_ptr (as opposite as copied), moving the ownership to the active layer and keeping a raw ptr into the pending layer. BUG=559117 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel TBR=thakis,jochen,tbarzic,mnaganov,skyostil Committed: https://crrev.com/cb1afb351f2232e22b4be9bbbe7c0449decee471 Cr-Commit-Position: refs/heads/master@{#378263}

Patch Set 1 : . #

Total comments: 3

Patch Set 2 : template inference, oh my... #

Patch Set 3 : rebase #

Patch Set 4 : Address danak@ review (no auto = make_scoped_ptr) + fix test #

Patch Set 5 : rebase #

Total comments: 13

Patch Set 6 : Petrcermak + oysteine review + LayerDebugInfo refptr wrapper #

Total comments: 1

Patch Set 7 : No need for refptr, active layer outlives pending, whatever it means #

Total comments: 4

Patch Set 8 : Reverse ownership when pushing pending->acive layer #

Patch Set 9 : rebase #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+612 lines, -484 lines) Patch
M android_webview/browser/browser_view_renderer.h View 1 chunk +3 lines, -3 lines 0 comments Download
M android_webview/browser/browser_view_renderer.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M base/test/test_pending_task.h View 1 chunk +1 line, -1 line 0 comments Download
M base/test/test_pending_task.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M base/test/test_pending_task_unittest.cc View 1 chunk +3 lines, -1 line 0 comments Download
M base/trace_event/common/trace_event_common.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/heap_profiler_heap_dump_writer.h View 3 chunks +3 lines, -3 lines 0 comments Download
M base/trace_event/heap_profiler_heap_dump_writer.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M base/trace_event/heap_profiler_heap_dump_writer_unittest.cc View 4 chunks +5 lines, -6 lines 0 comments Download
M base/trace_event/heap_profiler_stack_frame_deduplicator.h View 2 chunks +1 line, -2 lines 0 comments Download
M base/trace_event/heap_profiler_stack_frame_deduplicator.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M base/trace_event/heap_profiler_type_name_deduplicator.h View 1 chunk +4 lines, -5 lines 0 comments Download
M base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc View 4 chunks +4 lines, -5 lines 0 comments Download
M base/trace_event/memory_allocator_dump.h View 2 chunks +2 lines, -2 lines 0 comments Download
M base/trace_event/memory_allocator_dump_unittest.cc View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M base/trace_event/memory_dump_manager.cc View 1 2 3 4 5 3 chunks +44 lines, -13 lines 0 comments Download
M base/trace_event/memory_dump_session_state.h View 2 chunks +12 lines, -8 lines 0 comments Download
M base/trace_event/memory_dump_session_state.cc View 1 2 3 4 5 1 chunk +13 lines, -6 lines 0 comments Download
M base/trace_event/process_memory_dump.h View 2 chunks +2 lines, -3 lines 0 comments Download
M base/trace_event/process_memory_dump.cc View 2 chunks +6 lines, -3 lines 0 comments Download
M base/trace_event/process_memory_dump_unittest.cc View 5 chunks +10 lines, -10 lines 0 comments Download
M base/trace_event/trace_config.h View 1 chunk +2 lines, -2 lines 0 comments Download
M base/trace_event/trace_config.cc View 2 chunks +4 lines, -6 lines 0 comments Download
M base/trace_event/trace_event.h View 1 2 3 15 chunks +106 lines, -32 lines 0 comments Download
M base/trace_event/trace_event_android.cc View 1 chunk +9 lines, -10 lines 0 comments Download
M base/trace_event/trace_event_argument.h View 2 chunks +1 line, -2 lines 0 comments Download
M base/trace_event/trace_event_argument_unittest.cc View 1 2 3 4 5 6 chunks +7 lines, -7 lines 0 comments Download
M base/trace_event/trace_event_etw_export_win.h View 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/trace_event_etw_export_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/trace_event_impl.h View 6 chunks +26 lines, -30 lines 0 comments Download
M base/trace_event/trace_event_impl.cc View 6 chunks +31 lines, -32 lines 0 comments Download
M base/trace_event/trace_event_system_stats_monitor.cc View 3 chunks +4 lines, -6 lines 0 comments Download
M base/trace_event/trace_event_unittest.cc View 1 2 3 4 chunks +48 lines, -35 lines 0 comments Download
M base/trace_event/trace_log.h View 1 2 6 chunks +6 lines, -6 lines 0 comments Download
M base/trace_event/trace_log.cc View 1 2 7 chunks +12 lines, -9 lines 0 comments Download
M base/trace_event/winheap_dump_provider_win_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/debug/benchmark_instrumentation.cc View 1 1 chunk +4 lines, -7 lines 0 comments Download
M cc/debug/devtools_instrumentation.h View 1 2 3 2 chunks +8 lines, -8 lines 0 comments Download
M cc/debug/frame_timing_tracker_unittest.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M cc/debug/frame_viewer_instrumentation.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M cc/debug/rendering_stats.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/debug/rendering_stats.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M cc/debug/rendering_stats_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M cc/debug/traced_display_item_list.h View 1 chunk +2 lines, -2 lines 0 comments Download
M cc/debug/traced_display_item_list.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M cc/layers/layer.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/layer.cc View 6 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/layer_client.h View 2 chunks +3 lines, -3 lines 0 comments Download
M cc/layers/layer_impl.h View 1 2 3 4 5 6 2 chunks +4 lines, -3 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 5 6 7 4 chunks +7 lines, -4 lines 3 comments Download
M cc/output/begin_frame_args.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/output/begin_frame_args.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M cc/playback/display_item_list.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/playback/display_item_list.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M cc/raster/bitmap_tile_task_worker_pool.h View 1 chunk +1 line, -2 lines 0 comments Download
M cc/raster/one_copy_tile_task_worker_pool.h View 1 chunk +1 line, -2 lines 0 comments Download
M cc/raster/zero_copy_tile_task_worker_pool.h View 1 chunk +1 line, -2 lines 0 comments Download
M cc/scheduler/begin_frame_source_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M cc/scheduler/scheduler.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/scheduler/scheduler.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M cc/scheduler/scheduler_settings.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/scheduler/scheduler_settings.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M cc/scheduler/scheduler_state_machine.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/scheduler/scheduler_state_machine.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M cc/scheduler/scheduler_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/test/ordered_simple_task_runner.h View 2 chunks +2 lines, -2 lines 0 comments Download
M cc/test/ordered_simple_task_runner.cc View 1 2 3 2 chunks +8 lines, -8 lines 0 comments Download
M cc/tiles/tile_manager.h View 3 chunks +3 lines, -3 lines 0 comments Download
M cc/tiles/tile_manager.cc View 1 2 3 3 chunks +12 lines, -13 lines 0 comments Download
M cc/trees/layer_tree_host_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/extensions/wallpaper_api.h View 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/chromeos/extensions/wallpaper_private_api.h View 1 chunk +4 lines, -0 lines 0 comments Download
M components/exo/buffer.h View 1 chunk +1 line, -1 line 0 comments Download
M components/exo/buffer.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M components/exo/shell_surface.h View 1 chunk +1 line, -1 line 0 comments Download
M components/exo/shell_surface.cc View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download
M components/exo/sub_surface.h View 2 chunks +2 lines, -2 lines 0 comments Download
M components/exo/sub_surface.cc View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download
M components/exo/surface.h View 1 chunk +1 line, -1 line 0 comments Download
M components/exo/surface.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M components/scheduler/base/task_queue_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M components/scheduler/base/task_queue_manager.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler_impl.h View 1 chunk +2 lines, -2 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler_impl.cc View 1 2 3 2 chunks +5 lines, -6 lines 0 comments Download
M content/browser/devtools/devtools_frame_trace_recorder.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/renderer/devtools/v8_sampling_profiler.cc View 1 2 3 5 chunks +16 lines, -12 lines 0 comments Download
M extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/service/gpu_state_tracer.cc View 4 chunks +9 lines, -10 lines 0 comments Download
M net/log/trace_net_log_observer.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/EventTracer.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/EventTracer.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/TracedValue.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc View 1 2 3 4 1 chunk +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M ui/compositor/layer.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/compositor/layer.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M ui/compositor/layer_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/events/latency_info.h View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M ui/events/latency_info.cc View 1 2 4 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 50 (26 generated)
Primiano Tucci (use gerrit)
FYI. I think we should have first the discussion on https://groups.google.com/a/chromium.org/forum/#!topic/tracing/JBk2-0P5Lmk before getting to the ...
4 years, 10 months ago (2016-02-22 22:39:31 UTC) #4
Primiano Tucci (use gerrit)
+danakj for cc/layers/* (as per offline thread) +ssid for a second eye on base/trace_event/*memory* +oysteine ...
4 years, 10 months ago (2016-02-25 21:18:27 UTC) #13
danakj
cc LGTM https://codereview.chromium.org/1717283003/diff/80001/cc/debug/benchmark_instrumentation.cc File cc/debug/benchmark_instrumentation.cc (right): https://codereview.chromium.org/1717283003/diff/80001/cc/debug/benchmark_instrumentation.cc#newcode23 cc/debug/benchmark_instrumentation.cc:23: auto record_data = make_scoped_ptr(new base::trace_event::TracedValue()); current guidance ...
4 years, 10 months ago (2016-02-25 23:10:07 UTC) #14
Primiano Tucci (use gerrit)
+petrcermak for base/trace_event/*memory* https://codereview.chromium.org/1717283003/diff/80001/cc/debug/benchmark_instrumentation.cc File cc/debug/benchmark_instrumentation.cc (right): https://codereview.chromium.org/1717283003/diff/80001/cc/debug/benchmark_instrumentation.cc#newcode23 cc/debug/benchmark_instrumentation.cc:23: auto record_data = make_scoped_ptr(new base::trace_event::TracedValue()); On ...
4 years, 10 months ago (2016-02-26 07:01:05 UTC) #18
petrcermak
LGTM for base/trace_event/*memory* and base/trace_event/*heap_profiler* with a few comments. Thanks, Petr https://codereview.chromium.org/1717283003/diff/200001/base/trace_event/memory_allocator_dump_unittest.cc File base/trace_event/memory_allocator_dump_unittest.cc (right): ...
4 years, 10 months ago (2016-02-26 10:21:03 UTC) #19
oystein (OOO til 10th of July)
Enthusiastic lgtm :D https://codereview.chromium.org/1717283003/diff/200001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1717283003/diff/200001/base/trace_event/memory_dump_manager.cc#newcode558 base/trace_event/memory_dump_manager.cc:558: scoped_ptr<ConvertableToTraceFormat> event_value(traced_value); This looks a bit ...
4 years, 10 months ago (2016-02-26 19:46:55 UTC) #20
Primiano Tucci (use gerrit)
danak@ sorry for the double review. I realized only later that moving the DebugInfo to ...
4 years, 10 months ago (2016-02-26 22:52:50 UTC) #23
Primiano Tucci (use gerrit)
Forgot the link to the failure: https://storage.googleapis.com/chromium-layout-test-archives/win_chromium_rel_ng/180106/layout-test-results/results.html
4 years, 10 months ago (2016-02-26 22:53:21 UTC) #24
danakj
On 2016/02/26 22:52:50, Primiano (throttled til Mar 4) wrote: > danak@ sorry for the double ...
4 years, 10 months ago (2016-02-26 22:59:20 UTC) #25
danakj
https://codereview.chromium.org/1717283003/diff/260001/cc/layers/layer_impl.cc File cc/layers/layer_impl.cc (right): https://codereview.chromium.org/1717283003/diff/260001/cc/layers/layer_impl.cc#newcode207 cc/layers/layer_impl.cc:207: debug_info_ = debug_info; you should move() here, don't need ...
4 years, 10 months ago (2016-02-26 22:59:38 UTC) #26
oystein (OOO til 10th of July)
https://codereview.chromium.org/1717283003/diff/200001/base/trace_event/trace_event.h File base/trace_event/trace_event.h (right): https://codereview.chromium.org/1717283003/diff/200001/base/trace_event/trace_event.h#newcode846 base/trace_event/trace_event.h:846: template <class ARG1_CONVERTABLE_TYPE, class ARG2_TYPE> On 2016/02/26 22:52:50, Primiano ...
4 years, 10 months ago (2016-02-26 23:14:36 UTC) #27
Primiano Tucci (use gerrit)
On 2016/02/26 22:59:20, danakj wrote: > You could probably move ownership to the active layer, ...
4 years, 10 months ago (2016-02-26 23:41:17 UTC) #29
Primiano Tucci (use gerrit)
P.S. I am leaving to catch a flight to the bay. If that LG and ...
4 years, 10 months ago (2016-02-26 23:43:02 UTC) #30
danakj
https://codereview.chromium.org/1717283003/diff/300001/cc/layers/layer_impl.cc File cc/layers/layer_impl.cc (right): https://codereview.chromium.org/1717283003/diff/300001/cc/layers/layer_impl.cc#newcode614 cc/layers/layer_impl.cc:614: layer->debug_info_ = debug_info_; So not quite right. You want ...
4 years, 10 months ago (2016-02-26 23:46:24 UTC) #31
Primiano Tucci (use gerrit)
I missed my flight (stupid traffic jams) but on the good side this time I ...
4 years, 10 months ago (2016-02-27 03:12:04 UTC) #32
danakj
LGTM https://codereview.chromium.org/1717283003/diff/340001/cc/layers/layer_impl.cc File cc/layers/layer_impl.cc (right): https://codereview.chromium.org/1717283003/diff/340001/cc/layers/layer_impl.cc#newcode614 cc/layers/layer_impl.cc:614: if (owned_debug_info_) For my own understand, was it ...
4 years, 9 months ago (2016-02-29 18:19:18 UTC) #34
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1717283003/diff/340001/cc/layers/layer_impl.cc File cc/layers/layer_impl.cc (right): https://codereview.chromium.org/1717283003/diff/340001/cc/layers/layer_impl.cc#newcode614 cc/layers/layer_impl.cc:614: if (owned_debug_info_) On 2016/02/29 18:19:18, danakj wrote: > For ...
4 years, 9 months ago (2016-02-29 18:32:38 UTC) #35
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1717283003/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1717283003/340001
4 years, 9 months ago (2016-02-29 18:40:48 UTC) #37
Primiano Tucci (use gerrit)
TBR other folks due to mechanical nature of the remaining changes (it's a s/scoped_refpr/scoped_ptr/ elsewhere). ...
4 years, 9 months ago (2016-02-29 18:54:36 UTC) #40
danakj
https://codereview.chromium.org/1717283003/diff/340001/cc/layers/layer_impl.cc File cc/layers/layer_impl.cc (right): https://codereview.chromium.org/1717283003/diff/340001/cc/layers/layer_impl.cc#newcode614 cc/layers/layer_impl.cc:614: if (owned_debug_info_) On 2016/02/29 18:32:38, Primiano (throttled til Mar ...
4 years, 9 months ago (2016-02-29 19:19:07 UTC) #41
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-02-29 20:09:47 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1717283003/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1717283003/340001
4 years, 9 months ago (2016-02-29 20:37:38 UTC) #46
commit-bot: I haz the power
Committed patchset #9 (id:340001)
4 years, 9 months ago (2016-02-29 20:46:18 UTC) #48
commit-bot: I haz the power
4 years, 9 months ago (2016-02-29 20:47:43 UTC) #50
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/cb1afb351f2232e22b4be9bbbe7c0449decee471
Cr-Commit-Position: refs/heads/master@{#378263}

Powered by Google App Engine
This is Rietveld 408576698