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

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

Issue 1685003002: Plumb the correct owner document through DocumentInit::m_owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change page popup plumbing, remove vestigal bits related to failing security context init Created 4 years, 10 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 bool WebLocalFrameImpl::hasVerticalScrollbar() const 673 bool WebLocalFrameImpl::hasVerticalScrollbar() const
674 { 674 {
675 return frame() && frame()->view() && frame()->view()->verticalScrollbar(); 675 return frame() && frame()->view() && frame()->view()->verticalScrollbar();
676 } 676 }
677 677
678 WebView* WebLocalFrameImpl::view() const 678 WebView* WebLocalFrameImpl::view() const
679 { 679 {
680 return viewImpl(); 680 return viewImpl();
681 } 681 }
682 682
683 void WebLocalFrameImpl::setOpener(WebFrame* opener)
684 {
685 WebFrame::setOpener(opener);
686
687 // TODO(alexmos,dcheng): This should ASSERT(m_frame) once we no longer have
688 // provisional local frames.
689 if (m_frame && m_frame->document())
690 m_frame->document()->initSecurityContext();
691 }
692
693 WebDocument WebLocalFrameImpl::document() const 683 WebDocument WebLocalFrameImpl::document() const
694 { 684 {
695 if (!frame() || !frame()->document()) 685 if (!frame() || !frame()->document())
696 return WebDocument(); 686 return WebDocument();
697 return WebDocument(frame()->document()); 687 return WebDocument(frame()->document());
698 } 688 }
699 689
700 WebPerformance WebLocalFrameImpl::performance() const 690 WebPerformance WebLocalFrameImpl::performance() const
701 { 691 {
702 if (!frame()) 692 if (!frame())
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 WebString WebLocalFrameImpl::layerTreeAsText(bool showDebugInfo) const 1423 WebString WebLocalFrameImpl::layerTreeAsText(bool showDebugInfo) const
1434 { 1424 {
1435 if (!frame()) 1425 if (!frame())
1436 return WebString(); 1426 return WebString();
1437 1427
1438 return WebString(frame()->layerTreeAsText(showDebugInfo ? LayerTreeIncludesD ebugInfo : LayerTreeNormal)); 1428 return WebString(frame()->layerTreeAsText(showDebugInfo ? LayerTreeIncludesD ebugInfo : LayerTreeNormal));
1439 } 1429 }
1440 1430
1441 // WebLocalFrameImpl public ---------------------------------------------------- ----- 1431 // WebLocalFrameImpl public ---------------------------------------------------- -----
1442 1432
1443 WebLocalFrame* WebLocalFrame::create(WebTreeScopeType scope, WebFrameClient* cli ent) 1433 WebLocalFrame* WebLocalFrame::create(WebTreeScopeType scope, WebFrameClient* cli ent, WebFrame* opener)
1444 { 1434 {
1445 return WebLocalFrameImpl::create(scope, client); 1435 return WebLocalFrameImpl::create(scope, client, opener);
1446 } 1436 }
1447 1437
1448 WebLocalFrame* WebLocalFrame::createProvisional(WebFrameClient* client, WebRemot eFrame* oldWebFrame, WebSandboxFlags flags, const WebFrameOwnerProperties& frame OwnerProperties) 1438 WebLocalFrame* WebLocalFrame::createProvisional(WebFrameClient* client, WebRemot eFrame* oldWebFrame, WebSandboxFlags flags, const WebFrameOwnerProperties& frame OwnerProperties)
1449 { 1439 {
1450 return WebLocalFrameImpl::createProvisional(client, oldWebFrame, flags, fram eOwnerProperties); 1440 return WebLocalFrameImpl::createProvisional(client, oldWebFrame, flags, fram eOwnerProperties);
1451 } 1441 }
1452 1442
1453 WebLocalFrameImpl* WebLocalFrameImpl::create(WebTreeScopeType scope, WebFrameCli ent* client) 1443 WebLocalFrameImpl* WebLocalFrameImpl::create(WebTreeScopeType scope, WebFrameCli ent* client, WebFrame* opener)
1454 { 1444 {
1455 WebLocalFrameImpl* frame = new WebLocalFrameImpl(scope, client); 1445 WebLocalFrameImpl* frame = new WebLocalFrameImpl(scope, client);
1446 frame->setOpener(opener);
1456 #if ENABLE(OILPAN) 1447 #if ENABLE(OILPAN)
1457 return frame; 1448 return frame;
1458 #else 1449 #else
1459 return adoptRef(frame).leakRef(); 1450 return adoptRef(frame).leakRef();
1460 #endif 1451 #endif
1461 } 1452 }
1462 1453
1463 WebLocalFrameImpl* WebLocalFrameImpl::createProvisional(WebFrameClient* client, WebRemoteFrame* oldWebFrame, WebSandboxFlags flags, const WebFrameOwnerPropertie s& frameOwnerProperties) 1454 WebLocalFrameImpl* WebLocalFrameImpl::createProvisional(WebFrameClient* client, WebRemoteFrame* oldWebFrame, WebSandboxFlags flags, const WebFrameOwnerPropertie s& frameOwnerProperties)
1464 { 1455 {
1465 RefPtrWillBeRawPtr<WebLocalFrameImpl> webFrame = adoptRefWillBeNoop(new WebL ocalFrameImpl(oldWebFrame, client)); 1456 RefPtrWillBeRawPtr<WebLocalFrameImpl> webFrame = adoptRefWillBeNoop(new WebL ocalFrameImpl(oldWebFrame, client));
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2186 return WebSandboxFlags::None; 2177 return WebSandboxFlags::None;
2187 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2178 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2188 } 2179 }
2189 2180
2190 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2181 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2191 { 2182 {
2192 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2183 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2193 } 2184 }
2194 2185
2195 } // namespace blink 2186 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698