| Index: chrome/browser/android/offline_pages/offline_page_request_offline_job.h
|
| diff --git a/chrome/browser/android/offline_pages/offline_page_request_offline_job.h b/chrome/browser/android/offline_pages/offline_page_request_offline_job.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..016a46436eaee467af15d4d7d8bca0fd9fa8ff6e
|
| --- /dev/null
|
| +++ b/chrome/browser/android/offline_pages/offline_page_request_offline_job.h
|
| @@ -0,0 +1,45 @@
|
| +// 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_OFFLINE_JOB_H_
|
| +#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_OFFLINE_JOB_H_
|
| +
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "net/base/net_errors.h"
|
| +#include "net/http/http_byte_range.h"
|
| +#include "net/url_request/url_request_file_job.h"
|
| +#include "url/gurl.h"
|
| +
|
| +namespace base {
|
| +class FilePath;
|
| +}
|
| +
|
| +namespace offline_pages {
|
| +
|
| +// A request job that serves content from backing file for URLs with offline
|
| +// scheme.
|
| +class OfflinePageRequestOfflineJob : public net::URLRequestFileJob {
|
| + public:
|
| + OfflinePageRequestOfflineJob(void* profile_id,
|
| + net::URLRequest* request,
|
| + net::NetworkDelegate* network_delegate);
|
| + ~OfflinePageRequestOfflineJob() override;
|
| +
|
| + // net::URLRequestJob overrides:
|
| + void Start() override;
|
| + void Kill() override;
|
| +
|
| + private:
|
| + void StartAsync();
|
| + void LoadFile(const base::FilePath& offline_file_path);
|
| +
|
| + void* profile_id_;
|
| + base::WeakPtrFactory<OfflinePageRequestOfflineJob> weak_ptr_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestOfflineJob);
|
| +};
|
| +
|
| +} // namespace offline_pages
|
| +
|
| +#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_OFFLINE_JOB_H_
|
|
|