| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2913 worker_fetch_context->set_first_party_for_cookies( | 2913 worker_fetch_context->set_first_party_for_cookies( |
| 2914 frame_->GetDocument().FirstPartyForCookies()); | 2914 frame_->GetDocument().FirstPartyForCookies()); |
| 2915 worker_fetch_context->set_is_secure_context( | 2915 worker_fetch_context->set_is_secure_context( |
| 2916 frame_->GetDocument().IsSecureContext()); | 2916 frame_->GetDocument().IsSecureContext()); |
| 2917 blink::WebServiceWorkerNetworkProvider* web_provider = | 2917 blink::WebServiceWorkerNetworkProvider* web_provider = |
| 2918 frame_->DataSource()->GetServiceWorkerNetworkProvider(); | 2918 frame_->DataSource()->GetServiceWorkerNetworkProvider(); |
| 2919 if (web_provider) { | 2919 if (web_provider) { |
| 2920 ServiceWorkerNetworkProvider* provider = | 2920 ServiceWorkerNetworkProvider* provider = |
| 2921 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( | 2921 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( |
| 2922 web_provider); | 2922 web_provider); |
| 2923 if (!provider) | |
| 2924 return nullptr; | |
| 2925 worker_fetch_context->set_service_worker_provider_id( | 2923 worker_fetch_context->set_service_worker_provider_id( |
| 2926 provider->provider_id()); | 2924 provider->provider_id()); |
| 2927 worker_fetch_context->set_is_controlled_by_service_worker( | 2925 worker_fetch_context->set_is_controlled_by_service_worker( |
| 2928 provider->IsControlledByServiceWorker()); | 2926 provider->IsControlledByServiceWorker()); |
| 2929 } | 2927 } |
| 2930 return std::move(worker_fetch_context); | 2928 return std::move(worker_fetch_context); |
| 2931 } | 2929 } |
| 2932 | 2930 |
| 2933 WebExternalPopupMenu* RenderFrameImpl::CreateExternalPopupMenu( | 2931 WebExternalPopupMenu* RenderFrameImpl::CreateExternalPopupMenu( |
| 2934 const WebPopupMenuInfo& popup_menu_info, | 2932 const WebPopupMenuInfo& popup_menu_info, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2966 | 2964 |
| 2967 std::unique_ptr<blink::WebServiceWorkerProvider> | 2965 std::unique_ptr<blink::WebServiceWorkerProvider> |
| 2968 RenderFrameImpl::CreateServiceWorkerProvider() { | 2966 RenderFrameImpl::CreateServiceWorkerProvider() { |
| 2969 // At this point we should have non-null data source. | 2967 // At this point we should have non-null data source. |
| 2970 DCHECK(frame_->DataSource()); | 2968 DCHECK(frame_->DataSource()); |
| 2971 if (!ChildThreadImpl::current()) | 2969 if (!ChildThreadImpl::current()) |
| 2972 return nullptr; // May be null in some tests. | 2970 return nullptr; // May be null in some tests. |
| 2973 ServiceWorkerNetworkProvider* provider = | 2971 ServiceWorkerNetworkProvider* provider = |
| 2974 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( | 2972 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( |
| 2975 frame_->DataSource()->GetServiceWorkerNetworkProvider()); | 2973 frame_->DataSource()->GetServiceWorkerNetworkProvider()); |
| 2976 if (!provider) { | |
| 2977 DCHECK(ServiceWorkerUtils::IsServicificationEnabled()); | |
| 2978 return nullptr; | |
| 2979 } | |
| 2980 if (!provider->context()) { | 2974 if (!provider->context()) { |
| 2981 // The context can be null when the frame is sandboxed. | 2975 // The context can be null when the frame is sandboxed. |
| 2982 return nullptr; | 2976 return nullptr; |
| 2983 } | 2977 } |
| 2984 return base::MakeUnique<WebServiceWorkerProviderImpl>( | 2978 return base::MakeUnique<WebServiceWorkerProviderImpl>( |
| 2985 ChildThreadImpl::current()->thread_safe_sender(), provider->context()); | 2979 ChildThreadImpl::current()->thread_safe_sender(), provider->context()); |
| 2986 } | 2980 } |
| 2987 | 2981 |
| 2988 service_manager::InterfaceProvider* RenderFrameImpl::GetInterfaceProvider() { | 2982 service_manager::InterfaceProvider* RenderFrameImpl::GetInterfaceProvider() { |
| 2989 DCHECK(remote_interfaces_); | 2983 DCHECK(remote_interfaces_); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3427 navigation_state->common_params().source_location->column_number; | 3421 navigation_state->common_params().source_location->column_number; |
| 3428 datasource->SetSourceLocation(source_location); | 3422 datasource->SetSourceLocation(source_location); |
| 3429 } | 3423 } |
| 3430 | 3424 |
| 3431 // Create the serviceworker's per-document network observing object if it | 3425 // Create the serviceworker's per-document network observing object if it |
| 3432 // does not exist (When navigation happens within a page, the provider already | 3426 // does not exist (When navigation happens within a page, the provider already |
| 3433 // exists). | 3427 // exists). |
| 3434 if (datasource->GetServiceWorkerNetworkProvider()) | 3428 if (datasource->GetServiceWorkerNetworkProvider()) |
| 3435 return; | 3429 return; |
| 3436 | 3430 |
| 3437 if (ServiceWorkerUtils::IsServicificationEnabled()) { | |
| 3438 // Disable interception via ServiceWorkerNetworkProvider if | |
| 3439 // servicification is enabled. | |
| 3440 return; | |
| 3441 } | |
| 3442 | |
| 3443 datasource->SetServiceWorkerNetworkProvider( | 3431 datasource->SetServiceWorkerNetworkProvider( |
| 3444 ServiceWorkerNetworkProvider::CreateForNavigation( | 3432 ServiceWorkerNetworkProvider::CreateForNavigation( |
| 3445 routing_id_, navigation_state->request_params(), frame, | 3433 routing_id_, navigation_state->request_params(), frame, |
| 3446 content_initiated)); | 3434 content_initiated)); |
| 3447 } | 3435 } |
| 3448 | 3436 |
| 3449 void RenderFrameImpl::DidStartProvisionalLoad(blink::WebDataSource* data_source, | 3437 void RenderFrameImpl::DidStartProvisionalLoad(blink::WebDataSource* data_source, |
| 3450 blink::WebURLRequest& request) { | 3438 blink::WebURLRequest& request) { |
| 3451 // In fast/loader/stop-provisional-loads.html, we abort the load before this | 3439 // In fast/loader/stop-provisional-loads.html, we abort the load before this |
| 3452 // callback is invoked. | 3440 // callback is invoked. |
| (...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6855 policy(info.default_policy), | 6843 policy(info.default_policy), |
| 6856 replaces_current_history_item(info.replaces_current_history_item), | 6844 replaces_current_history_item(info.replaces_current_history_item), |
| 6857 history_navigation_in_new_child_frame( | 6845 history_navigation_in_new_child_frame( |
| 6858 info.is_history_navigation_in_new_child_frame), | 6846 info.is_history_navigation_in_new_child_frame), |
| 6859 client_redirect(info.is_client_redirect), | 6847 client_redirect(info.is_client_redirect), |
| 6860 cache_disabled(info.is_cache_disabled), | 6848 cache_disabled(info.is_cache_disabled), |
| 6861 form(info.form), | 6849 form(info.form), |
| 6862 source_location(info.source_location) {} | 6850 source_location(info.source_location) {} |
| 6863 | 6851 |
| 6864 } // namespace content | 6852 } // namespace content |
| OLD | NEW |