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

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, 2 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 | 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 Page::Page(PageClients& pageClients) 93 Page::Page(PageClients& pageClients)
94 : m_autoscrollController(AutoscrollController::create()) 94 : m_autoscrollController(AutoscrollController::create())
95 , m_chrome(Chrome::create(this, pageClients.chromeClient)) 95 , m_chrome(Chrome::create(this, pageClients.chromeClient))
96 , m_dragCaretController(DragCaretController::create()) 96 , m_dragCaretController(DragCaretController::create())
97 , m_dragController(DragController::create(this, pageClients.dragClient)) 97 , m_dragController(DragController::create(this, pageClients.dragClient))
98 , m_focusController(FocusController::create(this)) 98 , m_focusController(FocusController::create(this))
99 , m_contextMenuController(ContextMenuController::create(this, pageClients.co ntextMenuClient)) 99 , m_contextMenuController(ContextMenuController::create(this, pageClients.co ntextMenuClient))
100 , m_inspectorController(InspectorController::create(this, pageClients.inspec torClient)) 100 , m_inspectorController(InspectorController::create(this, pageClients.inspec torClient))
101 , m_pointerLockController(PointerLockController::create(this)) 101 , m_pointerLockController(PointerLockController::create(this))
102 , m_history(adoptPtr(new HistoryController(this)))
102 , m_settings(Settings::create(this)) 103 , m_settings(Settings::create(this))
103 , m_progress(ProgressTracker::create()) 104 , m_progress(ProgressTracker::create())
104 , m_backForwardClient(pageClients.backForwardClient) 105 , m_backForwardClient(pageClients.backForwardClient)
105 , m_editorClient(pageClients.editorClient) 106 , m_editorClient(pageClients.editorClient)
106 , m_validationMessageClient(0) 107 , m_validationMessageClient(0)
107 , m_subframeCount(0) 108 , m_subframeCount(0)
108 , m_openedByDOM(false) 109 , m_openedByDOM(false)
109 , m_tabKeyCyclesThroughElements(true) 110 , m_tabKeyCyclesThroughElements(true)
110 , m_defersLoading(false) 111 , m_defersLoading(false)
111 , m_pageScaleFactor(1) 112 , m_pageScaleFactor(1)
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 return m_openedByDOM; 267 return m_openedByDOM;
267 } 268 }
268 269
269 void Page::setOpenedByDOM() 270 void Page::setOpenedByDOM()
270 { 271 {
271 m_openedByDOM = true; 272 m_openedByDOM = true;
272 } 273 }
273 274
274 void Page::goToItem(HistoryItem* item) 275 void Page::goToItem(HistoryItem* item)
275 { 276 {
276 // stopAllLoaders may end up running onload handlers, which could cause furt her history traversals that may lead to the passed in HistoryItem
277 // being deref()-ed. Make sure we can still use it with HistoryController::g oToItem later.
278 RefPtr<HistoryItem> protector(item);
279
280 if (m_mainFrame->loader()->history()->shouldStopLoadingForHistoryItem(item))
281 m_mainFrame->loader()->stopAllLoaders();
282
283 m_mainFrame->loader()->history()->goToItem(item); 277 m_mainFrame->loader()->history()->goToItem(item);
284 } 278 }
285 279
286 void Page::clearPageGroup() 280 void Page::clearPageGroup()
287 { 281 {
288 if (!m_group) 282 if (!m_group)
289 return; 283 return;
290 m_group->removePage(this); 284 m_group->removePage(this);
291 m_group = 0; 285 m_group = 0;
292 } 286 }
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 , inspectorClient(0) 603 , inspectorClient(0)
610 , backForwardClient(0) 604 , backForwardClient(0)
611 { 605 {
612 } 606 }
613 607
614 Page::PageClients::~PageClients() 608 Page::PageClients::~PageClients()
615 { 609 {
616 } 610 }
617 611
618 } // namespace WebCore 612 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698