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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 3137c89265b684f69598e0e809d913f3903c6e5a..c7590b0adb7e93173791cc8339f2e887305d3485 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -170,7 +170,6 @@ FrameLoader::FrameLoader(LocalFrame* frame)
, m_inStopAllLoaders(false)
, m_checkTimer(this, &FrameLoader::checkTimerFired)
, m_didAccessInitialDocument(false)
- , m_didAccessInitialDocumentTimer(this, &FrameLoader::didAccessInitialDocumentTimerFired)
, m_forcedSandboxFlags(SandboxNone)
, m_dispatchingDidClearWindowObjectInMainWorld(false)
, m_protectProvisionalLoader(false)
@@ -1061,22 +1060,12 @@ void FrameLoader::didAccessInitialDocument()
// We only need to notify the client once, and only for the main frame.
if (isLoadingMainFrame() && !m_didAccessInitialDocument) {
m_didAccessInitialDocument = true;
- // Notify asynchronously, since this is called within a JavaScript security check.
- m_didAccessInitialDocumentTimer.startOneShot(0, BLINK_FROM_HERE);
- }
-}
-
-void FrameLoader::didAccessInitialDocumentTimerFired(Timer<FrameLoader>*)
-{
- if (client())
- client()->didAccessInitialDocument();
-}
-void FrameLoader::notifyIfInitialDocumentAccessed()
-{
- if (m_didAccessInitialDocumentTimer.isActive()) {
- m_didAccessInitialDocumentTimer.stop();
- didAccessInitialDocumentTimerFired(0);
+ // Forbid script execution to prevent re-entering V8, since this is
+ // called from a binding security check.
+ ScriptForbiddenScope forbidScripts;
+ if (client())
+ client()->didAccessInitialDocument();
}
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698