Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 2009453002: service worker: Don't control a subframe of an insecure context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: getSecurityOrigin Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/devtools/render_frame_devtools_agent_host.h" 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // commit; they leave the frame showing the previous page. 294 // commit; they leave the frame showing the previous page.
295 DCHECK(response); 295 DCHECK(response);
296 if (response->head.headers.get() && 296 if (response->head.headers.get() &&
297 (response->head.headers->response_code() == 204 || 297 (response->head.headers->response_code() == 204 ||
298 response->head.headers->response_code() == 205)) { 298 response->head.headers->response_code() == 205)) {
299 frame_tree_node_->ResetNavigationRequest(false); 299 frame_tree_node_->ResetNavigationRequest(false);
300 return; 300 return;
301 } 301 }
302 302
303 // Update the service worker params of the request params. 303 // Update the service worker params of the request params.
304 // TODO(falken): This should do an isSecureContext check too.
jww 2016/05/24 18:06:03 To ask a dumb question, why not add that check rig
falken 2016/05/25 09:19:58 I didn't look too hard, but there's no WebFrame he
clamy 2016/05/25 11:21:46 If you're checking for the sandbox flags, you can
falken 2016/05/26 02:09:49 I want to do an ancestor walk over the frame tree,
clamy 2016/05/26 15:45:31 FrameTreeNodes do allow you to walk over the Frame
alexmos 2016/05/26 22:13:35 Yeah, you should be able to follow the FrameTreeNo
falken 2016/05/27 05:47:03 Sorry yes I meant "FrameTreeNode doesn't have the
clamy 2016/05/30 16:22:42 Probably. In any case, we'll have to make signific
304 request_params_.should_create_service_worker = 305 request_params_.should_create_service_worker =
305 (frame_tree_node_->pending_sandbox_flags() & 306 (frame_tree_node_->pending_sandbox_flags() &
306 blink::WebSandboxFlags::Origin) != blink::WebSandboxFlags::Origin; 307 blink::WebSandboxFlags::Origin) != blink::WebSandboxFlags::Origin;
307 if (navigation_handle_->service_worker_handle()) { 308 if (navigation_handle_->service_worker_handle()) {
308 request_params_.service_worker_provider_id = 309 request_params_.service_worker_provider_id =
309 navigation_handle_->service_worker_handle() 310 navigation_handle_->service_worker_handle()
310 ->service_worker_provider_host_id(); 311 ->service_worker_provider_host_id();
311 } 312 }
312 313
313 // Update the lofi state of the request. 314 // Update the lofi state of the request.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 browser_context, navigating_frame_host->GetSiteInstance()); 469 browser_context, navigating_frame_host->GetSiteInstance());
469 DCHECK(partition); 470 DCHECK(partition);
470 471
471 ServiceWorkerContextWrapper* service_worker_context = 472 ServiceWorkerContextWrapper* service_worker_context =
472 static_cast<ServiceWorkerContextWrapper*>( 473 static_cast<ServiceWorkerContextWrapper*>(
473 partition->GetServiceWorkerContext()); 474 partition->GetServiceWorkerContext());
474 navigation_handle_->InitServiceWorkerHandle(service_worker_context); 475 navigation_handle_->InitServiceWorkerHandle(service_worker_context);
475 } 476 }
476 477
477 } // namespace content 478 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698