| 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 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_REQUESTER_INFO_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_REQUESTER_INFO_H_ |
| 6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUESTER_INFO_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUESTER_INFO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 static scoped_refptr<ResourceRequesterInfo> CreateForRendererTesting( | 56 static scoped_refptr<ResourceRequesterInfo> CreateForRendererTesting( |
| 57 int child_id); | 57 int child_id); |
| 58 | 58 |
| 59 // Creates a ResourceRequesterInfo for a browser side navigation request which | 59 // Creates a ResourceRequesterInfo for a browser side navigation request which |
| 60 // is initiated by the browser process. | 60 // is initiated by the browser process. |
| 61 static scoped_refptr<ResourceRequesterInfo> CreateForBrowserSideNavigation( | 61 static scoped_refptr<ResourceRequesterInfo> CreateForBrowserSideNavigation( |
| 62 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); | 62 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
| 63 | 63 |
| 64 // Creates a ResourceRequesterInfo for a download or page save request. | 64 // Creates a ResourceRequesterInfo for a download or page save request. |
| 65 static scoped_refptr<ResourceRequesterInfo> CreateForDownloadOrPageSave( | 65 static scoped_refptr<ResourceRequesterInfo> CreateForDownloadOrPageSave( |
| 66 int child_id); | 66 int child_id, |
| 67 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
| 67 | 68 |
| 68 // Creates a ResourceRequesterInfo for a service worker navigation preload | 69 // Creates a ResourceRequesterInfo for a service worker navigation preload |
| 69 // request. When PlzNavigate is enabled, |original_request_info| must be | 70 // request. When PlzNavigate is enabled, |original_request_info| must be |
| 70 // browser side navigation type. Otherwise it must be renderer type. | 71 // browser side navigation type. Otherwise it must be renderer type. |
| 71 static scoped_refptr<ResourceRequesterInfo> CreateForNavigationPreload( | 72 static scoped_refptr<ResourceRequesterInfo> CreateForNavigationPreload( |
| 72 const ResourceRequesterInfo& original_request_info); | 73 const ResourceRequesterInfo& original_request_info); |
| 73 | 74 |
| 74 bool IsRenderer() const { return type_ == RequesterType::RENDERER; } | 75 bool IsRenderer() const { return type_ == RequesterType::RENDERER; } |
| 75 bool IsBrowserSideNavigation() const { | 76 bool IsBrowserSideNavigation() const { |
| 76 return type_ == RequesterType::BROWSER_SIDE_NAVIGATION; | 77 return type_ == RequesterType::BROWSER_SIDE_NAVIGATION; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 const scoped_refptr<storage::FileSystemContext> file_system_context_; | 153 const scoped_refptr<storage::FileSystemContext> file_system_context_; |
| 153 const scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 154 const scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 154 const GetContextsCallback get_contexts_callback_; | 155 const GetContextsCallback get_contexts_callback_; |
| 155 | 156 |
| 156 DISALLOW_COPY_AND_ASSIGN(ResourceRequesterInfo); | 157 DISALLOW_COPY_AND_ASSIGN(ResourceRequesterInfo); |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 } // namespace content | 160 } // namespace content |
| 160 | 161 |
| 161 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUESTER_INFO_H_ | 162 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUESTER_INFO_H_ |
| OLD | NEW |