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

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

Issue 2811793005: Rename LocalFrame::Script() to GetScriptController() (Closed)
Patch Set: Created 3 years, 8 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // (DocumentLoader::ensureWriter().) 322 // (DocumentLoader::ensureWriter().)
323 if (state_machine_.CreatingInitialEmptyDocument()) 323 if (state_machine_.CreatingInitialEmptyDocument())
324 return; 324 return;
325 325
326 frame_->GetEditor().Clear(); 326 frame_->GetEditor().Clear();
327 frame_->GetDocument()->RemoveFocusedElementOfSubtree(frame_->GetDocument()); 327 frame_->GetDocument()->RemoveFocusedElementOfSubtree(frame_->GetDocument());
328 frame_->GetEventHandler().Clear(); 328 frame_->GetEventHandler().Clear();
329 if (frame_->View()) 329 if (frame_->View())
330 frame_->View()->Clear(); 330 frame_->View()->Clear();
331 331
332 frame_->Script().EnableEval(); 332 frame_->GetScriptController().EnableEval();
333 333
334 frame_->GetNavigationScheduler().Cancel(); 334 frame_->GetNavigationScheduler().Cancel();
335 335
336 check_timer_.Stop(); 336 check_timer_.Stop();
337 337
338 if (state_machine_.IsDisplayingInitialEmptyDocument()) 338 if (state_machine_.IsDisplayingInitialEmptyDocument())
339 state_machine_.AdvanceTo(FrameLoaderStateMachine::kCommittedFirstRealLoad); 339 state_machine_.AdvanceTo(FrameLoaderStateMachine::kCommittedFirstRealLoad);
340 340
341 TakeObjectSnapshot(); 341 TakeObjectSnapshot();
342 } 342 }
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 return kFrameLoadTypeStandard; 733 return kFrameLoadTypeStandard;
734 } 734 }
735 735
736 bool FrameLoader::PrepareRequestForThisFrame(FrameLoadRequest& request) { 736 bool FrameLoader::PrepareRequestForThisFrame(FrameLoadRequest& request) {
737 // If no origin Document* was specified, skip remaining security checks and 737 // If no origin Document* was specified, skip remaining security checks and
738 // assume the caller has fully initialized the FrameLoadRequest. 738 // assume the caller has fully initialized the FrameLoadRequest.
739 if (!request.OriginDocument()) 739 if (!request.OriginDocument())
740 return true; 740 return true;
741 741
742 KURL url = request.GetResourceRequest().Url(); 742 KURL url = request.GetResourceRequest().Url();
743 if (frame_->Script().ExecuteScriptIfJavaScriptURL(url, nullptr)) 743 if (frame_->GetScriptController().ExecuteScriptIfJavaScriptURL(url, nullptr))
744 return false; 744 return false;
745 745
746 if (!request.OriginDocument()->GetSecurityOrigin()->CanDisplay(url)) { 746 if (!request.OriginDocument()->GetSecurityOrigin()->CanDisplay(url)) {
747 ReportLocalLoadFailed(frame_, url.ElidedString()); 747 ReportLocalLoadFailed(frame_, url.ElidedString());
748 return false; 748 return false;
749 } 749 }
750 750
751 if (!request.Form() && request.FrameName().IsEmpty()) 751 if (!request.Form() && request.FrameName().IsEmpty())
752 request.SetFrameName(frame_->GetDocument()->BaseTarget()); 752 request.SetFrameName(frame_->GetDocument()->BaseTarget());
753 return true; 753 return true;
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 void FrameLoader::DispatchDidClearDocumentOfWindowObject() { 1594 void FrameLoader::DispatchDidClearDocumentOfWindowObject() {
1595 DCHECK(frame_->GetDocument()); 1595 DCHECK(frame_->GetDocument());
1596 if (state_machine_.CreatingInitialEmptyDocument()) 1596 if (state_machine_.CreatingInitialEmptyDocument())
1597 return; 1597 return;
1598 if (!frame_->GetDocument()->CanExecuteScripts(kNotAboutToExecuteScript)) 1598 if (!frame_->GetDocument()->CanExecuteScripts(kNotAboutToExecuteScript))
1599 return; 1599 return;
1600 1600
1601 Settings* settings = frame_->GetSettings(); 1601 Settings* settings = frame_->GetSettings();
1602 if (settings && settings->GetForceMainWorldInitialization()) { 1602 if (settings && settings->GetForceMainWorldInitialization()) {
1603 // Forcibly instantiate WindowProxy. 1603 // Forcibly instantiate WindowProxy.
1604 frame_->Script().WindowProxy(DOMWrapperWorld::MainWorld()); 1604 frame_->GetScriptController().WindowProxy(DOMWrapperWorld::MainWorld());
1605 } 1605 }
1606 probe::didClearDocumentOfWindowObject(frame_); 1606 probe::didClearDocumentOfWindowObject(frame_);
1607 1607
1608 if (dispatching_did_clear_window_object_in_main_world_) 1608 if (dispatching_did_clear_window_object_in_main_world_)
1609 return; 1609 return;
1610 AutoReset<bool> in_did_clear_window_object( 1610 AutoReset<bool> in_did_clear_window_object(
1611 &dispatching_did_clear_window_object_in_main_world_, true); 1611 &dispatching_did_clear_window_object_in_main_world_, true);
1612 // We just cleared the document, not the entire window object, but for the 1612 // We just cleared the document, not the entire window object, but for the
1613 // embedder that's close enough. 1613 // embedder that's close enough.
1614 Client()->DispatchDidClearWindowObjectInMainWorld(); 1614 Client()->DispatchDidClearWindowObjectInMainWorld();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1774 // TODO(japhet): This is needed because the browser process DCHECKs if the 1774 // TODO(japhet): This is needed because the browser process DCHECKs if the
1775 // first entry we commit in a new frame has replacement set. It's unclear 1775 // first entry we commit in a new frame has replacement set. It's unclear
1776 // whether the DCHECK is right, investigate removing this special case. 1776 // whether the DCHECK is right, investigate removing this special case.
1777 bool replace_current_item = load_type == kFrameLoadTypeReplaceCurrentItem && 1777 bool replace_current_item = load_type == kFrameLoadTypeReplaceCurrentItem &&
1778 (!Opener() || !request.Url().IsEmpty()); 1778 (!Opener() || !request.Url().IsEmpty());
1779 loader->SetReplacesCurrentHistoryItem(replace_current_item); 1779 loader->SetReplacesCurrentHistoryItem(replace_current_item);
1780 return loader; 1780 return loader;
1781 } 1781 }
1782 1782
1783 } // namespace blink 1783 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698