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

Unified Diff: components/offline_pages/background/request_coordinator.cc

Issue 2522073002: [OfflinePages] RequestCoordinatorFactory return null for incognito (Closed)
Patch Set: Dropped GetBrowserContextToUse() per Filip Created 4 years, 1 month 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
Index: components/offline_pages/background/request_coordinator.cc
diff --git a/components/offline_pages/background/request_coordinator.cc b/components/offline_pages/background/request_coordinator.cc
index 6b7753c181d47c4e5b388760d7dbf6234c36e070..7538887b81eb5c78352e8b9f41a3a19815e3bce5 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -194,6 +194,10 @@ int64_t RequestCoordinator::SavePageLater(const GURL& url,
RequestAvailability availability) {
DVLOG(2) << "URL is " << url << " " << __func__;
+ // Make sure this is called on actual instance (as the factory
+ // may not return one for incognito profile).
+ CHECK(this);
fgorski 2016/11/22 22:46:33 I am still not OK with this, and it does not seem
Pete Williamson 2016/11/22 22:59:32 This might be better as a DCHECK. The idea is to
jianli 2016/11/22 23:03:55 I agree with Filip that this was not a good patter
dougarnett 2016/11/23 18:19:52 Done.
+
if (!OfflinePageModel::CanSaveURL(url)) {
DVLOG(1) << "Not able to save page for requested url: " << url;
return 0L;
« chrome/browser/net/net_error_tab_helper.cc ('K') | « chrome/browser/net/net_error_tab_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698