OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/frame_host/navigation_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "content/browser/child_process_security_policy_impl.h" | 9 #include "content/browser/child_process_security_policy_impl.h" |
10 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 10 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 // Only initialize the ServiceWorkerNavigationHandle if it can be created for | 487 // Only initialize the ServiceWorkerNavigationHandle if it can be created for |
488 // this frame. | 488 // this frame. |
489 bool can_create_service_worker = | 489 bool can_create_service_worker = |
490 (frame_tree_node_->pending_sandbox_flags() & | 490 (frame_tree_node_->pending_sandbox_flags() & |
491 blink::WebSandboxFlags::Origin) != blink::WebSandboxFlags::Origin; | 491 blink::WebSandboxFlags::Origin) != blink::WebSandboxFlags::Origin; |
492 request_params_.should_create_service_worker = can_create_service_worker; | 492 request_params_.should_create_service_worker = can_create_service_worker; |
493 if (can_create_service_worker) { | 493 if (can_create_service_worker) { |
494 ServiceWorkerContextWrapper* service_worker_context = | 494 ServiceWorkerContextWrapper* service_worker_context = |
495 static_cast<ServiceWorkerContextWrapper*>( | 495 static_cast<ServiceWorkerContextWrapper*>( |
496 partition->GetServiceWorkerContext()); | 496 partition->GetServiceWorkerContext()); |
497 navigation_handle_->InitServiceWorkerHandle(service_worker_context); | 497 navigation_handle_->InitServiceWorkerHandle( |
| 498 service_worker_context, |
| 499 navigating_frame_host->GetProcess()->CreateURLLoaderFactoryGetter()); |
498 } | 500 } |
499 | 501 |
500 // Mark the fetch_start (Navigation Timing API). | 502 // Mark the fetch_start (Navigation Timing API). |
501 request_params_.navigation_timing.fetch_start = base::TimeTicks::Now(); | 503 request_params_.navigation_timing.fetch_start = base::TimeTicks::Now(); |
502 | 504 |
503 // TODO(mkwst): This is incorrect. It ought to use the definition from | 505 // TODO(mkwst): This is incorrect. It ought to use the definition from |
504 // 'Document::firstPartyForCookies()' in Blink, which walks the ancestor tree | 506 // 'Document::firstPartyForCookies()' in Blink, which walks the ancestor tree |
505 // and verifies that all origins are PSL-matches (and special-cases extension | 507 // and verifies that all origins are PSL-matches (and special-cases extension |
506 // URLs). | 508 // URLs). |
507 const GURL& first_party_for_cookies = | 509 const GURL& first_party_for_cookies = |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 590 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
589 | 591 |
590 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 592 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
591 common_params_, request_params_, | 593 common_params_, request_params_, |
592 is_view_source_); | 594 is_view_source_); |
593 | 595 |
594 frame_tree_node_->ResetNavigationRequest(true); | 596 frame_tree_node_->ResetNavigationRequest(true); |
595 } | 597 } |
596 | 598 |
597 } // namespace content | 599 } // namespace content |
OLD | NEW |