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 r ights reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. |
| 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 * You should have received a copy of the GNU Library General Public License | 24 * You should have received a copy of the GNU Library General Public License |
| 25 * along with this library; see the file COPYING.LIB. If not, write to | 25 * along with this library; see the file COPYING.LIB. If not, write to |
| 26 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 26 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 27 * Boston, MA 02110-1301, USA. | 27 * Boston, MA 02110-1301, USA. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "core/frame/LocalFrame.h" | 30 #include "core/frame/LocalFrame.h" |
| 31 | 31 |
| 32 #include "bindings/core/v8/ScriptController.h" | 32 #include "bindings/core/v8/ScriptController.h" |
| 33 #include "core/InstrumentingAgents.h" | 33 #include "core/InstrumentingAgents.h" |
| 34 #include "core/dom/ChildFrameDisconnector.h" | |
| 34 #include "core/dom/DocumentType.h" | 35 #include "core/dom/DocumentType.h" |
| 35 #include "core/dom/StyleChangeReason.h" | 36 #include "core/dom/StyleChangeReason.h" |
| 36 #include "core/editing/EditingUtilities.h" | 37 #include "core/editing/EditingUtilities.h" |
| 37 #include "core/editing/Editor.h" | 38 #include "core/editing/Editor.h" |
| 38 #include "core/editing/FrameSelection.h" | 39 #include "core/editing/FrameSelection.h" |
| 39 #include "core/editing/InputMethodController.h" | 40 #include "core/editing/InputMethodController.h" |
| 40 #include "core/editing/serializers/Serialization.h" | 41 #include "core/editing/serializers/Serialization.h" |
| 41 #include "core/editing/spellcheck/SpellChecker.h" | 42 #include "core/editing/spellcheck/SpellChecker.h" |
| 42 #include "core/events/Event.h" | 43 #include "core/events/Event.h" |
| 43 #include "core/fetch/ResourceFetcher.h" | 44 #include "core/fetch/ResourceFetcher.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 440 return m_script->getWindowProxyManager(); | 441 return m_script->getWindowProxyManager(); |
| 441 } | 442 } |
| 442 | 443 |
| 443 bool LocalFrame::shouldClose() | 444 bool LocalFrame::shouldClose() |
| 444 { | 445 { |
| 445 // TODO(dcheng): This should be fixed to dispatch beforeunload events to | 446 // TODO(dcheng): This should be fixed to dispatch beforeunload events to |
| 446 // both local and remote frames. | 447 // both local and remote frames. |
| 447 return m_loader.shouldClose(); | 448 return m_loader.shouldClose(); |
| 448 } | 449 } |
| 449 | 450 |
| 451 void LocalFrame::detachChildren() | |
| 452 { | |
| 453 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document() ); | |
| 454 | |
| 455 if (document()) | |
|
esprehn
2016/07/13 02:35:45
if (Document* document = this->document())
avoids
dcheng
2016/07/13 02:51:34
Done.
| |
| 456 ChildFrameDisconnector(*document()).disconnect(); | |
| 457 } | |
| 458 | |
| 450 void LocalFrame::willDetachFrameHost() | 459 void LocalFrame::willDetachFrameHost() |
| 451 { | 460 { |
| 452 LocalFrameLifecycleNotifier::notifyWillDetachFrameHost(); | 461 LocalFrameLifecycleNotifier::notifyWillDetachFrameHost(); |
| 453 | 462 |
| 454 // FIXME: Page should take care of updating focus/scrolling instead of Frame . | 463 // FIXME: Page should take care of updating focus/scrolling instead of Frame . |
| 455 // FIXME: It's unclear as to why this is called more than once, but it is, | 464 // FIXME: It's unclear as to why this is called more than once, but it is, |
| 456 // so page() could be null. | 465 // so page() could be null. |
| 457 if (page() && page()->focusController().focusedFrame() == this) | 466 if (page() && page()->focusController().focusedFrame() == this) |
| 458 page()->focusController().setFocusedFrame(nullptr); | 467 page()->focusController().setFocusedFrame(nullptr); |
| 459 | 468 |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 866 m_frame->client()->frameBlameContext()->Enter(); | 875 m_frame->client()->frameBlameContext()->Enter(); |
| 867 } | 876 } |
| 868 | 877 |
| 869 ScopedFrameBlamer::~ScopedFrameBlamer() | 878 ScopedFrameBlamer::~ScopedFrameBlamer() |
| 870 { | 879 { |
| 871 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 880 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 872 m_frame->client()->frameBlameContext()->Leave(); | 881 m_frame->client()->frameBlameContext()->Leave(); |
| 873 } | 882 } |
| 874 | 883 |
| 875 } // namespace blink | 884 } // namespace blink |
| OLD | NEW |