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

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

Issue 2233443003: Some initial hookup of offline page request interception (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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_HANDLER_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_HANDLER_H_
7
8 #include "base/macros.h"
9 #include "base/supports_user_data.h"
10 #include "content/public/common/resource_type.h"
11
12 namespace net {
13 class NetworkDelegate;
14 class URLRequest;
15 class URLRequestInterceptor;
16 class URLRequestJob;
17 }
18
19 namespace offline_pages {
20
21 // Class for servicing requests based on their offline information. Created one
22 // per URLRequest and attached to each request.
fgorski 2016/08/10 16:26:10 Please add a little longer comment that explains t
jianli 2016/08/10 21:37:25 Done.
23 class OfflinePageRequestHandler : public base::SupportsUserData::Data {
24 public:
25 // Attaches a newly created handler if the given |request| needs to
fgorski 2016/08/10 16:26:10 is there something missing in this sentence? If ye
jianli 2016/08/10 21:37:25 Done.
26 static void InitializeHandler(net::URLRequest* request,
27 content::ResourceType resource_type);
28
29 // Returns the handler attached to |request|. This may return null if no
30 // handler is attached.
31 static OfflinePageRequestHandler* GetHandler(net::URLRequest* request);
32
33 // Creates a protocol interceptor for offline pages.
34 static std::unique_ptr<net::URLRequestInterceptor> CreateInterceptor(
35 void* profile_id);
fgorski 2016/08/10 16:26:10 please document profile_id and explain why it is v
jianli 2016/08/10 21:37:25 Done.
36
37 ~OfflinePageRequestHandler() override;
38
39 net::URLRequestJob* MaybeCreateJob(
40 net::URLRequest* request,
41 net::NetworkDelegate* network_delegate,
42 void* profile_id);
43
44 private:
45 OfflinePageRequestHandler();
46
47 DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestHandler);
48 };
49
50 } // namespace offline_pages
51
52 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698