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

Unified Diff: chrome/browser/android/offline_pages/offline_page_request_job.h

Issue 2340133005: Merge M54: Support serving offline page by offline ID (Closed)
Patch Set: Created 4 years, 3 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
Index: chrome/browser/android/offline_pages/offline_page_request_job.h
diff --git a/chrome/browser/android/offline_pages/offline_page_request_job.h b/chrome/browser/android/offline_pages/offline_page_request_job.h
index 0e8333d6b1ec3021d3f82ae6e0ef4101022dad03..8c9541664e4ba11519fb0abe8a3a275f56e6a465 100644
--- a/chrome/browser/android/offline_pages/offline_page_request_job.h
+++ b/chrome/browser/android/offline_pages/offline_page_request_job.h
@@ -19,13 +19,20 @@ namespace offline_pages {
// Header that indicates that the offline page should be loaded if it exists
// regardless current network conditions. Its value is a comma/space separated
// name-value pair that may provide reason or define custom behavior.
-extern const char kLoadingOfflinePageHeader[];
-// The name used in name-value pair of kLoadingOfflinePageHeader to denote the
-// reason for loading offline page.
-extern const char kLoadingOfflinePageReason[];
+extern const char kOfflinePageHeader[];
+// The name used in name-value pair of kOfflinePageHeader to tell if the offline
+// info in this header should be persisted across session restore.
+extern const char kOfflinePageHeaderPersistKey[];
+// The name used in name-value pair of kOfflinePageHeader to denote the reason
+// for loading offline page.
+extern const char kOfflinePageHeaderReasonKey[];
// Possible values in name-value pair that denote the reason for loading offline
// page.
-extern const char kLoadingOfflinePageDueToNetError[];
+extern const char kOfflinePageHeaderReasonValueDueToNetError[];
+extern const char kOfflinePageHeaderReasonValueFromDownload[];
+// The name used in name-value pair of kOfflinePageHeader to denote the offline
+// ID of the offline page to load.
+extern const char kOfflinePageHeaderIDKey[];
// A request job that serves content from offline file.
class OfflinePageRequestJob : public net::URLRequestFileJob {
@@ -75,8 +82,7 @@ class OfflinePageRequestJob : public net::URLRequestFileJob {
// Creates and returns a job to serve the offline page. Nullptr is returned if
// offline page cannot or should not be served.
- static OfflinePageRequestJob* Create(void* profile_id,
- net::URLRequest* request,
+ static OfflinePageRequestJob* Create(net::URLRequest* request,
net::NetworkDelegate* network_delegate);
~OfflinePageRequestJob() override;
@@ -90,8 +96,7 @@ class OfflinePageRequestJob : public net::URLRequestFileJob {
void SetDelegateForTesting(std::unique_ptr<Delegate> delegate);
private:
- OfflinePageRequestJob(void* profile_id,
- net::URLRequest* request,
+ OfflinePageRequestJob(net::URLRequest* request,
net::NetworkDelegate* network_delegate);
void StartAsync();
@@ -99,9 +104,6 @@ class OfflinePageRequestJob : public net::URLRequestFileJob {
// Restarts the request job in order to fall back to the default handling.
void FallbackToDefault();
- // The profile for processing offline pages.
- void* profile_id_;
-
std::unique_ptr<Delegate> delegate_;
base::WeakPtrFactory<OfflinePageRequestJob> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698