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

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

Powered by Google App Engine
This is Rietveld 408576698