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

Unified Diff: chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc

Issue 2522073002: [OfflinePages] RequestCoordinatorFactory return null for incognito (Closed)
Patch Set: Merge Created 4 years 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 | chrome/browser/android/offline_pages/offline_page_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc
diff --git a/chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc b/chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc
index fb83bed865ddeea21b479922fff96f8c0a8fa194..28826ae30f5a68bd4a0c9e7a7b3a4c106653cb60 100644
--- a/chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc
+++ b/chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc
@@ -84,9 +84,13 @@ void SavePageIfNotNavigatedAway(const GURL& original_url,
offline_pages::RequestCoordinator* request_coordinator =
offline_pages::RequestCoordinatorFactory::GetForBrowserContext(
web_contents->GetBrowserContext());
- request_id = request_coordinator->SavePageLater(
- url, client_id, true,
- RequestCoordinator::RequestAvailability::DISABLED_FOR_OFFLINER);
+ if (request_coordinator) {
+ request_id = request_coordinator->SavePageLater(
+ url, client_id, true,
+ RequestCoordinator::RequestAvailability::DISABLED_FOR_OFFLINER);
+ } else {
+ DVLOG(1) << "SavePageIfNotNavigatedAway has no valid coordinator.";
+ }
}
// Pass request_id to the current tab's helper to attempt download right from
@@ -100,7 +104,10 @@ void SavePageIfNotNavigatedAway(const GURL& original_url,
offline_pages::RequestCoordinator* request_coordinator =
offline_pages::RequestCoordinatorFactory::GetForBrowserContext(
web_contents->GetBrowserContext());
- request_coordinator->EnableForOffliner(request_id, client_id);
+ if (request_coordinator)
+ request_coordinator->EnableForOffliner(request_id, client_id);
+ else
+ DVLOG(1) << "SavePageIfNotNavigatedAway has no valid coordinator.";
}
return;
}
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/offline_page_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698