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

Unified Diff: chrome/browser/sync_file_system/sync_file_system_service.cc

Issue 452063002: [SyncFS] Crash fix on chrome://syncfs-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b9a6214aeb8f3dec9281cb493335df7e578fa4bc 100644
--- a/chrome/browser/sync_file_system/sync_file_system_service.cc
+++ b/chrome/browser/sync_file_system/sync_file_system_service.cc
@@ -548,7 +548,8 @@ void SyncFileSystemService::DidDumpV2Database(
const DumpFilesCallback& callback,
scoped_ptr<base::ListValue> v1list,
scoped_ptr<base::ListValue> v2list) {
- DCHECK(v1list);
+ if (!v1list)
+ v1list = make_scoped_ptr(new base::ListValue);
if (v2list) {
for (base::ListValue::iterator itr = v2list->begin();
@@ -565,6 +566,8 @@ void SyncFileSystemService::DidDumpV2Database(
void SyncFileSystemService::DidGetExtensionStatusMap(
const ExtensionStatusMapCallback& callback,
scoped_ptr<RemoteFileSyncService::OriginStatusMap> status_map) {
+ if (!status_map)
+ status_map = make_scoped_ptr(new RemoteFileSyncService::OriginStatusMap);
if (!v2_remote_service_) {
callback.Run(*status_map);
return;
@@ -582,7 +585,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 = make_scoped_ptr(new RemoteFileSyncService::OriginStatusMap);
+ if (status_map_v2)
+ status_map_v1->insert(status_map_v2->begin(), status_map_v2->end());
callback.Run(*status_map_v1);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698