Commit b55dfaed authored by Anand K. Mistry's avatar Anand K. Mistry Committed by Commit Bot

Avoid crashes when loading chrome://drive-internals with DriveFS.

With DriveFS, a number of DriveIntegrationService fields are nullptr
because they are no longer used by DriveFS.

BUG=845393

Change-Id: Ibafa2d02264059d3383c91c491ee770deb6e4632
Reviewed-on: https://chromium-review.googlesource.com/1116202
Commit-Queue: Anand Mistry <amistry@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571020}
parent 3fdc02bc
...@@ -434,24 +434,31 @@ void DriveInternalsWebUIHandler::OnPageLoaded(const base::ListValue* args) { ...@@ -434,24 +434,31 @@ void DriveInternalsWebUIHandler::OnPageLoaded(const base::ListValue* args) {
if (!integration_service) if (!integration_service)
return; return;
UpdateDriveRelatedPreferencesSection();
UpdateGCacheContentsSection();
UpdateLocalStorageUsageSection();
UpdatePathConfigurationsSection();
drive::DriveServiceInterface* drive_service = drive::DriveServiceInterface* drive_service =
integration_service->drive_service(); integration_service->drive_service();
DCHECK(drive_service); if (drive_service) {
UpdateConnectionStatusSection(drive_service);
UpdateAboutResourceSection(drive_service);
UpdateAppListSection(drive_service);
}
drive::DebugInfoCollector* debug_info_collector = drive::DebugInfoCollector* debug_info_collector =
integration_service->debug_info_collector(); integration_service->debug_info_collector();
DCHECK(debug_info_collector); if (debug_info_collector) {
UpdateLocalMetadataSection(debug_info_collector);
UpdateDeltaUpdateStatusSection(debug_info_collector);
UpdateCacheContentsSection(debug_info_collector);
}
UpdateDriveRelatedPreferencesSection(); drive::JobListInterface* job_list = integration_service->job_list();
UpdateConnectionStatusSection(drive_service); if (job_list) {
UpdateAboutResourceSection(drive_service); UpdateInFlightOperationsSection(job_list);
UpdateAppListSection(drive_service); }
UpdateLocalMetadataSection(debug_info_collector);
UpdateDeltaUpdateStatusSection(debug_info_collector);
UpdateInFlightOperationsSection(integration_service->job_list());
UpdateGCacheContentsSection();
UpdateCacheContentsSection(debug_info_collector);
UpdateLocalStorageUsageSection();
UpdatePathConfigurationsSection();
// When the drive-internals page is reloaded by the reload key, the page // When the drive-internals page is reloaded by the reload key, the page
// content is recreated, but this WebUI object is not (instead, OnPageLoaded // content is recreated, but this WebUI object is not (instead, OnPageLoaded
...@@ -887,8 +894,12 @@ void DriveInternalsWebUIHandler::OnPeriodicUpdate(const base::ListValue* args) { ...@@ -887,8 +894,12 @@ void DriveInternalsWebUIHandler::OnPeriodicUpdate(const base::ListValue* args) {
if (!integration_service) if (!integration_service)
return; return;
UpdateInFlightOperationsSection(integration_service->job_list());
UpdateEventLogSection(); UpdateEventLogSection();
drive::JobListInterface* job_list = integration_service->job_list();
if (job_list) {
UpdateInFlightOperationsSection(job_list);
}
} }
} // namespace } // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment