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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2869203002: Cleanup around LocalFrame initialization (Closed)
Patch Set: +test fix Created 3 years, 7 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 92ea7c6200672063607bd4b8fecf85262199fb76..8c407a0b64c10167d7c0f68f688804454bad4ac2 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -263,6 +263,7 @@ DEFINE_TRACE(FrameLoader) {
}
void FrameLoader::Init() {
+ ScriptForbiddenScope forbid_scripts;
ResourceRequest initial_request(KURL(kParsedURLString, g_empty_string));
initial_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
initial_request.SetFrameType(frame_->IsMainFrame()
@@ -275,14 +276,10 @@ void FrameLoader::Init() {
frame_->GetDocument()->CancelParsing();
state_machine_.AdvanceTo(
FrameLoaderStateMachine::kDisplayingInitialEmptyDocument);
- // Suppress finish notifications for inital empty documents, since they don't
+ // Suppress finish notifications for initial empty documents, since they don't
// generate start notifications.
- if (document_loader_)
- document_loader_->SetSentDidFinishLoad();
- // Self-suspend if created in an already suspended Page. Note that both
- // startLoadingMainResource() and cancelParsing() may have already detached
- // the frame, since they both fire JS events.
- if (frame_->GetPage() && frame_->GetPage()->Suspended())
+ document_loader_->SetSentDidFinishLoad();
+ if (frame_->GetPage()->Suspended())
SetDefersLoading(true);
TakeObjectSnapshot();
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698