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

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

Issue 2869203002: Cleanup around LocalFrame initialization (Closed)
Patch Set: Use InitializeCoreFrame() in CreateProvisional() 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } 256 }
257 257
258 DEFINE_TRACE(FrameLoader) { 258 DEFINE_TRACE(FrameLoader) {
259 visitor->Trace(frame_); 259 visitor->Trace(frame_);
260 visitor->Trace(progress_tracker_); 260 visitor->Trace(progress_tracker_);
261 visitor->Trace(document_loader_); 261 visitor->Trace(document_loader_);
262 visitor->Trace(provisional_document_loader_); 262 visitor->Trace(provisional_document_loader_);
263 } 263 }
264 264
265 void FrameLoader::Init() { 265 void FrameLoader::Init() {
266 ScriptForbiddenScope forbid_scripts;
266 ResourceRequest initial_request(KURL(kParsedURLString, g_empty_string)); 267 ResourceRequest initial_request(KURL(kParsedURLString, g_empty_string));
267 initial_request.SetRequestContext(WebURLRequest::kRequestContextInternal); 268 initial_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
268 initial_request.SetFrameType(frame_->IsMainFrame() 269 initial_request.SetFrameType(frame_->IsMainFrame()
269 ? WebURLRequest::kFrameTypeTopLevel 270 ? WebURLRequest::kFrameTypeTopLevel
270 : WebURLRequest::kFrameTypeNested); 271 : WebURLRequest::kFrameTypeNested);
271 provisional_document_loader_ = 272 provisional_document_loader_ =
272 Client()->CreateDocumentLoader(frame_, initial_request, SubstituteData(), 273 Client()->CreateDocumentLoader(frame_, initial_request, SubstituteData(),
273 ClientRedirectPolicy::kNotClientRedirect); 274 ClientRedirectPolicy::kNotClientRedirect);
274 provisional_document_loader_->StartLoadingMainResource(); 275 provisional_document_loader_->StartLoadingMainResource();
275 frame_->GetDocument()->CancelParsing(); 276 frame_->GetDocument()->CancelParsing();
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 // TODO(japhet): This is needed because the browser process DCHECKs if the 1745 // TODO(japhet): This is needed because the browser process DCHECKs if the
1745 // first entry we commit in a new frame has replacement set. It's unclear 1746 // first entry we commit in a new frame has replacement set. It's unclear
1746 // whether the DCHECK is right, investigate removing this special case. 1747 // whether the DCHECK is right, investigate removing this special case.
1747 bool replace_current_item = load_type == kFrameLoadTypeReplaceCurrentItem && 1748 bool replace_current_item = load_type == kFrameLoadTypeReplaceCurrentItem &&
1748 (!Opener() || !request.Url().IsEmpty()); 1749 (!Opener() || !request.Url().IsEmpty());
1749 loader->SetReplacesCurrentHistoryItem(replace_current_item); 1750 loader->SetReplacesCurrentHistoryItem(replace_current_item);
1750 return loader; 1751 return loader;
1751 } 1752 }
1752 1753
1753 } // namespace blink 1754 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698