| 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 09af8b64d90d95c94c85e0ae499ca4bbe21f59f5..e3f5b7db87ce60bc813553af48d3556551b2a1b1 100644
|
| --- a/chrome/browser/android/offline_pages/offline_page_request_job.h
|
| +++ b/chrome/browser/android/offline_pages/offline_page_request_job.h
|
| @@ -1,27 +1,31 @@
|
| // Copyright 2016 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_JOB_H_
|
| #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_JOB_H_
|
|
|
| +#include <memory>
|
| +
|
| #include "base/memory/weak_ptr.h"
|
| #include "content/public/browser/resource_request_info.h"
|
| #include "content/public/common/resource_type.h"
|
| #include "net/url_request/url_request_file_job.h"
|
|
|
| namespace base {
|
| class FilePath;
|
| }
|
|
|
| namespace offline_pages {
|
| +struct OfflinePageHeader;
|
| +struct OfflinePageItem;
|
|
|
| // A request job that serves content from offline file.
|
| class OfflinePageRequestJob : public net::URLRequestFileJob {
|
| public:
|
| // This enum is used for UMA reporting. It contains all possible outcomes of
|
| // handling requests that might service offline page in different network
|
| // conditions. Generally one of these outcomes will happen.
|
| // The fringe errors (like no OfflinePageModel, etc.) are not reported due
|
| // to their low probability.
|
| // NOTE: because this is used for UMA reporting, these values should not be
|
| @@ -66,33 +70,38 @@ class OfflinePageRequestJob : public net::URLRequestFileJob {
|
| // offline page cannot or should not be served.
|
| static OfflinePageRequestJob* Create(net::URLRequest* request,
|
| net::NetworkDelegate* network_delegate);
|
|
|
| ~OfflinePageRequestJob() override;
|
|
|
| // net::URLRequestJob overrides:
|
| void Start() override;
|
| void Kill() override;
|
|
|
| - void OnOfflineFilePathAvailable(const base::FilePath& offline_file_path);
|
| + void OnOfflineFilePathAvailable(
|
| + const base::FilePath& offline_file_path,
|
| + std::unique_ptr<OfflinePageHeader> offline_header,
|
| + std::unique_ptr<OfflinePageItem> offline_page);
|
|
|
| void SetDelegateForTesting(std::unique_ptr<Delegate> delegate);
|
|
|
| private:
|
| OfflinePageRequestJob(net::URLRequest* request,
|
| net::NetworkDelegate* network_delegate);
|
|
|
| void StartAsync();
|
|
|
| // Restarts the request job in order to fall back to the default handling.
|
| void FallbackToDefault();
|
|
|
| std::unique_ptr<Delegate> delegate_;
|
|
|
| + bool was_started_as_preview_;
|
| +
|
| base::WeakPtrFactory<OfflinePageRequestJob> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestJob);
|
| };
|
|
|
| } // namespace offline_pages
|
|
|
| #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_JOB_H_
|
|
|