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

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

Issue 2869203002: Cleanup around LocalFrame initialization (Closed)
Patch Set: Use InitializeCoreFrame() in CreateProvisional() Created 3 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 "web/WebRemoteFrameImpl.h" 5 #include "web/WebRemoteFrameImpl.h"
6 6
7 #include "bindings/core/v8/WindowProxy.h" 7 #include "bindings/core/v8/WindowProxy.h"
8 #include "core/dom/Fullscreen.h" 8 #include "core/dom/Fullscreen.h"
9 #include "core/dom/RemoteSecurityContext.h" 9 #include "core/dom/RemoteSecurityContext.h"
10 #include "core/dom/SecurityContext.h" 10 #include "core/dom/SecurityContext.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 WebFrame* previous_sibling, 325 WebFrame* previous_sibling,
326 const WebParsedFeaturePolicy& container_policy, 326 const WebParsedFeaturePolicy& container_policy,
327 const WebFrameOwnerProperties& frame_owner_properties, 327 const WebFrameOwnerProperties& frame_owner_properties,
328 WebFrame* opener) { 328 WebFrame* opener) {
329 WebLocalFrameImpl* child = WebLocalFrameImpl::Create( 329 WebLocalFrameImpl* child = WebLocalFrameImpl::Create(
330 scope, client, interface_provider, interface_registry, opener); 330 scope, client, interface_provider, interface_registry, opener);
331 InsertAfter(child, previous_sibling); 331 InsertAfter(child, previous_sibling);
332 RemoteFrameOwner* owner = 332 RemoteFrameOwner* owner =
333 RemoteFrameOwner::Create(static_cast<SandboxFlags>(sandbox_flags), 333 RemoteFrameOwner::Create(static_cast<SandboxFlags>(sandbox_flags),
334 container_policy, frame_owner_properties); 334 container_policy, frame_owner_properties);
335 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
Nate Chapin 2017/05/10 16:33:20 I don't think this comment was correct, given that
336 // which may result in the browser observing two navigations to about:blank
337 // (one from the initial frame creation, and one from swapping it into the
338 // remote process). FrameLoader might need a special initialization function
339 // for this case to avoid that duplicate navigation.
340 child->InitializeCoreFrame(*GetFrame()->GetPage(), owner, name); 335 child->InitializeCoreFrame(*GetFrame()->GetPage(), owner, name);
341 // Partially related with the above FIXME--the init() call may trigger JS
342 // dispatch. However,
Nate Chapin 2017/05/10 16:33:20 This comment is now obsolete.
dcheng 2017/05/11 21:36:25 Should we update the comment in LocalFrame::Init()
Nate Chapin 2017/05/12 19:52:29 Dropped it, it doesn't look like there's any subst
343 // if the parent is remote, it should never be detached synchronously...
344 DCHECK(child->GetFrame()); 336 DCHECK(child->GetFrame());
345 return child; 337 return child;
346 } 338 }
347 339
348 void WebRemoteFrameImpl::InitializeCoreFrame(Page& page, 340 void WebRemoteFrameImpl::InitializeCoreFrame(Page& page,
349 FrameOwner* owner, 341 FrameOwner* owner,
350 const AtomicString& name) { 342 const AtomicString& name) {
351 SetCoreFrame(RemoteFrame::Create(frame_client_.Get(), page, owner)); 343 SetCoreFrame(RemoteFrame::Create(frame_client_.Get(), page, owner));
352 GetFrame()->CreateView(); 344 GetFrame()->CreateView();
353 frame_->Tree().SetName(name); 345 frame_->Tree().SetName(name);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 523 }
532 524
533 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, 525 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope,
534 WebRemoteFrameClient* client) 526 WebRemoteFrameClient* client)
535 : WebRemoteFrame(scope), 527 : WebRemoteFrame(scope),
536 frame_client_(RemoteFrameClientImpl::Create(this)), 528 frame_client_(RemoteFrameClientImpl::Create(this)),
537 client_(client), 529 client_(client),
538 self_keep_alive_(this) {} 530 self_keep_alive_(this) {}
539 531
540 } // namespace blink 532 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698