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

Side by Side Diff: third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp

Issue 2171063002: Notify the Blink client synchronously if the initial doc is accessed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments. Created 4 years, 5 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, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 18 matching lines...) Expand all
29 #include "wtf/HashSet.h" 29 #include "wtf/HashSet.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 ScopedPageLoadDeferrer::ScopedPageLoadDeferrer(Page* exclusion) 33 ScopedPageLoadDeferrer::ScopedPageLoadDeferrer(Page* exclusion)
34 { 34 {
35 for (Page* page : Page::ordinaryPages()) { 35 for (Page* page : Page::ordinaryPages()) {
36 if (page == exclusion || page->defersLoading()) 36 if (page == exclusion || page->defersLoading())
37 continue; 37 continue;
38 m_deferredPages.append(page); 38 m_deferredPages.append(page);
39
40 // Ensure that we notify the client if the initial empty document is acc essed before
41 // showing anything modal, to prevent spoofs while the modal window or s heet is visible.
42 if (page->mainFrame()->isLocalFrame())
43 page->deprecatedLocalMainFrame()->loader().notifyIfInitialDocumentAc cessed();
44 } 39 }
45 40
46 setDefersLoading(true); 41 setDefersLoading(true);
47 Platform::current()->currentThread()->scheduler()->suspendTimerQueue(); 42 Platform::current()->currentThread()->scheduler()->suspendTimerQueue();
48 } 43 }
49 44
50 ScopedPageLoadDeferrer::~ScopedPageLoadDeferrer() 45 ScopedPageLoadDeferrer::~ScopedPageLoadDeferrer()
51 { 46 {
52 setDefersLoading(false); 47 setDefersLoading(false);
53 Platform::current()->currentThread()->scheduler()->resumeTimerQueue(); 48 Platform::current()->currentThread()->scheduler()->resumeTimerQueue();
54 } 49 }
55 50
56 void ScopedPageLoadDeferrer::setDefersLoading(bool isDeferred) 51 void ScopedPageLoadDeferrer::setDefersLoading(bool isDeferred)
57 { 52 {
58 53
59 for (const auto& page : m_deferredPages) 54 for (const auto& page : m_deferredPages)
60 page->setDefersLoading(isDeferred); 55 page->setDefersLoading(isDeferred);
61 } 56 }
62 57
63 } // namespace blink 58 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698