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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2206843003: Disable navigations in the unload handler. (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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 m_currentItem->setVisualViewportScrollPoint(m_frame->host()->visualViewport( ).visibleRect().location()); 257 m_currentItem->setVisualViewportScrollPoint(m_frame->host()->visualViewport( ).visibleRect().location());
258 258
259 if (m_frame->isMainFrame()) 259 if (m_frame->isMainFrame())
260 m_currentItem->setPageScaleFactor(m_frame->page()->pageScaleFactor()); 260 m_currentItem->setPageScaleFactor(m_frame->page()->pageScaleFactor());
261 261
262 client()->didUpdateCurrentHistoryItem(); 262 client()->didUpdateCurrentHistoryItem();
263 } 263 }
264 264
265 void FrameLoader::dispatchUnloadEvent() 265 void FrameLoader::dispatchUnloadEvent()
266 { 266 {
267 NavigationCounterForUnload counter; 267 NavigationDisablerForUnload counter;
268 268
269 // If the frame is unloading, the provisional loader should no longer be 269 // If the frame is unloading, the provisional loader should no longer be
270 // protected. It will be detached soon. 270 // protected. It will be detached soon.
271 m_protectProvisionalLoader = false; 271 m_protectProvisionalLoader = false;
272 saveScrollState(); 272 saveScrollState();
273 273
274 if (m_frame->document() && !SVGImage::isInSVGImage(m_frame->document())) 274 if (m_frame->document() && !SVGImage::isInSVGImage(m_frame->document()))
275 m_frame->document()->dispatchUnloadEvents(); 275 m_frame->document()->dispatchUnloadEvents();
276 } 276 }
277 277
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String()); 1614 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String());
1615 return tracedValue; 1615 return tracedValue;
1616 } 1616 }
1617 1617
1618 inline void FrameLoader::takeObjectSnapshot() const 1618 inline void FrameLoader::takeObjectSnapshot() const
1619 { 1619 {
1620 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value()); 1620 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value());
1621 } 1621 }
1622 1622
1623 } // namespace blink 1623 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698