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

Side by Side Diff: Source/core/frame/LocalFrame.cpp

Issue 1156473002: Refactor FrameLoader loading interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comments Created 5 years, 6 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
OLDNEW
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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 request.resourceRequest().setHasUserGesture(userGestureStatus == UserGes tureStatus::Active); 248 request.resourceRequest().setHasUserGesture(userGestureStatus == UserGes tureStatus::Active);
249 m_loader.load(request); 249 m_loader.load(request);
250 } else { 250 } else {
251 m_navigationScheduler.scheduleLocationChange(&originDocument, url.string (), lockBackForwardList); 251 m_navigationScheduler.scheduleLocationChange(&originDocument, url.string (), lockBackForwardList);
252 } 252 }
253 } 253 }
254 254
255 void LocalFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientRe directPolicy) 255 void LocalFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientRe directPolicy)
256 { 256 {
257 ASSERT(clientRedirectPolicy == NotClientRedirect || reloadPolicy == NormalRe load); 257 ASSERT(clientRedirectPolicy == NotClientRedirect || reloadPolicy == NormalRe load);
258 if (clientRedirectPolicy == NotClientRedirect) 258 if (clientRedirectPolicy == NotClientRedirect) {
259 m_loader.reload(reloadPolicy); 259 if (!m_loader.currentItem())
260 else 260 return;
261 FrameLoadType loadType = reloadPolicy == NormalReload ?
262 FrameLoadTypeReload : FrameLoadTypeReloadFromOrigin;
263 FrameLoadRequest request = FrameLoader::frameRequestForReload(
264 m_loader.resourceRequestForReload(*this, loadType, KURL(), clientRed irectPolicy),
265 clientRedirectPolicy);
266 m_loader.load(request, loadType);
267 } else {
261 m_navigationScheduler.scheduleReload(); 268 m_navigationScheduler.scheduleReload();
269 }
262 } 270 }
263 271
264 void LocalFrame::detach() 272 void LocalFrame::detach()
265 { 273 {
266 // A lot of the following steps can result in the current frame being 274 // A lot of the following steps can result in the current frame being
267 // detached, so protect a reference to it. 275 // detached, so protect a reference to it.
268 RefPtrWillBeRawPtr<LocalFrame> protect(this); 276 RefPtrWillBeRawPtr<LocalFrame> protect(this);
269 m_loader.stopAllLoaders(); 277 m_loader.stopAllLoaders();
270 m_loader.dispatchUnloadEvent(); 278 m_loader.dispatchUnloadEvent();
271 detachChildren(); 279 detachChildren();
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 , m_textZoomFactor(parentTextZoomFactor(this)) 821 , m_textZoomFactor(parentTextZoomFactor(this))
814 , m_inViewSourceMode(false) 822 , m_inViewSourceMode(false)
815 { 823 {
816 if (isLocalRoot()) 824 if (isLocalRoot())
817 m_instrumentingAgents = InstrumentingAgents::create(); 825 m_instrumentingAgents = InstrumentingAgents::create();
818 else 826 else
819 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; 827 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents;
820 } 828 }
821 829
822 } // namespace blink 830 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorResourceContentLoader.cpp » ('j') | Source/core/loader/FrameLoader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698