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

Issue 1440593004: Make operators on scoped_ptr match the ones defined for std::unique_ptr (Closed)

Created:
5 years, 1 month ago by danakj
Modified:
5 years, 1 month ago
CC:
Avi (use Gerrit), blink-worker-reviews_chromium.org, cbentzel+watch_chromium.org, cc-bugs_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, davemoore+watch_chromium.org, davidben+watch_chromium.org, dtrainor+watch-blimp_chromium.org, gavinp+memory_chromium.org, gavinp+prer_chromium.org, groby+bubble_chromium.org, grt+watch_chromium.org, hcarmona+bubble_chromium.org, horo+watch_chromium.org, jam, jsbell+serviceworker_chromium.org, kalyank, kinuko+serviceworker, kinuko+watch, kmarshall+watch-blimp_chromium.org, maniscalco+watch-blimp_chromium.org, marcinjb+watch-blimp_chromium.org, maxbogue+watch_chromium.org, Matt Giuca, michaeln, msw+watch_chromium.org, nasko+codewatch_chromium.org, nhiroki, nyquist+watch-blimp_chromium.org, oshima+watch_chromium.org, piman, plaree+watch_chromium.org, pvalenzuela+watch_chromium.org, rouslan+bubble_chromium.org, sadrul, serviceworker-reviews, sriramsr+watch-blimp_chromium.org, tapted, tburkard+watch_chromium.org, tdanderson+overview_chromium.org, tfarina, tim+watch_chromium.org, tracing+reviews_chromium.org, tzik, vmpstr+watch_chromium.org, wfh+watch_chromium.org, zea+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make operators on scoped_ptr match the ones defined for std::unique_ptr Currently scoped_ptr is missing comparison operators other than == and !=, and it defines those operators incorrectly (it compares to a raw pointer but unique_ptr compares to a unique_ptr). This fixes the operator== and !=, and adds .get() at a bunch of callsites. And adds the < > <= >= operators so that we don't have any differences in where you can use it. This will help the transition from scoped_ptr to unique_ptr as no code will have to change along with the rename wrt these operators. R=Nico, dcheng TBR=ellyjones, sky, jochen, wez, rockot, droger BUG=554390 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/8199479504103bee23b5e560a96b914b9d959caf Cr-Commit-Position: refs/heads/master@{#359957}

Patch Set 1 #

Total comments: 3

Patch Set 2 : scopedptrequals: remove-unused-cnull-in-tests #

Patch Set 3 : scopedptrequals: operators-review #

Total comments: 2

Patch Set 4 : scopedptrequals: use-operator-instead-of-get #

Patch Set 5 : scopedptrequals: some-more-compile-fixes #

Total comments: 6

Patch Set 6 : scopedptrequals: fixes #

Patch Set 7 : scopedptrequals: compilefixes #

Patch Set 8 : scopedptrequals: mac-compile-fix #

Patch Set 9 : scopedptrequals: windows-compile-again #

Patch Set 10 : scopedptrequals: rebase #

