OLD | NEW |
---|---|
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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
863 } | 863 } |
864 | 864 |
865 v8::Local<v8::Context> WebLocalFrameImpl::MainWorldScriptContext() const { | 865 v8::Local<v8::Context> WebLocalFrameImpl::MainWorldScriptContext() const { |
866 ScriptState* script_state = ToScriptStateForMainWorld(GetFrame()); | 866 ScriptState* script_state = ToScriptStateForMainWorld(GetFrame()); |
867 DCHECK(script_state); | 867 DCHECK(script_state); |
868 return script_state->GetContext(); | 868 return script_state->GetContext(); |
869 } | 869 } |
870 | 870 |
871 bool WebFrame::ScriptCanAccess(WebFrame* target) { | 871 bool WebFrame::ScriptCanAccess(WebFrame* target) { |
872 return BindingSecurity::ShouldAllowAccessToFrame( | 872 return BindingSecurity::ShouldAllowAccessToFrame( |
873 CurrentDOMWindow(MainThreadIsolate()), target->ToImplBase()->GetFrame(), | 873 CurrentDOMWindow(MainThreadIsolate()), WebFrame::CoreFrame(target), |
dcheng
2017/04/26 11:45:34
Is it possible to omit WebFrame:: here?
mustaq
2017/04/26 18:12:48
Done.
| |
874 BindingSecurity::ErrorReportOption::kDoNotReport); | 874 BindingSecurity::ErrorReportOption::kDoNotReport); |
875 } | 875 } |
876 | 876 |
877 void WebLocalFrameImpl::Reload(WebFrameLoadType load_type) { | 877 void WebLocalFrameImpl::Reload(WebFrameLoadType load_type) { |
878 // TODO(clamy): Remove this function once RenderFrame calls load for all | 878 // TODO(clamy): Remove this function once RenderFrame calls load for all |
879 // requests. | 879 // requests. |
880 ReloadWithOverrideURL(KURL(), load_type); | 880 ReloadWithOverrideURL(KURL(), load_type); |
881 } | 881 } |
882 | 882 |
883 void WebLocalFrameImpl::ReloadWithOverrideURL(const WebURL& override_url, | 883 void WebLocalFrameImpl::ReloadWithOverrideURL(const WebURL& override_url, |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1543 | 1543 |
1544 WebLocalFrameImpl* WebLocalFrameImpl::CreateProvisional( | 1544 WebLocalFrameImpl* WebLocalFrameImpl::CreateProvisional( |
1545 WebFrameClient* client, | 1545 WebFrameClient* client, |
1546 blink::InterfaceProvider* interface_provider, | 1546 blink::InterfaceProvider* interface_provider, |
1547 blink::InterfaceRegistry* interface_registry, | 1547 blink::InterfaceRegistry* interface_registry, |
1548 WebRemoteFrame* old_web_frame, | 1548 WebRemoteFrame* old_web_frame, |
1549 WebSandboxFlags flags) { | 1549 WebSandboxFlags flags) { |
1550 DCHECK(client); | 1550 DCHECK(client); |
1551 WebLocalFrameImpl* web_frame = new WebLocalFrameImpl( | 1551 WebLocalFrameImpl* web_frame = new WebLocalFrameImpl( |
1552 old_web_frame, client, interface_provider, interface_registry); | 1552 old_web_frame, client, interface_provider, interface_registry); |
1553 Frame* old_frame = old_web_frame->ToImplBase()->GetFrame(); | 1553 Frame* old_frame = ToWebRemoteFrameImpl(old_web_frame)->GetFrame(); |
1554 web_frame->SetParent(old_web_frame->Parent()); | 1554 web_frame->SetParent(old_web_frame->Parent()); |
1555 web_frame->SetOpener(old_web_frame->Opener()); | 1555 web_frame->SetOpener(old_web_frame->Opener()); |
1556 // Note: this *always* temporarily sets a frame owner, even for main frames! | 1556 // Note: this *always* temporarily sets a frame owner, even for main frames! |
1557 // When a core Frame is created with no owner, it attempts to set itself as | 1557 // When a core Frame is created with no owner, it attempts to set itself as |
1558 // the main frame of the Page. However, this is a provisional frame, and may | 1558 // the main frame of the Page. However, this is a provisional frame, and may |
1559 // disappear, so Page::m_mainFrame can't be updated just yet. | 1559 // disappear, so Page::m_mainFrame can't be updated just yet. |
1560 FrameOwner* temp_owner = DummyFrameOwner::Create(); | 1560 FrameOwner* temp_owner = DummyFrameOwner::Create(); |
1561 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to | 1561 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to |
1562 // reuse it here. | 1562 // reuse it here. |
1563 LocalFrame* frame = LocalFrame::Create( | 1563 LocalFrame* frame = LocalFrame::Create( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1621 | 1621 |
1622 DEFINE_TRACE(WebLocalFrameImpl) { | 1622 DEFINE_TRACE(WebLocalFrameImpl) { |
1623 visitor->Trace(local_frame_client_impl_); | 1623 visitor->Trace(local_frame_client_impl_); |
1624 visitor->Trace(frame_); | 1624 visitor->Trace(frame_); |
1625 visitor->Trace(dev_tools_agent_); | 1625 visitor->Trace(dev_tools_agent_); |
1626 visitor->Trace(text_finder_); | 1626 visitor->Trace(text_finder_); |
1627 visitor->Trace(print_context_); | 1627 visitor->Trace(print_context_); |
1628 visitor->Trace(context_menu_node_); | 1628 visitor->Trace(context_menu_node_); |
1629 visitor->Trace(text_checker_client_); | 1629 visitor->Trace(text_checker_client_); |
1630 WebFrame::TraceFrames(visitor, this); | 1630 WebFrame::TraceFrames(visitor, this); |
1631 WebFrameImplBase::Trace(visitor); | |
1632 } | 1631 } |
1633 | 1632 |
1634 void WebLocalFrameImpl::SetCoreFrame(LocalFrame* frame) { | 1633 void WebLocalFrameImpl::SetCoreFrame(LocalFrame* frame) { |
1635 frame_ = frame; | 1634 frame_ = frame; |
1636 } | 1635 } |
1637 | 1636 |
1638 void WebLocalFrameImpl::InitializeCoreFrame(Page& page, | 1637 void WebLocalFrameImpl::InitializeCoreFrame(Page& page, |
1639 FrameOwner* owner, | 1638 FrameOwner* owner, |
1640 const AtomicString& name) { | 1639 const AtomicString& name) { |
1641 SetCoreFrame(LocalFrame::Create(local_frame_client_impl_.Get(), page, owner, | 1640 SetCoreFrame(LocalFrame::Create(local_frame_client_impl_.Get(), page, owner, |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2575 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { | 2574 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { |
2576 return *text_checker_client_; | 2575 return *text_checker_client_; |
2577 } | 2576 } |
2578 | 2577 |
2579 void WebLocalFrameImpl::SetTextCheckClient( | 2578 void WebLocalFrameImpl::SetTextCheckClient( |
2580 WebTextCheckClient* text_check_client) { | 2579 WebTextCheckClient* text_check_client) { |
2581 text_check_client_ = text_check_client; | 2580 text_check_client_ = text_check_client; |
2582 } | 2581 } |
2583 | 2582 |
2584 } // namespace blink | 2583 } // namespace blink |
OLD | NEW |