Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
| 6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
| 7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
| 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 9 * rights reserved. | 9 * rights reserved. |
| 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 visitor->trace(m_editor); | 354 visitor->trace(m_editor); |
| 355 visitor->trace(m_spellChecker); | 355 visitor->trace(m_spellChecker); |
| 356 visitor->trace(m_selection); | 356 visitor->trace(m_selection); |
| 357 visitor->trace(m_eventHandler); | 357 visitor->trace(m_eventHandler); |
| 358 visitor->trace(m_console); | 358 visitor->trace(m_console); |
| 359 visitor->trace(m_inputMethodController); | 359 visitor->trace(m_inputMethodController); |
| 360 Frame::trace(visitor); | 360 Frame::trace(visitor); |
| 361 Supplementable<LocalFrame>::trace(visitor); | 361 Supplementable<LocalFrame>::trace(visitor); |
| 362 } | 362 } |
| 363 | 363 |
| 364 WindowProxy* LocalFrame::windowProxy(DOMWrapperWorld& world) { | |
| 365 return m_script->windowProxy(world); | |
| 366 } | |
| 367 | |
| 368 void LocalFrame::navigate(Document& originDocument, | 364 void LocalFrame::navigate(Document& originDocument, |
| 369 const KURL& url, | 365 const KURL& url, |
| 370 bool replaceCurrentItem, | 366 bool replaceCurrentItem, |
| 371 UserGestureStatus userGestureStatus) { | 367 UserGestureStatus userGestureStatus) { |
| 372 m_navigationScheduler->scheduleLocationChange(&originDocument, url, | 368 m_navigationScheduler->scheduleLocationChange(&originDocument, url, |
| 373 replaceCurrentItem); | 369 replaceCurrentItem); |
| 374 } | 370 } |
| 375 | 371 |
| 376 void LocalFrame::navigate(const FrameLoadRequest& request) { | 372 void LocalFrame::navigate(const FrameLoadRequest& request) { |
| 377 m_loader.load(request); | 373 m_loader.load(request); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 document()->url().getString() + "'. " + reason + "\n"; | 482 document()->url().getString() + "'. " + reason + "\n"; |
| 487 | 483 |
| 488 domWindow()->printErrorMessage(message); | 484 domWindow()->printErrorMessage(message); |
| 489 } | 485 } |
| 490 | 486 |
| 491 void LocalFrame::printNavigationWarning(const String& message) { | 487 void LocalFrame::printNavigationWarning(const String& message) { |
| 492 m_console->addMessage( | 488 m_console->addMessage( |
| 493 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); | 489 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); |
| 494 } | 490 } |
| 495 | 491 |
| 496 WindowProxyManagerBase* LocalFrame::getWindowProxyManager() const { | |
| 497 return m_script->getWindowProxyManager(); | |
| 498 } | |
| 499 | |
| 500 bool LocalFrame::shouldClose() { | 492 bool LocalFrame::shouldClose() { |
| 501 // TODO(dcheng): This should be fixed to dispatch beforeunload events to | 493 // TODO(dcheng): This should be fixed to dispatch beforeunload events to |
| 502 // both local and remote frames. | 494 // both local and remote frames. |
| 503 return m_loader.shouldClose(); | 495 return m_loader.shouldClose(); |
| 504 } | 496 } |
| 505 | 497 |
| 506 void LocalFrame::detachChildren() { | 498 void LocalFrame::detachChildren() { |
| 507 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document()); | 499 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document()); |
| 508 | 500 |
| 509 if (Document* document = this->document()) | 501 if (Document* document = this->document()) |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 846 | 838 |
| 847 bool LocalFrame::shouldThrottleRendering() const { | 839 bool LocalFrame::shouldThrottleRendering() const { |
| 848 return view() && view()->shouldThrottleRendering(); | 840 return view() && view()->shouldThrottleRendering(); |
| 849 } | 841 } |
| 850 | 842 |
| 851 inline LocalFrame::LocalFrame(LocalFrameClient* client, | 843 inline LocalFrame::LocalFrame(LocalFrameClient* client, |
| 852 FrameHost* host, | 844 FrameHost* host, |
| 853 FrameOwner* owner, | 845 FrameOwner* owner, |
| 854 InterfaceProvider* interfaceProvider, | 846 InterfaceProvider* interfaceProvider, |
| 855 InterfaceRegistry* interfaceRegistry) | 847 InterfaceRegistry* interfaceRegistry) |
| 856 : Frame(client, host, owner), | 848 : Frame(client, host, owner, LocalWindowProxyManager::create(*this)), |
| 857 m_frameScheduler(page()->chromeClient().createFrameScheduler( | 849 m_frameScheduler(page()->chromeClient().createFrameScheduler( |
| 858 client->frameBlameContext())), | 850 client->frameBlameContext())), |
| 859 m_loader(this), | 851 m_loader(this), |
| 860 m_navigationScheduler(NavigationScheduler::create(this)), | 852 m_navigationScheduler(NavigationScheduler::create(this)), |
| 861 m_script(ScriptController::create(this)), | 853 m_script(ScriptController::create( |
| 854 this, | |
| 855 static_cast<LocalWindowProxyManager*>(getWindowProxyManager()))), | |
|
haraken
2017/03/10 12:44:12
Hmm, it looks a bit redundant that LocalFrame has
Yuki
2017/03/10 15:21:51
ScriptController::ScriptController(LocalFrame& fra
haraken
2017/03/11 19:35:25
It's fine that ScriptController has m_windowProxyM
| |
| 862 m_editor(Editor::create(*this)), | 856 m_editor(Editor::create(*this)), |
| 863 m_spellChecker(SpellChecker::create(*this)), | 857 m_spellChecker(SpellChecker::create(*this)), |
| 864 m_selection(FrameSelection::create(*this)), | 858 m_selection(FrameSelection::create(*this)), |
| 865 m_eventHandler(new EventHandler(*this)), | 859 m_eventHandler(new EventHandler(*this)), |
| 866 m_console(FrameConsole::create(*this)), | 860 m_console(FrameConsole::create(*this)), |
| 867 m_inputMethodController(InputMethodController::create(*this)), | 861 m_inputMethodController(InputMethodController::create(*this)), |
| 868 m_navigationDisableCount(0), | 862 m_navigationDisableCount(0), |
| 869 m_pageZoomFactor(parentPageZoomFactor(this)), | 863 m_pageZoomFactor(parentPageZoomFactor(this)), |
| 870 m_textZoomFactor(parentTextZoomFactor(this)), | 864 m_textZoomFactor(parentTextZoomFactor(this)), |
| 871 m_inViewSourceMode(false), | 865 m_inViewSourceMode(false), |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 916 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 910 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 917 m_frame->client()->frameBlameContext()->Enter(); | 911 m_frame->client()->frameBlameContext()->Enter(); |
| 918 } | 912 } |
| 919 | 913 |
| 920 ScopedFrameBlamer::~ScopedFrameBlamer() { | 914 ScopedFrameBlamer::~ScopedFrameBlamer() { |
| 921 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 915 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 922 m_frame->client()->frameBlameContext()->Leave(); | 916 m_frame->client()->frameBlameContext()->Leave(); |
| 923 } | 917 } |
| 924 | 918 |
| 925 } // namespace blink | 919 } // namespace blink |
| OLD | NEW |