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

Side by Side Diff: Source/core/page/Page.cpp

Issue 28983004: Split the frame tree logic out of HistoryItem (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved.
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 Page::Page(PageClients& pageClients) 98 Page::Page(PageClients& pageClients)
99 : m_autoscrollController(AutoscrollController::create(*this)) 99 : m_autoscrollController(AutoscrollController::create(*this))
100 , m_chrome(Chrome::create(this, pageClients.chromeClient)) 100 , m_chrome(Chrome::create(this, pageClients.chromeClient))
101 , m_dragCaretController(DragCaretController::create()) 101 , m_dragCaretController(DragCaretController::create())
102 , m_dragController(DragController::create(this, pageClients.dragClient)) 102 , m_dragController(DragController::create(this, pageClients.dragClient))
103 , m_focusController(FocusController::create(this)) 103 , m_focusController(FocusController::create(this))
104 , m_contextMenuController(ContextMenuController::create(this, pageClients.co ntextMenuClient)) 104 , m_contextMenuController(ContextMenuController::create(this, pageClients.co ntextMenuClient))
105 , m_inspectorController(InspectorController::create(this, pageClients.inspec torClient)) 105 , m_inspectorController(InspectorController::create(this, pageClients.inspec torClient))
106 , m_pointerLockController(PointerLockController::create(this)) 106 , m_pointerLockController(PointerLockController::create(this))
107 , m_history(adoptPtr(new HistoryController(this)))
107 , m_settings(Settings::create(this)) 108 , m_settings(Settings::create(this))
108 , m_progress(ProgressTracker::create()) 109 , m_progress(ProgressTracker::create())
109 , m_backForwardClient(pageClients.backForwardClient) 110 , m_backForwardClient(pageClients.backForwardClient)
110 , m_editorClient(pageClients.editorClient) 111 , m_editorClient(pageClients.editorClient)
111 , m_validationMessageClient(0) 112 , m_validationMessageClient(0)
112 , m_sharedWorkerRepositoryClient(0) 113 , m_sharedWorkerRepositoryClient(0)
113 , m_subframeCount(0) 114 , m_subframeCount(0)
114 , m_openedByDOM(false) 115 , m_openedByDOM(false)
115 , m_tabKeyCyclesThroughElements(true) 116 , m_tabKeyCyclesThroughElements(true)
116 , m_defersLoading(false) 117 , m_defersLoading(false)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 bool Page::openedByDOM() const 216 bool Page::openedByDOM() const
216 { 217 {
217 return m_openedByDOM; 218 return m_openedByDOM;
218 } 219 }
219 220
220 void Page::setOpenedByDOM() 221 void Page::setOpenedByDOM()
221 { 222 {
222 m_openedByDOM = true; 223 m_openedByDOM = true;
223 } 224 }
224 225
225 void Page::goToItem(HistoryItem* item)
226 {
227 // stopAllLoaders may end up running onload handlers, which could cause furt her history traversals that may lead to the passed in HistoryItem
228 // being deref()-ed. Make sure we can still use it with HistoryController::g oToItem later.
229 RefPtr<HistoryItem> protector(item);
230
231 if (m_mainFrame->loader().history()->shouldStopLoadingForHistoryItem(item))
232 m_mainFrame->loader().stopAllLoaders();
233
234 m_mainFrame->loader().history()->goToItem(item);
235 }
236
237 void Page::clearPageGroup() 226 void Page::clearPageGroup()
238 { 227 {
239 if (!m_group) 228 if (!m_group)
240 return; 229 return;
241 m_group->removePage(this); 230 m_group->removePage(this);
242 m_group = 0; 231 m_group = 0;
243 } 232 }
244 233
245 void Page::setGroupType(PageGroupType type) 234 void Page::setGroupType(PageGroupType type)
246 { 235 {
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 , inspectorClient(0) 546 , inspectorClient(0)
558 , backForwardClient(0) 547 , backForwardClient(0)
559 { 548 {
560 } 549 }
561 550
562 Page::PageClients::~PageClients() 551 Page::PageClients::~PageClients()
563 { 552 {
564 } 553 }
565 554
566 } // namespace WebCore 555 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698