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

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

Issue 2837593002: Nuked WebFrameImplBase. (Closed)
Patch Set: 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 /* 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
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()), target->GetFrame(),
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
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 = 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
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
1637 void WebLocalFrameImpl::InitializeCoreFrame(Page& page) {
1638 InitializeCoreFrame(page, 0, g_null_atom);
1639 }
1640
1638 void WebLocalFrameImpl::InitializeCoreFrame(Page& page, 1641 void WebLocalFrameImpl::InitializeCoreFrame(Page& page,
1639 FrameOwner* owner, 1642 FrameOwner* owner,
1640 const AtomicString& name) { 1643 const AtomicString& name) {
1641 SetCoreFrame(LocalFrame::Create(local_frame_client_impl_.Get(), page, owner, 1644 SetCoreFrame(LocalFrame::Create(local_frame_client_impl_.Get(), page, owner,
1642 interface_provider_, interface_registry_)); 1645 interface_provider_, interface_registry_));
1643 GetFrame()->Tree().SetName(name); 1646 GetFrame()->Tree().SetName(name);
1644 // We must call init() after m_frame is assigned because it is referenced 1647 // We must call init() after m_frame is assigned because it is referenced
1645 // during init(). Note that this may dispatch JS events; the frame may be 1648 // during init(). Note that this may dispatch JS events; the frame may be
1646 // detached after init() returns. 1649 // detached after init() returns.
1647 GetFrame()->Init(); 1650 GetFrame()->Init();
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
2575 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { 2578 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const {
2576 return *text_checker_client_; 2579 return *text_checker_client_;
2577 } 2580 }
2578 2581
2579 void WebLocalFrameImpl::SetTextCheckClient( 2582 void WebLocalFrameImpl::SetTextCheckClient(
2580 WebTextCheckClient* text_check_client) { 2583 WebTextCheckClient* text_check_client) {
2581 text_check_client_ = text_check_client; 2584 text_check_client_ = text_check_client;
2582 } 2585 }
2583 2586
2584 } // namespace blink 2587 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698