summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 23:39:05 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 23:39:05 +0000
commit2428a3e48d06d5ad68581c9e62df30a49bafa872 (patch)
tree9e25120e1212283899c44cf51a9d5f87d90de6be
parente33cba46498a40774bc6d33a9258afbd5fa059e6 (diff)
downloadchromium_src-2428a3e48d06d5ad68581c9e62df30a49bafa872.zip
chromium_src-2428a3e48d06d5ad68581c9e62df30a49bafa872.tar.gz
chromium_src-2428a3e48d06d5ad68581c9e62df30a49bafa872.tar.bz2
Fix leaks in ProfileSyncServiceSessionTest.
BUG=52552 TEST=ProfileSyncServiceSessionTest. Trying to get heapchecker running locally. Review URL: http://codereview.chromium.org/3167022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56620 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/glue/session_model_associator.cc7
-rw-r--r--chrome/browser/sync/profile_sync_service_session_unittest.cc12
2 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc
index f6a6d1f..3524aea 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -207,10 +207,11 @@ SessionService* SessionModelAssociator::GetSessionService() {
void SessionModelAssociator::InitializeCurrentMachineTag() {
sync_api::WriteTransaction trans(sync_service_->backend()->
- GetUserShareHandle());
+ GetUserShareHandle());
syncable::Directory* dir =
- trans.GetWrappedWriteTrans()->directory();
- current_machine_tag_ = "session_sync" + dir->cache_guid();
+ trans.GetWrappedWriteTrans()->directory();
+ current_machine_tag_ = "session_sync";
+ current_machine_tag_.append(dir->cache_guid());
}
// See PopulateSessionSpecificsTab for use. May add functionality that includes
diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc
index 5f4fc10..e12192b 100644
--- a/chrome/browser/sync/profile_sync_service_session_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc
@@ -232,8 +232,8 @@ TEST_F(ProfileSyncServiceSessionTest, WriteFilledSessionToNode) {
ASSERT_TRUE(sync_specifics != NULL);
// Check that this machine's data is not included in the foreign windows.
- std::vector<ForeignSession*> foreign_sessions;
- model_associator_->GetSessionDataFromSyncModel(&foreign_sessions);
+ ScopedVector<ForeignSession> foreign_sessions;
+ model_associator_->GetSessionDataFromSyncModel(&foreign_sessions.get());
ASSERT_EQ(foreign_sessions.size(), 0U);
// Get the windows for this machine from the node and check that they were
@@ -243,8 +243,8 @@ TEST_F(ProfileSyncServiceSessionTest, WriteFilledSessionToNode) {
sync_api::ReadNode node(&trans);
ASSERT_TRUE(node.InitByClientTagLookup(syncable::SESSIONS,
machine_tag));
- model_associator_->AppendForeignSessionWithID(sync_id, &foreign_sessions,
- &trans);
+ model_associator_->AppendForeignSessionWithID(sync_id,
+ &foreign_sessions.get(), &trans);
ASSERT_EQ(foreign_sessions.size(), 1U);
ASSERT_EQ(1U, foreign_sessions[0]->windows.size());
ASSERT_EQ(2U, foreign_sessions[0]->windows[0]->tabs.size());
@@ -316,8 +316,8 @@ TEST_F(ProfileSyncServiceSessionTest, WriteForeignSessionToNode) {
scoped_ptr<const sync_pb::SessionSpecifics> sync_specifics(
model_associator_->GetChromeNodeFromSyncId(sync_id));
ASSERT_TRUE(sync_specifics != NULL);
- std::vector<ForeignSession*> foreign_sessions;
- model_associator_->GetSessionDataFromSyncModel(&foreign_sessions);
+ ScopedVector<ForeignSession> foreign_sessions;
+ model_associator_->GetSessionDataFromSyncModel(&foreign_sessions.get());
ASSERT_EQ(foreign_sessions.size(), 1U);
ASSERT_EQ(1U, foreign_sessions[0]->windows.size());
ASSERT_EQ(1U, foreign_sessions[0]->windows[0]->tabs.size());