Chromium Code Reviews| Index: chrome/browser/sync_file_system/sync_file_system_service.cc |
| diff --git a/chrome/browser/sync_file_system/sync_file_system_service.cc b/chrome/browser/sync_file_system/sync_file_system_service.cc |
| index 910b83686de9ce32445939f77ae417f430c88b1d..092ec7401d683e520d22b4c045bb73560c7213b5 100644 |
| --- a/chrome/browser/sync_file_system/sync_file_system_service.cc |
| +++ b/chrome/browser/sync_file_system/sync_file_system_service.cc |
| @@ -535,7 +535,10 @@ void SyncFileSystemService::DidDumpDatabase( |
| list = make_scoped_ptr(new base::ListValue); |
| if (!v2_remote_service_) { |
| - callback.Run(*list); |
| + if (list) |
|
peria
2014/08/08 09:45:04
Change for this part seems to do nothing, in actua
tzik
2014/08/08 09:50:57
Done.
|
| + callback.Run(*list); |
| + else |
| + callback.Run(base::ListValue()); |
| return; |
| } |
| @@ -548,7 +551,8 @@ void SyncFileSystemService::DidDumpV2Database( |
| const DumpFilesCallback& callback, |
| scoped_ptr<base::ListValue> v1list, |
| scoped_ptr<base::ListValue> v2list) { |
| - DCHECK(v1list); |
| + if (!v1list) |
| + v1list.reset(new base::ListValue); |
|
peria
2014/08/08 09:45:05
= make_scoped_ptr(new base::ListValue);
to be sam
tzik
2014/08/08 09:50:57
Done.
|
| if (v2list) { |
| for (base::ListValue::iterator itr = v2list->begin(); |
| @@ -566,7 +570,10 @@ void SyncFileSystemService::DidGetExtensionStatusMap( |
| const ExtensionStatusMapCallback& callback, |
| scoped_ptr<RemoteFileSyncService::OriginStatusMap> status_map) { |
| if (!v2_remote_service_) { |
|
peria
2014/08/08 09:45:04
I recommend to put
if (!status_map)
status_map
tzik
2014/08/08 09:50:57
Done.
|
| - callback.Run(*status_map); |
| + if (status_map) |
| + callback.Run(*status_map); |
| + else |
| + callback.Run(RemoteFileSyncService::OriginStatusMap()); |
| return; |
| } |
| @@ -582,7 +589,10 @@ void SyncFileSystemService::DidGetV2ExtensionStatusMap( |
| scoped_ptr<RemoteFileSyncService::OriginStatusMap> status_map_v1, |
| scoped_ptr<RemoteFileSyncService::OriginStatusMap> status_map_v2) { |
| // Merge |status_map_v2| into |status_map_v1|. |
| - status_map_v1->insert(status_map_v2->begin(), status_map_v2->end()); |
| + if (!status_map_v1) |
| + status_map_v1.reset(new RemoteFileSyncService::OriginStatusMap); |
| + if (status_map_v2) |
| + status_map_v1->insert(status_map_v2->begin(), status_map_v2->end()); |
| callback.Run(*status_map_v1); |
| } |