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

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed)

Created:
6 years, 2 months ago by danakj
Modified:
6 years, 2 months ago
Reviewers:
jamesr, vmpstr, enne (OOO)
CC:
cc-bugs_chromium.org, chromium-reviews, erikwright+watch_chromium.org, feature-media-reviews_chromium.org, gavinp+memory_chromium.org, jamesr, piman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

cc: Remove use of PassAs() and constructor-casting with scoped_ptr. Say you have class A and subclass B. Previously it was required to PassAs() a scoped_ptr<B> into a scoped_ptr<A>. This is no longer needed, so just use Pass(). For newly created scoped_ptrs, you can just use make_scoped_ptr always now. And when you want to return or assign an empty scoped_ptr(), you can now use nullptr directly. Also adds PRESUBMIT checks for: - return scoped<T>(foo). This should be return make_scoped_ptr(foo). - bar = scoped<T>(foo). This should be return bar = make_scoped_ptr(foo). - return scoped<T>(). This should be return nullptr. - bar = scoped<T>(). This should be return bar = nullptr. This also replaces p.reset() with p = nullptr; But it does not add a PRESUBMIT check for that because there are things other than scoped_ptr with a reset() function. R=enne@chromium.org Committed: https://crrev.com/7bb3dbede19d87f0338797756ffd738adc6bca08 Cr-Commit-Position: refs/heads/master@{#297096} Committed: https://crrev.com/f446a070a0aa29a153b0cf78b33ef22da84cb023 Cr-Commit-Position: refs/heads/master@{#297121}

Patch Set 1 : cc-passas: #

Patch Set 2 : cc-passas: rebase #

Patch Set 3 : cc-passas: bracket #

Patch Set 4 : cc-passas: no-base-changes #

Total comments: 6

Patch Set 5 : cc-passas: regexmagic #

Patch Set 6 : cc-passas: PassAs-presubmit-warning #

