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

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

Issue 2186863002: FrameLoader: add and export isReloadLoadType() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 m_navigationScheduler->scheduleLocationChange(&originDocument, url.getString (), replaceCurrentItem); 349 m_navigationScheduler->scheduleLocationChange(&originDocument, url.getString (), replaceCurrentItem);
350 } 350 }
351 351
352 void LocalFrame::navigate(const FrameLoadRequest& request) 352 void LocalFrame::navigate(const FrameLoadRequest& request)
353 { 353 {
354 m_loader.load(request); 354 m_loader.load(request);
355 } 355 }
356 356
357 void LocalFrame::reload(FrameLoadType loadType, ClientRedirectPolicy clientRedir ectPolicy) 357 void LocalFrame::reload(FrameLoadType loadType, ClientRedirectPolicy clientRedir ectPolicy)
358 { 358 {
359 ASSERT(loadType == FrameLoadTypeReload || loadType == FrameLoadTypeReloadByp assingCache); 359 DCHECK(isReloadLoadType(loadType));
Takashi Toyoshima 2016/07/27 10:26:48 This isn't mechanical change, but this should allo
360 ASSERT(clientRedirectPolicy == ClientRedirectPolicy::NotClientRedirect || lo adType == FrameLoadTypeReload);
361 if (clientRedirectPolicy == ClientRedirectPolicy::NotClientRedirect) { 360 if (clientRedirectPolicy == ClientRedirectPolicy::NotClientRedirect) {
362 if (!m_loader.currentItem()) 361 if (!m_loader.currentItem())
363 return; 362 return;
364 FrameLoadRequest request = FrameLoadRequest( 363 FrameLoadRequest request = FrameLoadRequest(
365 nullptr, m_loader.resourceRequestForReload(loadType, KURL(), clientR edirectPolicy)); 364 nullptr, m_loader.resourceRequestForReload(loadType, KURL(), clientR edirectPolicy));
366 request.setClientRedirect(clientRedirectPolicy); 365 request.setClientRedirect(clientRedirectPolicy);
367 m_loader.load(request, loadType); 366 m_loader.load(request, loadType);
368 } else { 367 } else {
368 DCHECK(loadType == FrameLoadTypeReload);
Takashi Toyoshima 2016/07/27 10:26:48 For me, this DCHECK is easier to understand the in
369 m_navigationScheduler->scheduleReload(); 369 m_navigationScheduler->scheduleReload();
370 } 370 }
371 } 371 }
372 372
373 void LocalFrame::detach(FrameDetachType type) 373 void LocalFrame::detach(FrameDetachType type)
374 { 374 {
375 PluginScriptForbiddenScope forbidPluginDestructorScripting; 375 PluginScriptForbiddenScope forbidPluginDestructorScripting;
376 m_loader.stopAllLoaders(); 376 m_loader.stopAllLoaders();
377 // Don't allow any new child frames to load in this frame: attaching a new 377 // Don't allow any new child frames to load in this frame: attaching a new
378 // child frame during or after detaching children results in an attached 378 // child frame during or after detaching children results in an attached
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 m_frame->client()->frameBlameContext()->Enter(); 870 m_frame->client()->frameBlameContext()->Enter();
871 } 871 }
872 872
873 ScopedFrameBlamer::~ScopedFrameBlamer() 873 ScopedFrameBlamer::~ScopedFrameBlamer()
874 { 874 {
875 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 875 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
876 m_frame->client()->frameBlameContext()->Leave(); 876 m_frame->client()->frameBlameContext()->Leave();
877 } 877 }
878 878
879 } // namespace blink 879 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698