Patch Set 11 : scopedptrequals: followupfix-after-rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+363 lines, -173 lines) Patch
M ash/shelf/shelf_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/overview/window_selector_unittest.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M ash/wm/system_gesture_event_filter_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/system_modal_container_layout_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/workspace/workspace_window_resizer_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/memory/scoped_ptr.h View 1 2 3 4 5 9 chunks +76 lines, -34 lines 0 comments Download
M base/memory/scoped_ptr_unittest.cc View 1 2 3 4 5 6 7 5 chunks +167 lines, -21 lines 0 comments Download
M base/trace_event/memory_dump_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/tracked_objects_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M blimp/engine/browser/blimp_engine_session.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M cc/input/scroll_state_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/raster/one_copy_tile_task_worker_pool.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -3 lines 0 comments Download
M cc/trees/damage_tracker_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/platform_keys/platform_keys_nss.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/policy/consumer_enrollment_handler.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/prerender/prerender_manager.cc View 5 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/profile_resetter/profile_resetter_unittest.cc View 1 chunk +8 lines, -8 lines 0 comments Download
M chrome/browser/safe_browsing/client_side_model_loader.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/app_list/search/people/people_provider.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller_private.mm View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/panels/panel_cocoa_unittest.mm View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M components/browser_sync/browser/profile_sync_service.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/cronet/android/cronet_url_request_adapter.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M components/invalidation/impl/gcm_invalidation_bridge.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/invalidation/impl/gcm_network_channel.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M components/invalidation/impl/ticl_invalidation_service.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/search_engines/util.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync_driver/profile_sync_auth_provider.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_update_job.cc View 4 chunks +5 lines, -4 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager.cc View 6 chunks +9 lines, -9 lines 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job.cc View 7 chunks +7 lines, -7 lines 0 comments Download
M content/browser/web_contents/web_contents_view_aura.cc View 1 2 3 4 5 6 7 8 7 chunks +7 lines, -8 lines 0 comments Download
M content/common/discardable_shared_memory_heap.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M device/serial/serial_io_handler_win.cc View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M ios/chrome/browser/updatable_config/updatable_config_base.mm View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M net/spdy/spdy_write_queue_unittest.cc View 4 chunks +8 lines, -8 lines 0 comments Download
M net/url_request/url_fetcher_core.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/app_list_item_list_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/aura/window.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/bubble/bubble_delegate_unittest.cc View 4 chunks +8 lines, -8 lines 0 comments Download
M ui/views/controls/webview/webview.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/touchui/touch_selection_controller_impl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M ui/views/view_unittest.cc View 3 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 50 (22 generated)
danakj
https://codereview.chromium.org/1440593004/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/1/base/memory/scoped_ptr.h#newcode538 base/memory/scoped_ptr.h:538: template <class T1, class D1, class T2, class D2> ...
5 years, 1 month ago (2015-11-11 20:38:36 UTC) #1
dcheng
https://codereview.chromium.org/1440593004/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/1/base/memory/scoped_ptr.h#newcode579 base/memory/scoped_ptr.h:579: return p1.get() > p2.get(); Not necessary, but it can ...
5 years, 1 month ago (2015-11-11 20:55:07 UTC) #8
danakj
PTAL https://codereview.chromium.org/1440593004/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/1/base/memory/scoped_ptr.h#newcode579 base/memory/scoped_ptr.h:579: return p1.get() > p2.get(); On 2015/11/11 20:55:06, dcheng ...
5 years, 1 month ago (2015-11-11 21:01:16 UTC) #9
dcheng
https://codereview.chromium.org/1440593004/diff/60001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/60001/base/memory/scoped_ptr.h#newcode579 base/memory/scoped_ptr.h:579: return p2.get() < p1.get(); Sorry, to clarify: Right now, ...
5 years, 1 month ago (2015-11-11 22:01:04 UTC) #10
danakj
https://codereview.chromium.org/1440593004/diff/60001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/60001/base/memory/scoped_ptr.h#newcode579 base/memory/scoped_ptr.h:579: return p2.get() < p1.get(); On 2015/11/11 22:01:04, dcheng wrote: ...
5 years, 1 month ago (2015-11-11 23:32:45 UTC) #11
danakj
PTAL
5 years, 1 month ago (2015-11-12 00:26:57 UTC) #12
dcheng
https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h#newcode328 base/memory/scoped_ptr.h:328: scoped_ptr(std::nullptr_t n) : impl_(nullptr) {} Apparently the style rule ...
5 years, 1 month ago (2015-11-12 16:17:04 UTC) #16
Nico
Lgtm from me. Not having parameter names for nullptr_t args makes sense to me https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h ...
5 years, 1 month ago (2015-11-12 17:20:47 UTC) #17
danakj
https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h#newcode328 base/memory/scoped_ptr.h:328: scoped_ptr(std::nullptr_t n) : impl_(nullptr) {} On 2015/11/12 16:17:03, dcheng ...
5 years, 1 month ago (2015-11-13 22:19:41 UTC) #18
danakj
On Thu, Nov 12, 2015 at 8:17 AM, <dcheng@chromium.org> wrote: > > > https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h > ...
5 years, 1 month ago (2015-11-13 22:20:46 UTC) #19
danakj
PTAL
5 years, 1 month ago (2015-11-13 22:21:55 UTC) #20
dcheng
lgtm https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h#newcode328 base/memory/scoped_ptr.h:328: scoped_ptr(std::nullptr_t n) : impl_(nullptr) {} On 2015/11/12 at ...
5 years, 1 month ago (2015-11-13 22:25:55 UTC) #21
danakj
https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h#newcode328 base/memory/scoped_ptr.h:328: scoped_ptr(std::nullptr_t n) : impl_(nullptr) {} On 2015/11/13 22:25:55, dcheng ...
5 years, 1 month ago (2015-11-13 22:35:23 UTC) #22
dcheng
On 2015/11/13 at 22:35:23, danakj wrote: > https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h > File base/memory/scoped_ptr.h (right): > > https://codereview.chromium.org/1440593004/diff/100001/base/memory/scoped_ptr.h#newcode328 ...
5 years, 1 month ago (2015-11-13 22:41:03 UTC) #23
danakj
On 2015/11/13 22:41:03, dcheng wrote: > On 2015/11/13 at 22:35:23, danakj wrote: > > > ...
5 years, 1 month ago (2015-11-13 22:45:00 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1440593004/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1440593004/140001
5 years, 1 month ago (2015-11-13 22:48:37 UTC) #27
danakj
TBR=ellyjones, sky, jochen, wez, rockot, droger Changing various places to call .get() when comparing scoped_ptr<T> ...
5 years, 1 month ago (2015-11-13 22:52:41 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/140623)
5 years, 1 month ago (2015-11-13 23:19:44 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1440593004/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1440593004/160001
5 years, 1 month ago (2015-11-13 23:40:33 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/builds/66701) win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, ...
5 years, 1 month ago (2015-11-14 00:59:05 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1440593004/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1440593004/180001
5 years, 1 month ago (2015-11-14 01:07:37 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/96178)
5 years, 1 month ago (2015-11-14 03:25:30 UTC) #40
jochen (gone - plz use gerrit)
lgtm
5 years, 1 month ago (2015-11-16 11:58:06 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1440593004/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1440593004/220001
5 years, 1 month ago (2015-11-16 19:06:21 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/109131) win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, ...
5 years, 1 month ago (2015-11-16 22:09:32 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1440593004/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1440593004/220001
5 years, 1 month ago (2015-11-16 22:29:20 UTC) #48
commit-bot: I haz the power
Committed patchset #11 (id:220001)
5 years, 1 month ago (2015-11-17 00:27:56 UTC) #49
commit-bot: I haz the power
5 years, 1 month ago (2015-11-17 00:29:01 UTC) #50
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/8199479504103bee23b5e560a96b914b9d959caf
Cr-Commit-Position: refs/heads/master@{#359957}

Powered by Google App Engine
This is Rietveld 408576698