Unified diffs Side-by-side diffs Delta from patch set Stats (+544 lines, -619 lines) Patch
M cc/PRESUBMIT.py View 1 2 3 4 5 2 chunks +35 lines, -0 lines 0 comments Download
M cc/animation/animation_unittest.cc View 1 chunk +5 lines, -6 lines 0 comments Download
M cc/animation/keyframed_animation_curve.cc View 1 9 chunks +22 lines, -22 lines 0 comments Download
M cc/animation/keyframed_animation_curve_unittest.cc View 1 chunk +1 line, -4 lines 0 comments Download
M cc/animation/layer_animation_controller_unittest.cc View 16 chunks +26 lines, -32 lines 0 comments Download
M cc/animation/scroll_offset_animation_curve.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M cc/animation/timing_function.cc View 1 1 chunk +5 lines, -10 lines 0 comments Download
M cc/base/math_util.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M cc/base/region.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/base/scoped_ptr_vector.h View 2 chunks +2 lines, -2 lines 0 comments Download
M cc/blink/web_animation_curve_common.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M cc/blink/web_filter_animation_curve_impl.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M cc/blink/web_float_animation_curve_impl.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/blink/web_transform_animation_curve_impl.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/debug/micro_benchmark_controller.cc View 1 chunk +5 lines, -8 lines 0 comments Download
M cc/debug/micro_benchmark_controller_unittest.cc View 1 4 chunks +12 lines, -12 lines 0 comments Download
M cc/debug/picture_record_benchmark.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/debug/rasterize_and_record_benchmark.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M cc/debug/rasterize_and_record_benchmark_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/debug/unittest_only_benchmark.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/input/top_controls_manager.cc View 1 chunk +1 line, -3 lines 0 comments Download
M cc/layers/content_layer.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/delegated_renderer_layer.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl_unittest.cc View 1 7 chunks +14 lines, -15 lines 0 comments Download
M cc/layers/heads_up_display_layer.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/heads_up_display_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/heads_up_display_layer_impl_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/io_surface_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/io_surface_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/layer.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 4 chunks +4 lines, -4 lines 0 comments Download
M cc/layers/layer_impl_unittest.cc View 3 chunks +3 lines, -6 lines 0 comments Download
M cc/layers/layer_perftest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/layer_unittest.cc View 2 chunks +2 lines, -5 lines 0 comments Download
M cc/layers/nine_patch_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/nine_patch_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/painted_scrollbar_layer.cc View 4 chunks +6 lines, -7 lines 0 comments Download
M cc/layers/painted_scrollbar_layer_impl.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/picture_image_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/picture_image_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/picture_image_layer_impl_unittest.cc View 1 2 chunks +2 lines, -3 lines 0 comments Download
M cc/layers/picture_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/picture_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/picture_layer_impl_perftest.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M cc/layers/picture_layer_impl_unittest.cc View 1 9 chunks +14 lines, -17 lines 0 comments Download
M cc/layers/solid_color_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/solid_color_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/solid_color_scrollbar_layer.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/solid_color_scrollbar_layer_impl.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/layers/surface_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/surface_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/texture_layer.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M cc/layers/texture_layer_impl.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M cc/layers/texture_layer_unittest.cc View 3 chunks +3 lines, -6 lines 0 comments Download
M cc/layers/tiled_layer.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M cc/layers/tiled_layer_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M cc/layers/tiled_layer_unittest.cc View 1 2 chunks +4 lines, -6 lines 0 comments Download
M cc/layers/ui_resource_layer.cc View 3 chunks +5 lines, -6 lines 0 comments Download
M cc/layers/ui_resource_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/video_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/video_layer_impl.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M cc/output/bsp_tree.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M cc/output/delegating_renderer_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/output/gl_renderer.cc View 1 6 chunks +6 lines, -6 lines 0 comments Download
M cc/output/gl_renderer_unittest.cc View 9 chunks +17 lines, -18 lines 0 comments Download
M cc/output/output_surface_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/output/renderer_unittest.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M cc/output/software_renderer.cc View 1 3 chunks +2 lines, -3 lines 0 comments Download
M cc/output/software_renderer_unittest.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M cc/quads/draw_polygon.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M cc/quads/render_pass_unittest.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M cc/resources/bitmap_content_layer_updater.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/bitmap_skpicture_content_layer_updater.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/image_layer_updater.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/picture.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/prioritized_resource_unittest.cc View 7 chunks +7 lines, -7 lines 0 comments Download
M cc/resources/raster_worker_pool_unittest.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M cc/resources/resource_provider.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M cc/resources/resource_provider_unittest.cc View 1 28 chunks +52 lines, -54 lines 0 comments Download
M cc/resources/task_graph_runner_perftest.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/texture_mailbox_deleter_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/tile_manager_perftest.cc View 4 chunks +4 lines, -5 lines 0 comments Download
M cc/resources/tile_manager_unittest.cc View 1 5 chunks +5 lines, -6 lines 0 comments Download
M cc/resources/ui_resource_request.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/surfaces/surface_aggregator.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/test/animation_test_common.cc View 6 chunks +14 lines, -19 lines 0 comments Download
M cc/test/cc_test_suite.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/test/fake_content_layer.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/test/fake_content_layer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/test/fake_delegated_renderer_layer.cc View 1 chunk +1 line, -2 lines 0 comments Download
M cc/test/fake_delegated_renderer_layer_impl.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/test/fake_layer_tree_host_client.cc View 1 1 chunk +4 lines, -6 lines 0 comments Download
M cc/test/fake_output_surface.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/test/fake_picture_layer.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/test/fake_picture_layer_impl.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/test/fake_tile_manager.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/test/layer_test_common.h View 1 5 chunks +5 lines, -5 lines 0 comments Download
M cc/test/layer_test_common.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/test/layer_tree_pixel_test.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M cc/test/layer_tree_test.cc View 1 5 chunks +11 lines, -13 lines 0 comments Download
M cc/test/pixel_test.cc View 2 chunks +3 lines, -5 lines 0 comments Download
M cc/test/render_pass_test_utils.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/test/test_shared_bitmap_manager.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M cc/test/test_web_graphics_context_3d.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M cc/test/tiled_layer_test_common.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_host.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_common_unittest.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 10 chunks +19 lines, -19 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 35 chunks +51 lines, -67 lines 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 7 chunks +10 lines, -16 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_animation.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 10 chunks +12 lines, -12 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_copyrequest.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_host_unittest_no_message_loop.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_scroll.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 5 chunks +12 lines, -12 lines 0 comments Download
M cc/trees/layer_tree_impl_unittest.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M cc/trees/occlusion_tracker_perftest.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M cc/trees/occlusion_tracker_unittest.cc View 1 3 chunks +5 lines, -13 lines 0 comments Download
M cc/trees/single_thread_proxy.cc View 1 2 chunks +3 lines, -4 lines 0 comments Download
M cc/trees/thread_proxy.cc View 1 3 chunks +6 lines, -7 lines 0 comments Download
M cc/trees/tree_synchronizer.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/tree_synchronizer_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 30 (6 generated)
danakj
This includes the base changes so we can see what the bots make of it, ...
6 years, 2 months ago (2014-09-26 04:17:08 UTC) #2
danakj
or +vmpstr if he's bored :3
6 years, 2 months ago (2014-09-26 04:18:09 UTC) #4
jamesr
Can you upload a patch that doesn't include the base/ bits?
6 years, 2 months ago (2014-09-26 04:35:52 UTC) #6
danakj
On 2014/09/26 04:35:52, jamesr wrote: > Can you upload a patch that doesn't include the ...
6 years, 2 months ago (2014-09-26 13:21:28 UTC) #7
danakj
On 2014/09/26 13:21:28, danakj wrote: > On 2014/09/26 04:35:52, jamesr wrote: > > Can you ...
6 years, 2 months ago (2014-09-26 15:19:51 UTC) #8
vmpstr
https://codereview.chromium.org/609663003/diff/80001/cc/PRESUBMIT.py File cc/PRESUBMIT.py (right): https://codereview.chromium.org/609663003/diff/80001/cc/PRESUBMIT.py#newcode171 cc/PRESUBMIT.py:171: if re.search(r'(=|\breturn)\s*scoped_ptr<[^>+]>\(\)', line): ... [^>]+ ... ? https://codereview.chromium.org/609663003/diff/80001/cc/animation/keyframed_animation_curve.cc File ...
6 years, 2 months ago (2014-09-26 16:44:23 UTC) #9
danakj
https://codereview.chromium.org/609663003/diff/80001/cc/PRESUBMIT.py File cc/PRESUBMIT.py (right): https://codereview.chromium.org/609663003/diff/80001/cc/PRESUBMIT.py#newcode171 cc/PRESUBMIT.py:171: if re.search(r'(=|\breturn)\s*scoped_ptr<[^>+]>\(\)', line): On 2014/09/26 16:44:23, vmpstr wrote: > ...
6 years, 2 months ago (2014-09-26 16:56:44 UTC) #10
enne (OOO)
lgtm https://codereview.chromium.org/609663003/diff/80001/cc/PRESUBMIT.py File cc/PRESUBMIT.py (right): https://codereview.chromium.org/609663003/diff/80001/cc/PRESUBMIT.py#newcode164 cc/PRESUBMIT.py:164: if re.search(r'(=|\breturn)\s*scoped_ptr<[^>]*[^>\]]>\([^)]+\)', line): regex nits: matching non-greedily, [^>]*> ...
6 years, 2 months ago (2014-09-26 16:58:22 UTC) #11
danakj
OOh I see. Ok fixed up regexes! Thanks!
6 years, 2 months ago (2014-09-26 17:06:28 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/609663003/100001
6 years, 2 months ago (2014-09-26 23:47:57 UTC) #14
danakj
Added a PRESUBMIT warning for PassAs() as well!
6 years, 2 months ago (2014-09-27 00:39:01 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/609663003/120001
6 years, 2 months ago (2014-09-27 00:40:12 UTC) #17
enne (OOO)
lgtm, thanks for adding that. :) :)
6 years, 2 months ago (2014-09-27 00:45:14 UTC) #18
dcheng
On 2014/09/27 at 00:45:14, enne wrote: > lgtm, thanks for adding that. :) :) Just ...
6 years, 2 months ago (2014-09-27 00:56:59 UTC) #19
Peter Kasting
On 2014/09/27 00:56:59, dcheng wrote: > On 2014/09/27 at 00:45:14, enne wrote: > > lgtm, ...
6 years, 2 months ago (2014-09-27 00:59:45 UTC) #20
jamesr
I'd argue that when doing "x = nullptr;" the reader shouldn't care what the type ...
6 years, 2 months ago (2014-09-27 01:02:09 UTC) #21
Peter Kasting
On 2014/09/27 01:02:09, jamesr wrote: > I'd argue that when doing "x = nullptr;" the ...
6 years, 2 months ago (2014-09-27 01:04:08 UTC) #22
danakj
On Fri, Sep 26, 2014 at 9:04 PM, <pkasting@chromium.org> wrote: > On 2014/09/27 01:02:09, jamesr ...
6 years, 2 months ago (2014-09-27 01:06:58 UTC) #23
commit-bot: I haz the power
Committed patchset #6 (id:120001) as 698209acda4f8da4d272e802643ef84259cd02c9
6 years, 2 months ago (2014-09-27 02:39:44 UTC) #24
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/7bb3dbede19d87f0338797756ffd738adc6bca08 Cr-Commit-Position: refs/heads/master@{#297096}
6 years, 2 months ago (2014-09-27 02:40:16 UTC) #25
dcheng
A revert of this CL (patchset #6 id:120001) has been created in https://codereview.chromium.org/608503005/ by dcheng@chromium.org. ...
6 years, 2 months ago (2014-09-27 07:31:18 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/609663003/120001
6 years, 2 months ago (2014-09-27 21:54:37 UTC) #28
commit-bot: I haz the power
Committed patchset #6 (id:120001) as f12498e35111694644bec64a5ff0521398147335
6 years, 2 months ago (2014-09-27 21:56:03 UTC) #29
commit-bot: I haz the power
6 years, 2 months ago (2014-09-27 21:56:40 UTC) #30
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/f446a070a0aa29a153b0cf78b33ef22da84cb023
Cr-Commit-Position: refs/heads/master@{#297121}

Powered by Google App Engine
This is Rietveld 408576698