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

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

Issue 2388253002: Use the previews black list for offline previews (Closed)
Patch Set: Created 4 years, 2 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_H_ 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_H_ 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "net/url_request/url_request_interceptor.h" 9 #include "net/url_request/url_request_interceptor.h"
10 10
11 namespace net { 11 namespace net {
12 class NetworkDelegate; 12 class NetworkDelegate;
13 class URLRequest; 13 class URLRequest;
14 class URLRequestJob; 14 class URLRequestJob;
15 } 15 }
16 16
17 namespace previews {
18 class PreviewsBlackList;
19 }
20
17 namespace offline_pages { 21 namespace offline_pages {
18 22
19 // An interceptor to hijack requests and potentially service them based on 23 // An interceptor to hijack requests and potentially service them based on
20 // their offline information. Created one per profile. 24 // their offline information. Created one per profile.
21 class OfflinePageRequestInterceptor : public net::URLRequestInterceptor { 25 class OfflinePageRequestInterceptor : public net::URLRequestInterceptor {
22 public: 26 public:
23 OfflinePageRequestInterceptor(); 27 OfflinePageRequestInterceptor(
tbansal1 2016/10/04 12:38:04 explicit
RyanSturm 2016/10/04 21:36:37 Done.
28 previews::PreviewsBlackList* previews_black_list);
24 ~OfflinePageRequestInterceptor() override; 29 ~OfflinePageRequestInterceptor() override;
25 30
26 private: 31 private:
27 // Overrides from net::URLRequestInterceptor: 32 // Overrides from net::URLRequestInterceptor:
28 net::URLRequestJob* MaybeInterceptRequest( 33 net::URLRequestJob* MaybeInterceptRequest(
29 net::URLRequest* request, 34 net::URLRequest* request,
30 net::NetworkDelegate* network_delegate) const override; 35 net::NetworkDelegate* network_delegate) const override;
31 36
37 // Used to determine if an URLRequest is eligible for offline previews.
38 previews::PreviewsBlackList* previews_black_list_;
jianli 2016/10/03 22:56:05 Who owns this? What's lifetime model for this? It
RyanSturm 2016/10/03 23:54:38 This is owned by PreviewsIOData, which is created
39
32 DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestInterceptor); 40 DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestInterceptor);
33 }; 41 };
34 42
35 } // namespace offline_pages 43 } // namespace offline_pages
36 44
37 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_ H_ 45 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698