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

Side by Side Diff: third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Addressing review comments Created 3 years, 8 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 "web/WebRemoteFrameImpl.h" 5 #include "web/WebRemoteFrameImpl.h"
6 6
7 #include "bindings/core/v8/DOMWrapperWorld.h" 7 #include "bindings/core/v8/DOMWrapperWorld.h"
8 #include "bindings/core/v8/WindowProxy.h" 8 #include "bindings/core/v8/WindowProxy.h"
9 #include "core/dom/Fullscreen.h" 9 #include "core/dom/Fullscreen.h"
10 #include "core/dom/RemoteSecurityContext.h" 10 #include "core/dom/RemoteSecurityContext.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 318
319 WebLocalFrame* WebRemoteFrameImpl::CreateLocalChild( 319 WebLocalFrame* WebRemoteFrameImpl::CreateLocalChild(
320 WebTreeScopeType scope, 320 WebTreeScopeType scope,
321 const WebString& name, 321 const WebString& name,
322 WebSandboxFlags sandbox_flags, 322 WebSandboxFlags sandbox_flags,
323 WebFrameClient* client, 323 WebFrameClient* client,
324 blink::InterfaceProvider* interface_provider, 324 blink::InterfaceProvider* interface_provider,
325 blink::InterfaceRegistry* interface_registry, 325 blink::InterfaceRegistry* interface_registry,
326 WebFrame* previous_sibling, 326 WebFrame* previous_sibling,
327 const WebParsedFeaturePolicy& container_policy,
327 const WebFrameOwnerProperties& frame_owner_properties, 328 const WebFrameOwnerProperties& frame_owner_properties,
328 WebFrame* opener) { 329 WebFrame* opener) {
329 WebLocalFrameImpl* child = WebLocalFrameImpl::Create( 330 WebLocalFrameImpl* child = WebLocalFrameImpl::Create(
330 scope, client, interface_provider, interface_registry, opener); 331 scope, client, interface_provider, interface_registry, opener);
331 InsertAfter(child, previous_sibling); 332 InsertAfter(child, previous_sibling);
332 RemoteFrameOwner* owner = RemoteFrameOwner::Create( 333 RemoteFrameOwner* owner =
333 static_cast<SandboxFlags>(sandbox_flags), frame_owner_properties); 334 RemoteFrameOwner::Create(static_cast<SandboxFlags>(sandbox_flags),
335 container_policy, frame_owner_properties);
334 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, 336 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
335 // which may result in the browser observing two navigations to about:blank 337 // which may result in the browser observing two navigations to about:blank
336 // (one from the initial frame creation, and one from swapping it into the 338 // (one from the initial frame creation, and one from swapping it into the
337 // remote process). FrameLoader might need a special initialization function 339 // remote process). FrameLoader might need a special initialization function
338 // for this case to avoid that duplicate navigation. 340 // for this case to avoid that duplicate navigation.
339 child->InitializeCoreFrame(*GetFrame()->GetPage(), owner, name); 341 child->InitializeCoreFrame(*GetFrame()->GetPage(), owner, name);
340 // Partially related with the above FIXME--the init() call may trigger JS 342 // Partially related with the above FIXME--the init() call may trigger JS
341 // dispatch. However, 343 // dispatch. However,
342 // if the parent is remote, it should never be detached synchronously... 344 // if the parent is remote, it should never be detached synchronously...
343 DCHECK(child->GetFrame()); 345 DCHECK(child->GetFrame());
344 return child; 346 return child;
345 } 347 }
346 348
347 void WebRemoteFrameImpl::InitializeCoreFrame(Page& page, 349 void WebRemoteFrameImpl::InitializeCoreFrame(Page& page,
348 FrameOwner* owner, 350 FrameOwner* owner,
349 const AtomicString& name) { 351 const AtomicString& name) {
350 SetCoreFrame(RemoteFrame::Create(frame_client_.Get(), page, owner)); 352 SetCoreFrame(RemoteFrame::Create(frame_client_.Get(), page, owner));
351 GetFrame()->CreateView(); 353 GetFrame()->CreateView();
352 frame_->Tree().SetName(name); 354 frame_->Tree().SetName(name);
353 } 355 }
354 356
355 WebRemoteFrame* WebRemoteFrameImpl::CreateRemoteChild( 357 WebRemoteFrame* WebRemoteFrameImpl::CreateRemoteChild(
356 WebTreeScopeType scope, 358 WebTreeScopeType scope,
357 const WebString& name, 359 const WebString& name,
358 WebSandboxFlags sandbox_flags, 360 WebSandboxFlags sandbox_flags,
361 const WebParsedFeaturePolicy& container_policy,
359 WebRemoteFrameClient* client, 362 WebRemoteFrameClient* client,
360 WebFrame* opener) { 363 WebFrame* opener) {
361 WebRemoteFrameImpl* child = WebRemoteFrameImpl::Create(scope, client, opener); 364 WebRemoteFrameImpl* child = WebRemoteFrameImpl::Create(scope, client, opener);
362 AppendChild(child); 365 AppendChild(child);
363 RemoteFrameOwner* owner = RemoteFrameOwner::Create( 366 RemoteFrameOwner* owner =
364 static_cast<SandboxFlags>(sandbox_flags), WebFrameOwnerProperties()); 367 RemoteFrameOwner::Create(static_cast<SandboxFlags>(sandbox_flags),
368 container_policy, WebFrameOwnerProperties());
365 child->InitializeCoreFrame(*GetFrame()->GetPage(), owner, name); 369 child->InitializeCoreFrame(*GetFrame()->GetPage(), owner, name);
366 return child; 370 return child;
367 } 371 }
368 372
369 void WebRemoteFrameImpl::SetWebLayer(WebLayer* layer) { 373 void WebRemoteFrameImpl::SetWebLayer(WebLayer* layer) {
370 if (!GetFrame()) 374 if (!GetFrame())
371 return; 375 return;
372 376
373 GetFrame()->SetWebLayer(layer); 377 GetFrame()->SetWebLayer(layer);
374 } 378 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 535 }
532 536
533 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, 537 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope,
534 WebRemoteFrameClient* client) 538 WebRemoteFrameClient* client)
535 : WebRemoteFrame(scope), 539 : WebRemoteFrame(scope),
536 frame_client_(RemoteFrameClientImpl::Create(this)), 540 frame_client_(RemoteFrameClientImpl::Create(this)),
537 client_(client), 541 client_(client),
538 self_keep_alive_(this) {} 542 self_keep_alive_(this) {}
539 543
540 } // namespace blink 544 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebRemoteFrameImpl.h ('k') | third_party/WebKit/Source/web/tests/FrameTestHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698