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

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

Issue 2869203002: Cleanup around LocalFrame initialization (Closed)
Patch Set: +test fix 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
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 WebFrame* previous_sibling, 326 WebFrame* previous_sibling,
327 const WebParsedFeaturePolicy& container_policy, 327 const WebParsedFeaturePolicy& container_policy,
328 const WebFrameOwnerProperties& frame_owner_properties, 328 const WebFrameOwnerProperties& frame_owner_properties,
329 WebFrame* opener) { 329 WebFrame* opener) {
330 WebLocalFrameImpl* child = WebLocalFrameImpl::Create( 330 WebLocalFrameImpl* child = WebLocalFrameImpl::Create(
331 scope, client, interface_provider, interface_registry, opener); 331 scope, client, interface_provider, interface_registry, opener);
332 InsertAfter(child, previous_sibling); 332 InsertAfter(child, previous_sibling);
333 RemoteFrameOwner* owner = 333 RemoteFrameOwner* owner =
334 RemoteFrameOwner::Create(static_cast<SandboxFlags>(sandbox_flags), 334 RemoteFrameOwner::Create(static_cast<SandboxFlags>(sandbox_flags),
335 container_policy, frame_owner_properties); 335 container_policy, frame_owner_properties);
336 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
337 // which may result in the browser observing two navigations to about:blank
338 // (one from the initial frame creation, and one from swapping it into the
339 // remote process). FrameLoader might need a special initialization function
340 // for this case to avoid that duplicate navigation.
341 child->InitializeCoreFrame(*GetFrame()->GetPage(), owner, name); 336 child->InitializeCoreFrame(*GetFrame()->GetPage(), owner, name);
342 // Partially related with the above FIXME--the init() call may trigger JS
343 // dispatch. However,
344 // if the parent is remote, it should never be detached synchronously...
345 DCHECK(child->GetFrame()); 337 DCHECK(child->GetFrame());
346 return child; 338 return child;
347 } 339 }
348 340
349 void WebRemoteFrameImpl::InitializeCoreFrame(Page& page, 341 void WebRemoteFrameImpl::InitializeCoreFrame(Page& page,
350 FrameOwner* owner, 342 FrameOwner* owner,
351 const AtomicString& name) { 343 const AtomicString& name) {
352 SetCoreFrame(RemoteFrame::Create(frame_client_.Get(), page, owner)); 344 SetCoreFrame(RemoteFrame::Create(frame_client_.Get(), page, owner));
353 GetFrame()->CreateView(); 345 GetFrame()->CreateView();
354 frame_->Tree().SetName(name); 346 frame_->Tree().SetName(name);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 } 524 }
533 525
534 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, 526 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope,
535 WebRemoteFrameClient* client) 527 WebRemoteFrameClient* client)
536 : WebRemoteFrameBase(scope), 528 : WebRemoteFrameBase(scope),
537 frame_client_(RemoteFrameClientImpl::Create(this)), 529 frame_client_(RemoteFrameClientImpl::Create(this)),
538 client_(client), 530 client_(client),
539 self_keep_alive_(this) {} 531 self_keep_alive_(this) {}
540 532
541 } // namespace blink 533 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698