summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 00:38:58 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 00:38:58 +0000
commit3ebea920942e11fb0c81c83718699ab4e6a6a370 (patch)
treebb65049c51fd35a354ab4505802822cb884e3ff5
parente19d265c10c73b01717054f2bc7da1797d937bfd (diff)
downloadchromium_src-3ebea920942e11fb0c81c83718699ab4e6a6a370.zip
chromium_src-3ebea920942e11fb0c81c83718699ab4e6a6a370.tar.gz
chromium_src-3ebea920942e11fb0c81c83718699ab4e6a6a370.tar.bz2
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 Review URL: https://chromiumcodereview.appspot.com/10797017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147360 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/memory/scoped_vector.h8
-rw-r--r--base/memory/scoped_vector_unittest.cc19
-rw-r--r--chrome/browser/autofill/autofill_manager.cc2
-rw-r--r--chrome/browser/autofill/autofill_manager_unittest.cc4
-rw-r--r--chrome/browser/autofill/autofill_merge_unittest.cc4
-rw-r--r--chrome/browser/autofill/personal_data_manager.cc8
-rw-r--r--chrome/browser/autofill/personal_data_manager_mac.mm2
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc2
-rw-r--r--chrome/browser/instant/instant_controller.cc2
-rw-r--r--chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc6
-rw-r--r--chrome/browser/password_manager/password_manager.cc2
-rw-r--r--chrome/browser/prerender/prerender_manager.cc3
-rw-r--r--chrome/browser/sync/test/integration/sync_test.cc2
-rw-r--r--chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm2
-rw-r--r--chrome/browser/ui/gtk/location_bar_view_gtk.cc4
-rw-r--r--chrome/browser/ui/views/hung_renderer_view.cc2
-rw-r--r--chrome/browser/ui/webui/options2/password_manager_handler.cc8
-rw-r--r--chrome/browser/webdata/autofill_profile_syncable_service.cc2
-rw-r--r--chromeos/dbus/ibus/ibus_property.cc2
-rw-r--r--chromeos/dbus/ibus/ibus_property_unittest.cc2
-rw-r--r--content/browser/geolocation/location_arbitrator.cc2
-rw-r--r--content/browser/renderer_host/render_widget_host_view_win.cc2
-rw-r--r--content/browser/speech/chunked_byte_buffer.cc2
-rw-r--r--content/common/gpu/media/h264_dpb.cc3
-rw-r--r--net/dns/dns_transaction.cc3
-rw-r--r--net/proxy/dhcp_proxy_script_fetcher_win.cc2
-rw-r--r--ui/base/models/list_model.h2
-rw-r--r--ui/base/models/tree_node_model.h2
-rw-r--r--ui/gfx/render_text_win.cc2
-rw-r--r--ui/views/controls/native_control_win.cc4
-rw-r--r--ui/views/widget/native_widget_win.cc2
-rw-r--r--webkit/plugins/npapi/plugin_list.cc2
32 files changed, 63 insertions, 51 deletions
diff --git a/base/memory/scoped_vector.h b/base/memory/scoped_vector.h
index f8afcdd..5470097 100644
--- a/base/memory/scoped_vector.h
+++ b/base/memory/scoped_vector.h
@@ -33,7 +33,7 @@ class ScopedVector {
const_reverse_iterator;
ScopedVector() {}
- ~ScopedVector() { reset(); }
+ ~ScopedVector() { clear(); }
ScopedVector(RValue& other) { swap(other); }
ScopedVector& operator=(RValue& rhs) {
@@ -73,7 +73,6 @@ class ScopedVector {
v.clear();
}
- void reset() { STLDeleteElements(&v); }
void reserve(size_t capacity) { v.reserve(capacity); }
void resize(size_t new_size) { v.resize(new_size); }
@@ -82,7 +81,10 @@ class ScopedVector {
v.assign(begin, end);
}
- void clear() { v.clear(); }
+ void clear() { STLDeleteElements(&v); }
+
+ // Like |clear()|, but doesn't delete any elements.
+ void weak_clear() { v.clear(); }
// Lets the ScopedVector take ownership of |x|.
iterator insert(iterator position, T* x) {
diff --git a/base/memory/scoped_vector_unittest.cc b/base/memory/scoped_vector_unittest.cc
index f6c7167..03774c5 100644
--- a/base/memory/scoped_vector_unittest.cc
+++ b/base/memory/scoped_vector_unittest.cc
@@ -107,14 +107,27 @@ TEST(ScopedVectorTest, LifeCycleWatcher) {
EXPECT_EQ(LC_DESTROYED, watcher.life_cycle_state());
}
-TEST(ScopedVectorTest, Reset) {
+TEST(ScopedVectorTest, Clear) {
LifeCycleWatcher watcher;
EXPECT_EQ(LC_INITIAL, watcher.life_cycle_state());
ScopedVector<LifeCycleObject> scoped_vector;
scoped_vector.push_back(watcher.NewLifeCycleObject());
EXPECT_EQ(LC_CONSTRUCTED, watcher.life_cycle_state());
- scoped_vector.reset();
+ scoped_vector.clear();
EXPECT_EQ(LC_DESTROYED, watcher.life_cycle_state());
+ EXPECT_EQ(static_cast<size_t>(0), scoped_vector.size());
+}
+
+TEST(ScopedVectorTest, WeakClear) {
+ LifeCycleWatcher watcher;
+ EXPECT_EQ(LC_INITIAL, watcher.life_cycle_state());
+ ScopedVector<LifeCycleObject> scoped_vector;
+ scoped_ptr<LifeCycleObject> object(watcher.NewLifeCycleObject());
+ scoped_vector.push_back(object.get());
+ EXPECT_EQ(LC_CONSTRUCTED, watcher.life_cycle_state());
+ scoped_vector.weak_clear();
+ EXPECT_EQ(LC_CONSTRUCTED, watcher.life_cycle_state());
+ EXPECT_EQ(static_cast<size_t>(0), scoped_vector.size());
}
TEST(ScopedVectorTest, Scope) {
@@ -196,7 +209,7 @@ TEST(ScopedVectorTest, Passed) {
EXPECT_EQ(0, deletes);
ScopedVector<DeleteCounter> result = callback.Run();
EXPECT_EQ(0, deletes);
- result.reset();
+ result.clear();
EXPECT_EQ(1, deletes);
};
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index 8a27cca..96e5ff9 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -894,7 +894,7 @@ void AutofillManager::UploadFormData(const FormStructure& submitted_form) {
}
void AutofillManager::Reset() {
- form_structures_.reset();
+ form_structures_.clear();
has_logged_autofill_enabled_ = false;
has_logged_address_suggestions_count_ = false;
did_show_suggestions_ = false;
diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc
index 25d1c82..9f96092 100644
--- a/chrome/browser/autofill/autofill_manager_unittest.cc
+++ b/chrome/browser/autofill/autofill_manager_unittest.cc
@@ -122,11 +122,11 @@ class TestPersonalDataManager : public PersonalDataManager {
}
void ClearAutofillProfiles() {
- web_profiles_.reset();
+ web_profiles_.clear();
}
void ClearCreditCards() {
- credit_cards_.reset();
+ credit_cards_.clear();
}
void CreateTestCreditCardsYearAndMonth(const char* year, const char* month) {
diff --git a/chrome/browser/autofill/autofill_merge_unittest.cc b/chrome/browser/autofill/autofill_merge_unittest.cc
index 73552af..83430f4 100644
--- a/chrome/browser/autofill/autofill_merge_unittest.cc
+++ b/chrome/browser/autofill/autofill_merge_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -89,7 +89,7 @@ PersonalDataManagerMock::~PersonalDataManagerMock() {
}
void PersonalDataManagerMock::Reset() {
- profiles_.reset();
+ profiles_.clear();
}
void PersonalDataManagerMock::SaveImportedProfile(
diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc
index 2185c6c..161a9cc 100644
--- a/chrome/browser/autofill/personal_data_manager.cc
+++ b/chrome/browser/autofill/personal_data_manager.cc
@@ -705,7 +705,7 @@ void PersonalDataManager::SetProfiles(std::vector<AutofillProfile>* profiles) {
}
// Copy in the new profiles.
- web_profiles_.reset();
+ web_profiles_.clear();
for (std::vector<AutofillProfile>::iterator iter = profiles->begin();
iter != profiles->end(); ++iter) {
web_profiles_.push_back(new AutofillProfile(*iter));
@@ -756,7 +756,7 @@ void PersonalDataManager::SetCreditCards(
}
// Copy in the new credit cards.
- credit_cards_.reset();
+ credit_cards_.clear();
for (std::vector<CreditCard>::iterator iter = credit_cards->begin();
iter != credit_cards->end(); ++iter) {
credit_cards_.push_back(new CreditCard(*iter));
@@ -804,7 +804,7 @@ void PersonalDataManager::ReceiveLoadedProfiles(WebDataService::Handle h,
DCHECK_EQ(pending_profiles_query_, h);
pending_profiles_query_ = 0;
- web_profiles_.reset();
+ web_profiles_.clear();
const WDResult<std::vector<AutofillProfile*> >* r =
static_cast<const WDResult<std::vector<AutofillProfile*> >*>(result);
@@ -824,7 +824,7 @@ void PersonalDataManager::ReceiveLoadedCreditCards(
DCHECK_EQ(pending_creditcards_query_, h);
pending_creditcards_query_ = 0;
- credit_cards_.reset();
+ credit_cards_.clear();
const WDResult<std::vector<CreditCard*> >* r =
static_cast<const WDResult<std::vector<CreditCard*> >*>(result);
diff --git a/chrome/browser/autofill/personal_data_manager_mac.mm b/chrome/browser/autofill/personal_data_manager_mac.mm
index a4a0824..b0b12f5a 100644
--- a/chrome/browser/autofill/personal_data_manager_mac.mm
+++ b/chrome/browser/autofill/personal_data_manager_mac.mm
@@ -66,7 +66,7 @@ class AuxiliaryProfilesImpl {
// information and translates it to the internal list of |AutofillProfile| data
// structures.
void AuxiliaryProfilesImpl::GetAddressBookMeCard() {
- profiles_.reset();
+ profiles_.clear();
ABAddressBook* addressBook = [ABAddressBook sharedAddressBook];
ABPerson* me = [addressBook me];
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
index 18ffab2..e6d7734 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
@@ -243,7 +243,7 @@ void GeolocationPermissionContextTests::SetUp() {
}
void GeolocationPermissionContextTests::TearDown() {
- extra_tabs_.reset();
+ extra_tabs_.clear();
TabContentsTestHarness::TearDown();
// Schedule another task on the DB thread to notify us that it's safe to
// carry on with the test.
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 629bdc6..e0f7125 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -507,5 +507,5 @@ void InstantController::ScheduleDestroy(InstantLoader* loader) {
}
void InstantController::DestroyLoaders() {
- loaders_to_destroy_.reset();
+ loaders_to_destroy_.clear();
}
diff --git a/chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc b/chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc
index 29d35fb..721423b 100644
--- a/chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc
+++ b/chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc
@@ -136,7 +136,7 @@ TEST_F(SQLiteServerBoundCertStoreTest, TestPersistence) {
store_ = NULL;
// Make sure we wait until the destructor has run.
ASSERT_TRUE(helper->Run());
- certs.reset();
+ certs.clear();
store_ = new SQLiteServerBoundCertStore(
temp_dir_.path().Append(chrome::kOBCertFilename), NULL);
@@ -569,7 +569,7 @@ TEST_F(SQLiteServerBoundCertStoreTest, TestClearOnExitPolicy) {
temp_dir_.path().AppendASCII("ClearOnExitDB"), clear_policy.get());
// Reload and test for persistence
- certs.reset();
+ certs.clear();
ASSERT_TRUE(store_->Load(&certs.get()));
ASSERT_EQ(3U, certs.size());
@@ -582,7 +582,7 @@ TEST_F(SQLiteServerBoundCertStoreTest, TestClearOnExitPolicy) {
temp_dir_.path().AppendASCII("ClearOnExitDB"), clear_policy.get());
// Reload and test for persistence
- certs.reset();
+ certs.clear();
ASSERT_TRUE(store_->Load(&certs.get()));
ASSERT_EQ(2U, certs.size());
diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc
index 7885d21..1f87327 100644
--- a/chrome/browser/password_manager/password_manager.cc
+++ b/chrome/browser/password_manager/password_manager.cc
@@ -171,7 +171,7 @@ void PasswordManager::DidNavigateAnyFrame(
// There might be password data to provisionally save. Other than that, we're
// ready to reset and move on.
ProvisionallySavePassword(params.password_form);
- pending_login_managers_.reset();
+ pending_login_managers_.clear();
}
bool PasswordManager::OnMessageReceived(const IPC::Message& message) {
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index 6eee18a..b43eec6 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -848,7 +848,7 @@ void PrerenderManager::DestroyPendingPrerenderData(
void PrerenderManager::DoShutdown() {
DestroyAllContents(FINAL_STATUS_MANAGER_SHUTDOWN);
STLDeleteElements(&prerender_conditions_);
- on_close_tab_contents_deleters_.reset();
+ on_close_tab_contents_deleters_.clear();
profile_ = NULL;
DCHECK(active_prerender_list_.empty());
@@ -1231,4 +1231,3 @@ PrerenderManager* FindPrerenderManagerUsingRenderProcessId(
}
} // namespace prerender
-
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index 2542718..05fca77 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -350,7 +350,7 @@ void SyncTest::CleanUpOnMainThread() {
// All browsers should be closed at this point, or else we could see memory
// corruption in QuitBrowser().
CHECK_EQ(0U, BrowserList::size());
- clients_.reset();
+ clients_.clear();
}
void SyncTest::SetUpInProcessBrowserTestFixture() {
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index a149c84..31f7979 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -591,7 +591,7 @@ void LocationBarViewMac::DeletePageActionDecorations() {
// least fail safe.
[[field_ cell] clearDecorations];
- page_action_decorations_.reset();
+ page_action_decorations_.clear();
}
void LocationBarViewMac::RefreshPageActionDecorations() {
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
index 71f5613..3859e58 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
@@ -739,7 +739,7 @@ void LocationBarViewGtk::UpdatePageActions() {
// loaded or added after startup.
if (new_page_actions != page_actions_) {
page_actions_.swap(new_page_actions);
- page_action_views_.reset();
+ page_action_views_.clear();
for (size_t i = 0; i < page_actions_.size(); ++i) {
page_action_views_.push_back(
@@ -771,7 +771,7 @@ void LocationBarViewGtk::UpdatePageActions() {
void LocationBarViewGtk::InvalidatePageActions() {
size_t count_before = page_action_views_.size();
- page_action_views_.reset();
+ page_action_views_.clear();
if (page_action_views_.size() != count_before) {
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED,
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc
index 908aa60..a71619a 100644
--- a/chrome/browser/ui/views/hung_renderer_view.cc
+++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -154,7 +154,7 @@ RenderViewHost* HungPagesTableModel::GetRenderViewHost() {
}
void HungPagesTableModel::InitForWebContents(WebContents* hung_contents) {
- tab_observers_.reset();
+ tab_observers_.clear();
if (hung_contents) {
// Force hung_contents to be first.
TabContents* hung_tab_contents =
diff --git a/chrome/browser/ui/webui/options2/password_manager_handler.cc b/chrome/browser/ui/webui/options2/password_manager_handler.cc
index 3728846..7e6268c 100644
--- a/chrome/browser/ui/webui/options2/password_manager_handler.cc
+++ b/chrome/browser/ui/webui/options2/password_manager_handler.cc
@@ -125,8 +125,8 @@ void PasswordManagerHandler::Observe(
void PasswordManagerHandler::UpdatePasswordLists(const ListValue* args) {
// Reset the current lists.
- password_list_.reset();
- password_exception_list_.reset();
+ password_list_.clear();
+ password_exception_list_.clear();
languages_ = Profile::FromWebUI(web_ui())->GetPrefs()->
GetString(prefs::kAcceptLanguages);
@@ -244,7 +244,7 @@ void PasswordManagerHandler::PasswordListPopulater::
const std::vector<webkit::forms::PasswordForm*>& result) {
DCHECK_EQ(pending_login_query_, handle);
pending_login_query_ = 0;
- page_->password_list_.reset();
+ page_->password_list_.clear();
page_->password_list_.insert(page_->password_list_.end(),
result.begin(), result.end());
page_->SetPasswordList();
@@ -273,7 +273,7 @@ void PasswordManagerHandler::PasswordExceptionListPopulater::
const std::vector<webkit::forms::PasswordForm*>& result) {
DCHECK_EQ(pending_login_query_, handle);
pending_login_query_ = 0;
- page_->password_exception_list_.reset();
+ page_->password_exception_list_.clear();
page_->password_exception_list_.insert(page_->password_exception_list_.end(),
result.begin(), result.end());
page_->SetPasswordExceptionList();
diff --git a/chrome/browser/webdata/autofill_profile_syncable_service.cc b/chrome/browser/webdata/autofill_profile_syncable_service.cc
index 48291f5..bfe65dc 100644
--- a/chrome/browser/webdata/autofill_profile_syncable_service.cc
+++ b/chrome/browser/webdata/autofill_profile_syncable_service.cc
@@ -168,7 +168,7 @@ void AutofillProfileSyncableService::StopSyncing(syncer::ModelType type) {
sync_processor_.reset();
sync_error_factory_.reset();
- profiles_.reset();
+ profiles_.clear();
profiles_map_.clear();
}
diff --git a/chromeos/dbus/ibus/ibus_property.cc b/chromeos/dbus/ibus/ibus_property.cc
index 86c6890..eae8b00 100644
--- a/chromeos/dbus/ibus/ibus_property.cc
+++ b/chromeos/dbus/ibus/ibus_property.cc
@@ -128,7 +128,7 @@ bool CHROMEOS_EXPORT PopIBusPropertyList(dbus::MessageReader* reader,
<< "1st argument should be array.";
return false;
}
- property_list->reset();
+ property_list->clear();
while (property_array_reader.HasMoreData()) {
IBusProperty* property = new IBusProperty;
if (!PopIBusProperty(&property_array_reader, property)) {
diff --git a/chromeos/dbus/ibus/ibus_property_unittest.cc b/chromeos/dbus/ibus/ibus_property_unittest.cc
index 833df17..471e96f 100644
--- a/chromeos/dbus/ibus/ibus_property_unittest.cc
+++ b/chromeos/dbus/ibus/ibus_property_unittest.cc
@@ -38,7 +38,7 @@ void SetProperty(const std::string& prefix, IBusProperty* property) {
property->set_tooltip(prefix + kSampleTooltip);
property->set_visible(kSampleVisible);
property->set_checked(kSampleChecked);
- property->mutable_sub_properties()->reset();
+ property->mutable_sub_properties()->clear();
}
// Checks testing data in |property| with |prefix|.
diff --git a/content/browser/geolocation/location_arbitrator.cc b/content/browser/geolocation/location_arbitrator.cc
index 5fde6fb..aa977e0 100644
--- a/content/browser/geolocation/location_arbitrator.cc
+++ b/content/browser/geolocation/location_arbitrator.cc
@@ -84,7 +84,7 @@ void GeolocationArbitrator::DoStartProviders() {
}
void GeolocationArbitrator::StopProviders() {
- providers_.reset();
+ providers_.clear();
}
void GeolocationArbitrator::OnAccessTokenStoresLoaded(
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index 848513c..0bd3f89 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -1372,7 +1372,7 @@ void RenderWidgetHostViewWin::OnDestroy() {
// sequence as part of the usual cleanup when the plugin instance goes away.
EnumChildWindows(m_hWnd, DetachPluginWindowsCallback, NULL);
- props_.reset();
+ props_.clear();
if (base::win::GetVersion() >= base::win::VERSION_WIN7 &&
IsTouchWindow(m_hWnd, NULL)) {
diff --git a/content/browser/speech/chunked_byte_buffer.cc b/content/browser/speech/chunked_byte_buffer.cc
index 115fa82..07e3c3f 100644
--- a/content/browser/speech/chunked_byte_buffer.cc
+++ b/content/browser/speech/chunked_byte_buffer.cc
@@ -110,7 +110,7 @@ scoped_ptr< std::vector<uint8> > ChunkedByteBuffer::PopChunk() {
}
void ChunkedByteBuffer::Clear() {
- chunks_.reset();
+ chunks_.clear();
partial_chunk_.reset(new Chunk());
total_bytes_stored_ = 0;
}
diff --git a/content/common/gpu/media/h264_dpb.cc b/content/common/gpu/media/h264_dpb.cc
index 56ef173b..2de3f97 100644
--- a/content/common/gpu/media/h264_dpb.cc
+++ b/content/common/gpu/media/h264_dpb.cc
@@ -14,7 +14,7 @@ H264DPB::H264DPB() {}
H264DPB::~H264DPB() {}
void H264DPB::Clear() {
- pics_.reset();
+ pics_.clear();
}
void H264DPB::RemoveByPOC(int poc) {
@@ -115,4 +115,3 @@ void H264DPB::GetLongTermRefPicsAppending(H264Picture::PtrVector& out) {
}
} // namespace content
-
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index 600d911..0d07b52 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -442,7 +442,7 @@ class DnsTransactionImpl : public DnsTransaction,
first_server_index_ = session_->NextFirstServerIndex();
- attempts_.reset();
+ attempts_.clear();
return MakeAttempt();
}
@@ -586,4 +586,3 @@ scoped_ptr<DnsTransactionFactory> DnsTransactionFactory::CreateFactory(
}
} // namespace net
-
diff --git a/net/proxy/dhcp_proxy_script_fetcher_win.cc b/net/proxy/dhcp_proxy_script_fetcher_win.cc
index d7392fe..aa68c31 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_win.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher_win.cc
@@ -110,7 +110,7 @@ void DhcpProxyScriptFetcherWin::CancelImpl() {
(*it)->Cancel();
}
- fetchers_.reset();
+ fetchers_.clear();
}
}
diff --git a/ui/base/models/list_model.h b/ui/base/models/list_model.h
index 95883fc..dbbd689 100644
--- a/ui/base/models/list_model.h
+++ b/ui/base/models/list_model.h
@@ -47,7 +47,7 @@ class ListModel {
// Removes all items from the model. This does NOT delete the items.
void RemoveAll() {
size_t count = item_count();
- items_.clear();
+ items_.weak_clear();
NotifyItemsRemoved(0, count);
}
diff --git a/ui/base/models/tree_node_model.h b/ui/base/models/tree_node_model.h
index 0570691..5bfe46e 100644
--- a/ui/base/models/tree_node_model.h
+++ b/ui/base/models/tree_node_model.h
@@ -98,7 +98,7 @@ class TreeNode : public TreeModelNode {
void RemoveAll() {
for (size_t i = 0; i < children_.size(); ++i)
children_[i]->parent_ = NULL;
- children_.clear();
+ children_.weak_clear();
}
// Returns the parent node, or NULL if this is the root node.
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index 3bac2f8..fb5a96d 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -593,7 +593,7 @@ void RenderTextWin::DrawVisualText(Canvas* canvas) {
}
void RenderTextWin::ItemizeLogicalText() {
- runs_.reset();
+ runs_.clear();
string_size_ = Size(0, GetFont().GetHeight());
common_baseline_ = 0;
diff --git a/ui/views/controls/native_control_win.cc b/ui/views/controls/native_control_win.cc
index 25278411..a1c600b 100644
--- a/ui/views/controls/native_control_win.cc
+++ b/ui/views/controls/native_control_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -215,7 +215,7 @@ LRESULT NativeControlWin::NativeControlWndProc(HWND window,
NOTREACHED();
}
} else if (message == WM_DESTROY) {
- native_control->props_.reset();
+ native_control->props_.clear();
ui::SetWindowProc(window, native_control->original_wndproc_);
}
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index 5af20c6..fa64458 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -2225,7 +2225,7 @@ void NativeWidgetWin::OnWindowPosChanged(WINDOWPOS* window_pos) {
void NativeWidgetWin::OnFinalMessage(HWND window) {
// We don't destroy props in WM_DESTROY as we may still get messages after
// WM_DESTROY that assume the properties are still valid (such as WM_CLOSE).
- props_.reset();
+ props_.clear();
delegate_->OnNativeWidgetDestroyed();
if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET)
delete this;
diff --git a/webkit/plugins/npapi/plugin_list.cc b/webkit/plugins/npapi/plugin_list.cc
index 0ec90a3..f9f8c1b 100644
--- a/webkit/plugins/npapi/plugin_list.cc
+++ b/webkit/plugins/npapi/plugin_list.cc
@@ -422,7 +422,7 @@ void PluginList::SetPlugins(const std::vector<webkit::WebPluginInfo>& plugins) {
DCHECK_NE(LOADING_STATE_REFRESHING, loading_state_);
loading_state_ = LOADING_STATE_UP_TO_DATE;
- plugin_groups_.reset();
+ plugin_groups_.clear();
for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin();
it != plugins.end();
++it) {