diff options
-rw-r--r-- | chrome/browser/extensions/syncable_extension_settings_storage.cc | 16 | ||||
-rw-r--r-- | tools/heapcheck/suppressions.txt | 6 | ||||
-rw-r--r-- | tools/valgrind/memcheck/suppressions.txt | 11 |
3 files changed, 10 insertions, 23 deletions
diff --git a/chrome/browser/extensions/syncable_extension_settings_storage.cc b/chrome/browser/extensions/syncable_extension_settings_storage.cc index 137a6cb..a3f3e14 100644 --- a/chrome/browser/extensions/syncable_extension_settings_storage.cc +++ b/chrome/browser/extensions/syncable_extension_settings_storage.cc @@ -176,15 +176,19 @@ SyncError SyncableExtensionSettingsStorage::OverwriteLocalSettingsWithSync( ExtensionSettingSyncDataList changes; for (DictionaryValue::key_iterator it = settings.begin_keys(); it != settings.end_keys(); ++it) { - Value* sync_value = NULL; - if (new_sync_state->RemoveWithoutPathExpansion(*it, &sync_value)) { + Value* orphaned_sync_value = NULL; + if (new_sync_state->RemoveWithoutPathExpansion(*it, &orphaned_sync_value)) { + scoped_ptr<Value> sync_value(orphaned_sync_value); Value* local_value = NULL; settings.GetWithoutPathExpansion(*it, &local_value); - if (!local_value->Equals(sync_value)) { + if (!sync_value->Equals(local_value)) { // Sync value is different, update local setting with new value. changes.push_back( ExtensionSettingSyncData( - SyncChange::ACTION_UPDATE, extension_id_, *it, sync_value)); + SyncChange::ACTION_UPDATE, + extension_id_, + *it, + sync_value.release())); } } else { // Not synced, delete local setting. @@ -200,8 +204,8 @@ SyncError SyncableExtensionSettingsStorage::OverwriteLocalSettingsWithSync( // Add all new settings to local settings. while (!new_sync_state->empty()) { std::string key = *new_sync_state->begin_keys(); - Value* value; - new_sync_state->RemoveWithoutPathExpansion(key, &value); + Value* value = NULL; + CHECK(new_sync_state->RemoveWithoutPathExpansion(key, &value)); changes.push_back( ExtensionSettingSyncData( SyncChange::ACTION_ADD, extension_id_, key, value)); diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt index fcffcef..6671b74 100644 --- a/tools/heapcheck/suppressions.txt +++ b/tools/heapcheck/suppressions.txt @@ -1687,9 +1687,3 @@ fun:sync_notifier::NonBlockingInvalidationNotifier::Core::UpdateCredentials fun:void DispatchToMethod } -{ - bug_97511_b - Heapcheck:Leak - ... - fun:ExtensionSettingsSyncTest* -} diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index 0a5837d..ab6071a 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt @@ -4622,17 +4622,6 @@ fun:vorbis_decode_frame fun:avcodec_decode_audio3 } -{ - bug_97511_d - Memcheck:Leak - fun:_Znw* - ... - fun:_ZNK4base15DictionaryValue8DeepCopyEv - fun:_ZN32SyncableExtensionSettingsStorage30OverwriteLocalSettingsWithSyncERKN4base15DictionaryValueES3_ - fun:_ZN32SyncableExtensionSettingsStorage12StartSyncingERKN4base15DictionaryValueEP19SyncChangeProcessor - fun:_ZN17ExtensionSettings24MergeDataAndStartSyncingEN8syncable9ModelTypeERKSt6vectorI8SyncDataSaIS3_EEP19SyncChangeProcessor - fun:_ZN58ExtensionSettingsSyncTest_InSyncDataDoesNotInvokeSync_Test8TestBodyEv -} #----------------------------------------------------------------------- # 4. These only occur on our Google workstations |