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

Issue 10797017: base: Make ScopedVector::clear() destroy elements. (Closed)

Created:
8 years, 5 months ago by Daniel Erat
Modified:
8 years, 5 months ago
CC:
chromium-reviews, erikwright (departed), brettw-cc_chromium.org, tfarina
Visibility:
Public.

Description

base: Make ScopedVector::clear() destroy elements. This makes ScopedVector's clear() method destroy the elements before clearing the internal vector, matching the behavior of the erase() method. I'm moving clear()'s previous element-preserving behavior into a new weak_clear() method, matching weak_erase(). I'm also removing ScopedVector::reset(), as it duplicated clear()'s new behavior and isn't a part of std::vector. BUG=137909 TEST=added Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=147360

Patch Set 1 #

Patch Set 2 : re-add updated clear method and write a test for weak_clear #

Total comments: 2

Patch Set 3 : remove ScopedVector::reset() #

Patch Set 4 : update a test #

Patch Set 5 : update ibus_property_unittest.cc #

Patch Set 6 : update location_bar_view_mac.mm #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -49 lines) Patch
M base/memory/scoped_vector.h View 1 2 3 chunks +5 lines, -3 lines 0 comments Download
M base/memory/scoped_vector_unittest.cc View 1 2 3 2 chunks +16 lines, -3 lines 0 comments Download
M chrome/browser/autofill/autofill_manager.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autofill/autofill_manager_unittest.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/autofill/autofill_merge_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autofill/personal_data_manager.cc View 1 2 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/autofill/personal_data_manager_mac.mm View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/instant/instant_controller.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/password_manager/password_manager.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/prerender/prerender_manager.cc View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/location_bar_view_gtk.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/hung_renderer_view.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options2/password_manager_handler.cc View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/webdata/autofill_profile_syncable_service.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chromeos/dbus/ibus/ibus_property.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chromeos/dbus/ibus/ibus_property_unittest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/browser/geolocation/location_arbitrator.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_win.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/speech/chunked_byte_buffer.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/media/h264_dpb.cc View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M net/dns/dns_transaction.cc View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M net/proxy/dhcp_proxy_script_fetcher_win.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/base/models/list_model.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/models/tree_node_model.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/render_text_win.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/native_control_win.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/views/widget/native_widget_win.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/npapi/plugin_list.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
Daniel Erat
brettw -> base sky -> ui Patch set 1 is just a rename of clear() ...
8 years, 5 months ago (2012-07-18 20:52:39 UTC) #1
sky
LGTM http://codereview.chromium.org/10797017/diff/7001/base/memory/scoped_vector.h File base/memory/scoped_vector.h (right): http://codereview.chromium.org/10797017/diff/7001/base/memory/scoped_vector.h#newcode85 base/memory/scoped_vector.h:85: void clear() { STLDeleteElements(&v); } Any chance we ...
8 years, 5 months ago (2012-07-18 21:24:38 UTC) #2
Peter Kasting
http://codereview.chromium.org/10797017/diff/7001/base/memory/scoped_vector.h File base/memory/scoped_vector.h (right): http://codereview.chromium.org/10797017/diff/7001/base/memory/scoped_vector.h#newcode85 base/memory/scoped_vector.h:85: void clear() { STLDeleteElements(&v); } On 2012/07/18 21:24:38, sky ...
8 years, 5 months ago (2012-07-18 21:26:32 UTC) #3
Daniel Erat
On 2012/07/18 21:26:32, Peter Kasting wrote: > http://codereview.chromium.org/10797017/diff/7001/base/memory/scoped_vector.h > File base/memory/scoped_vector.h (right): > > http://codereview.chromium.org/10797017/diff/7001/base/memory/scoped_vector.h#newcode85 ...
8 years, 5 months ago (2012-07-18 21:32:37 UTC) #4
Daniel Erat
willchan -> net, chrome/browser/net akalin -> chrome/browser/sync
8 years, 5 months ago (2012-07-18 21:55:03 UTC) #5
willchan no longer on Chromium
Thanks for the change. LGTM.
8 years, 5 months ago (2012-07-18 22:00:37 UTC) #6
akalin
sync lgtm
8 years, 5 months ago (2012-07-18 22:00:45 UTC) #7
brettw
LGTM in case you still need me.
8 years, 5 months ago (2012-07-18 22:01:50 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/derat@chromium.org/10797017/10002
8 years, 5 months ago (2012-07-18 23:33:27 UTC) #9
commit-bot: I haz the power
8 years, 5 months ago (2012-07-19 00:39:02 UTC) #10
Change committed as 147360

Powered by Google App Engine
This is Rietveld 408576698