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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2862293002: Finish removing FrameLoader::Clear() (Closed)
Patch Set: Rebase Created 3 years, 6 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 for (auto& initilization_callback : GetInitializationVector()) { 284 for (auto& initilization_callback : GetInitializationVector()) {
285 initilization_callback(this); 285 initilization_callback(this);
286 } 286 }
287 287
288 loader_.Init(); 288 loader_.Init();
289 } 289 }
290 290
291 void LocalFrame::SetView(FrameView* view) { 291 void LocalFrame::SetView(FrameView* view) {
292 DCHECK(!view_ || view_ != view); 292 DCHECK(!view_ || view_ != view);
293 DCHECK(!GetDocument() || !GetDocument()->IsActive()); 293 DCHECK(!GetDocument() || !GetDocument()->IsActive());
294
295 GetEventHandler().Clear();
296
297 view_ = view; 294 view_ = view;
298 } 295 }
299 296
300 void LocalFrame::CreateView(const IntSize& viewport_size, 297 void LocalFrame::CreateView(const IntSize& viewport_size,
301 const Color& background_color, 298 const Color& background_color,
302 ScrollbarMode horizontal_scrollbar_mode, 299 ScrollbarMode horizontal_scrollbar_mode,
303 bool horizontal_lock, 300 bool horizontal_lock,
304 ScrollbarMode vertical_scrollbar_mode, 301 ScrollbarMode vertical_scrollbar_mode,
305 bool vertical_lock) { 302 bool vertical_lock) {
306 DCHECK(this); 303 DCHECK(this);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 // detachChildren() will trigger the unload event handlers of any child 430 // detachChildren() will trigger the unload event handlers of any child
434 // frames, and those event handlers might start a new subresource load in this 431 // frames, and those event handlers might start a new subresource load in this
435 // frame. 432 // frame.
436 loader_.StopAllLoaders(); 433 loader_.StopAllLoaders();
437 loader_.Detach(); 434 loader_.Detach();
438 GetDocument()->Shutdown(); 435 GetDocument()->Shutdown();
439 // This is the earliest that scripting can be disabled: 436 // This is the earliest that scripting can be disabled:
440 // - FrameLoader::detach() can fire XHR abort events 437 // - FrameLoader::detach() can fire XHR abort events
441 // - Document::shutdown()'s deferred widget updates can run script. 438 // - Document::shutdown()'s deferred widget updates can run script.
442 ScriptForbiddenScope forbid_script; 439 ScriptForbiddenScope forbid_script;
443 loader_.Clear();
444 if (!Client()) 440 if (!Client())
445 return; 441 return;
446 442
447 Client()->WillBeDetached(); 443 Client()->WillBeDetached();
448 // Notify ScriptController that the frame is closing, since its cleanup ends 444 // Notify ScriptController that the frame is closing, since its cleanup ends
449 // up calling back to LocalFrameClient via WindowProxy. 445 // up calling back to LocalFrameClient via WindowProxy.
450 GetScriptController().ClearForClose(); 446 GetScriptController().ClearForClose();
451 SetView(nullptr); 447 SetView(nullptr);
452 448
453 page_->GetEventHandlerRegistry().DidRemoveAllEventHandlers(*DomWindow()); 449 page_->GetEventHandlerRegistry().DidRemoveAllEventHandlers(*DomWindow());
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 void LocalFrame::DetachChildren() { 513 void LocalFrame::DetachChildren() {
518 DCHECK(loader_.StateMachine()->CreatingInitialEmptyDocument() || 514 DCHECK(loader_.StateMachine()->CreatingInitialEmptyDocument() ||
519 GetDocument()); 515 GetDocument());
520 516
521 if (Document* document = this->GetDocument()) 517 if (Document* document = this->GetDocument())
522 ChildFrameDisconnector(*document).Disconnect(); 518 ChildFrameDisconnector(*document).Disconnect();
523 } 519 }
524 520
525 void LocalFrame::DocumentAttached() { 521 void LocalFrame::DocumentAttached() {
526 DCHECK(GetDocument()); 522 DCHECK(GetDocument());
523 GetEditor().Clear();
524 GetEventHandler().Clear();
527 Selection().DocumentAttached(GetDocument()); 525 Selection().DocumentAttached(GetDocument());
528 GetInputMethodController().DocumentAttached(GetDocument()); 526 GetInputMethodController().DocumentAttached(GetDocument());
529 GetSpellChecker().DocumentAttached(GetDocument()); 527 GetSpellChecker().DocumentAttached(GetDocument());
530 if (IsMainFrame()) 528 if (IsMainFrame())
531 has_received_user_gesture_ = false; 529 has_received_user_gesture_ = false;
532 } 530 }
533 531
534 LocalWindowProxy* LocalFrame::WindowProxy(DOMWrapperWorld& world) { 532 LocalWindowProxy* LocalFrame::WindowProxy(DOMWrapperWorld& world) {
535 return ToLocalWindowProxy(Frame::GetWindowProxy(world)); 533 return ToLocalWindowProxy(Frame::GetWindowProxy(world));
536 } 534 }
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 WebURLRequest::kClientLoFiOn); 966 WebURLRequest::kClientLoFiOn);
969 params.SetAllowImagePlaceholder(); 967 params.SetAllowImagePlaceholder();
970 } 968 }
971 } 969 }
972 970
973 std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() { 971 std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() {
974 return Client()->CreateURLLoader(); 972 return Client()->CreateURLLoader();
975 } 973 }
976 974
977 } // namespace blink 975 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698