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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_request_offline_job.h

Issue 2002433002: Handle online and offline redirects via interceptor and offline scheme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_OFFLINE_JOB_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_OFFLINE_JOB_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "net/base/net_errors.h"
10 #include "net/http/http_byte_range.h"
11 #include "net/url_request/url_request_file_job.h"
12 #include "url/gurl.h"
13
14 namespace base {
15 class FilePath;
16 }
17
18 namespace offline_pages {
19
20 // A request job that serves content from backing file for URLs with offline
21 // scheme.
22 class OfflinePageRequestOfflineJob : public net::URLRequestFileJob {
23 public:
24 OfflinePageRequestOfflineJob(void* profile_id,
25 net::URLRequest* request,
26 net::NetworkDelegate* network_delegate);
27 ~OfflinePageRequestOfflineJob() override;
28
29 // net::URLRequestJob overrides:
30 void Start() override;
31 void Kill() override;
32
33 private:
34 void StartAsync();
35 void LoadFile(const base::FilePath& offline_file_path);
36
37 void* profile_id_;
38 base::WeakPtrFactory<OfflinePageRequestOfflineJob> weak_ptr_factory_;
39
40 DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestOfflineJob);
41 };
42
43 } // namespace offline_pages
44
45 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_OFFLINE_JOB_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698