 Chromium Code Reviews
 Chromium Code Reviews Issue 2501343003:
  PlzNavigate: AppCache support.  (Closed)
    
  
    Issue 2501343003:
  PlzNavigate: AppCache support.  (Closed) 
  | Index: content/browser/frame_host/navigation_request.cc | 
| diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc | 
| index cfdd32db8acb5b0bf01b7fa280952e70a5230739..f96f679ba11c9ac632d6c97ff7b16476291c3a44 100644 | 
| --- a/content/browser/frame_host/navigation_request.cc | 
| +++ b/content/browser/frame_host/navigation_request.cc | 
| @@ -6,6 +6,8 @@ | 
| #include <utility> | 
| +#include "content/browser/appcache/appcache_navigation_handle.h" | 
| +#include "content/browser/appcache/chrome_appcache_service.h" | 
| #include "content/browser/child_process_security_policy_impl.h" | 
| #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 
| #include "content/browser/frame_host/frame_tree.h" | 
| @@ -29,6 +31,7 @@ | 
| #include "content/public/browser/navigation_ui_data.h" | 
| #include "content/public/browser/storage_partition.h" | 
| #include "content/public/browser/stream_handle.h" | 
| +#include "content/public/common/appcache_info.h" | 
| #include "content/public/common/content_client.h" | 
| #include "content/public/common/request_context_type.h" | 
| #include "content/public/common/resource_response.h" | 
| @@ -405,6 +408,11 @@ void NavigationRequest::OnResponseStarted( | 
| ->service_worker_provider_host_id() | 
| : kInvalidServiceWorkerProviderId; | 
| + request_params_.appcache_host_id = | 
| + navigation_handle_->appcache_handle() | 
| + ? navigation_handle_->appcache_handle()->appcache_host_id() | 
| + : kAppCacheNoHostId; | 
| + | 
| // Update the lofi state of the request. | 
| if (response->head.is_using_lofi) | 
| common_params_.lofi_state = LOFI_ON; | 
| @@ -510,6 +518,11 @@ void NavigationRequest::OnStartChecksComplete( | 
| navigation_handle_->InitServiceWorkerHandle(service_worker_context); | 
| } | 
| + if (common_params_.url.SchemeIsHTTPOrHTTPS()) { | 
| 
michaeln
2016/12/03 00:58:58
i think we should use IsSchemeSupportedForAppCache
 
ananta
2016/12/03 14:55:04
Done.
 | 
| + navigation_handle_->InitAppCacheHandle( | 
| + static_cast<ChromeAppCacheService*>(partition->GetAppCacheService())); | 
| + } | 
| + | 
| // Mark the fetch_start (Navigation Timing API). | 
| request_params_.navigation_timing.fetch_start = base::TimeTicks::Now(); | 
| @@ -545,7 +558,8 @@ void NavigationRequest::OnStartChecksComplete( | 
| frame_tree_node_->frame_tree_node_id(), is_for_guests_only, | 
| report_raw_headers), | 
| std::move(navigation_ui_data), | 
| - navigation_handle_->service_worker_handle(), this); | 
| + navigation_handle_->service_worker_handle(), | 
| + navigation_handle_->appcache_handle(), this); | 
| } | 
| void NavigationRequest::OnRedirectChecksComplete( |