OLD | NEW |
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 #include "chrome/browser/android/offline_pages/offline_page_request_interceptor.
h" | 5 #include "chrome/browser/android/offline_pages/offline_page_request_interceptor.
h" |
6 | 6 |
7 #include "base/supports_user_data.h" | 7 #include "base/supports_user_data.h" |
8 #include "chrome/browser/android/offline_pages/offline_page_request_job.h" | 8 #include "chrome/browser/android/offline_pages/offline_page_request_job.h" |
9 | 9 |
10 namespace offline_pages { | 10 namespace offline_pages { |
11 | 11 |
12 OfflinePageRequestInterceptor::OfflinePageRequestInterceptor(void* profile_id) | 12 OfflinePageRequestInterceptor::OfflinePageRequestInterceptor() {} |
13 : profile_id_(profile_id) { | |
14 DCHECK(profile_id); | |
15 } | |
16 | 13 |
17 OfflinePageRequestInterceptor::~OfflinePageRequestInterceptor() {} | 14 OfflinePageRequestInterceptor::~OfflinePageRequestInterceptor() {} |
18 | 15 |
19 net::URLRequestJob* OfflinePageRequestInterceptor::MaybeInterceptRequest( | 16 net::URLRequestJob* OfflinePageRequestInterceptor::MaybeInterceptRequest( |
20 net::URLRequest* request, | 17 net::URLRequest* request, |
21 net::NetworkDelegate* network_delegate) const { | 18 net::NetworkDelegate* network_delegate) const { |
22 // OfflinePageRequestJob::Create may return a nullptr if the interception | 19 // OfflinePageRequestJob::Create may return a nullptr if the interception |
23 // is not needed for some sort of requests, like non-main resource request, | 20 // is not needed for some sort of requests, like non-main resource request, |
24 // non-http request and more. | 21 // non-http request and more. |
25 return OfflinePageRequestJob::Create(profile_id_, request, network_delegate); | 22 return OfflinePageRequestJob::Create(request, network_delegate); |
26 } | 23 } |
27 | 24 |
28 } // namespace offline_pages | 25 } // namespace offline_pages |
OLD | NEW |