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

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

Issue 640803004: Add a basic DOMWindow base class and use it in WindowProxy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/LocalFrame.h ('k') | Source/core/frame/RemoteFrame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 #endif 215 #endif
216 } 216 }
217 217
218 void LocalFrame::trace(Visitor* visitor) 218 void LocalFrame::trace(Visitor* visitor)
219 { 219 {
220 #if ENABLE(OILPAN) 220 #if ENABLE(OILPAN)
221 visitor->trace(m_destructionObservers); 221 visitor->trace(m_destructionObservers);
222 visitor->trace(m_loader); 222 visitor->trace(m_loader);
223 visitor->trace(m_navigationScheduler); 223 visitor->trace(m_navigationScheduler);
224 visitor->trace(m_view); 224 visitor->trace(m_view);
225 visitor->trace(m_domWindow);
225 visitor->trace(m_pagePopupOwner); 226 visitor->trace(m_pagePopupOwner);
226 visitor->trace(m_script); 227 visitor->trace(m_script);
227 visitor->trace(m_editor); 228 visitor->trace(m_editor);
228 visitor->trace(m_spellChecker); 229 visitor->trace(m_spellChecker);
229 visitor->trace(m_selection); 230 visitor->trace(m_selection);
230 visitor->trace(m_eventHandler); 231 visitor->trace(m_eventHandler);
231 visitor->trace(m_console); 232 visitor->trace(m_console);
232 visitor->trace(m_inputMethodController); 233 visitor->trace(m_inputMethodController);
233 visitor->registerWeakMembers<LocalFrame, &LocalFrame::clearWeakMembers>(this ); 234 visitor->registerWeakMembers<LocalFrame, &LocalFrame::clearWeakMembers>(this );
234 HeapSupplementable<LocalFrame>::trace(visitor); 235 HeapSupplementable<LocalFrame>::trace(visitor);
235 #endif 236 #endif
236 Frame::trace(visitor); 237 Frame::trace(visitor);
237 } 238 }
238 239
240 LocalDOMWindow* LocalFrame::domWindow() const
241 {
242 return m_domWindow.get();
243 }
244
239 void LocalFrame::navigate(Document& originDocument, const KURL& url, bool lockBa ckForwardList) 245 void LocalFrame::navigate(Document& originDocument, const KURL& url, bool lockBa ckForwardList)
240 { 246 {
241 m_navigationScheduler.scheduleLocationChange(&originDocument, url.string(), lockBackForwardList); 247 m_navigationScheduler.scheduleLocationChange(&originDocument, url.string(), lockBackForwardList);
242 } 248 }
243 249
244 void LocalFrame::detach() 250 void LocalFrame::detach()
245 { 251 {
246 // A lot of the following steps can result in the current frame being 252 // A lot of the following steps can result in the current frame being
247 // detached, so protect a reference to it. 253 // detached, so protect a reference to it.
248 RefPtrWillBeRawPtr<LocalFrame> protect(this); 254 RefPtrWillBeRawPtr<LocalFrame> protect(this);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 // Frame::setDOMWindow().) The Member references it clears will now 335 // Frame::setDOMWindow().) The Member references it clears will now
330 // die with the window. And the registered DOMWindowProperty instances th at don't, 336 // die with the window. And the registered DOMWindowProperty instances th at don't,
331 // only keep a weak reference to this frame, so there's no need to be 337 // only keep a weak reference to this frame, so there's no need to be
332 // explicitly notified that this frame is going away. 338 // explicitly notified that this frame is going away.
333 if (m_domWindow && host()) { 339 if (m_domWindow && host()) {
334 host()->consoleMessageStorage().frameWindowDiscarded(m_domWindow.get()); 340 host()->consoleMessageStorage().frameWindowDiscarded(m_domWindow.get());
335 InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get()); 341 InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get());
336 } 342 }
337 if (domWindow) 343 if (domWindow)
338 script().clearWindowProxy(); 344 script().clearWindowProxy();
339 Frame::setDOMWindow(domWindow); 345
346 if (m_domWindow)
347 m_domWindow->reset();
348 m_domWindow = domWindow;
340 } 349 }
341 350
342 Document* LocalFrame::document() const 351 Document* LocalFrame::document() const
343 { 352 {
344 return m_domWindow ? m_domWindow->document() : 0; 353 return m_domWindow ? m_domWindow->document() : 0;
345 } 354 }
346 355
347 void LocalFrame::setPagePopupOwner(Element& owner) 356 void LocalFrame::setPagePopupOwner(Element& owner)
348 { 357 {
349 m_pagePopupOwner = &owner; 358 m_pagePopupOwner = &owner;
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 // We detach the FrameView's custom scroll bars as early as 784 // We detach the FrameView's custom scroll bars as early as
776 // possible to prevent m_doc->detach() from messing with the view 785 // possible to prevent m_doc->detach() from messing with the view
777 // such that its scroll bars won't be torn down. 786 // such that its scroll bars won't be torn down.
778 // 787 //
779 // FIXME: We should revisit this. 788 // FIXME: We should revisit this.
780 if (m_view) 789 if (m_view)
781 m_view->prepareForDetach(); 790 m_view->prepareForDetach();
782 } 791 }
783 792
784 } // namespace blink 793 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.h ('k') | Source/core/frame/RemoteFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698