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

Side by Side Diff: Source/core/frame/Frame.h

Issue 1041473002: Detach old frame on WebFrame::swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | Source/core/frame/Frame.cpp » ('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-2001 Lars Knoll <knoll@kde.org> 3 * 1999-2001 Lars Knoll <knoll@kde.org>
4 * 1999-2001 Antti Koivisto <koivisto@kde.org> 4 * 1999-2001 Antti Koivisto <koivisto@kde.org>
5 * 2000-2001 Simon Hausmann <hausmann@kde.org> 5 * 2000-2001 Simon Hausmann <hausmann@kde.org>
6 * 2000-2001 Dirk Mueller <mueller@kde.org> 6 * 2000-2001 Dirk Mueller <mueller@kde.org>
7 * 2000 Stefan Schimanski <1Stein@gmx.de> 7 * 2000 Stefan Schimanski <1Stein@gmx.de>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class HTMLFrameOwnerElement; 48 class HTMLFrameOwnerElement;
49 class LayoutPart; 49 class LayoutPart;
50 class KURL; 50 class KURL;
51 class Page; 51 class Page;
52 class SecurityContext; 52 class SecurityContext;
53 class Settings; 53 class Settings;
54 class WindowProxy; 54 class WindowProxy;
55 class WindowProxyManager; 55 class WindowProxyManager;
56 struct FrameLoadRequest; 56 struct FrameLoadRequest;
57 57
58 enum class FrameDetachType { Remove, Swap };
59
58 // Status of user gesture. 60 // Status of user gesture.
59 enum class UserGestureStatus { Active, None }; 61 enum class UserGestureStatus { Active, None };
60 62
61 class CORE_EXPORT Frame : public RefCountedWillBeGarbageCollectedFinalized<Frame > { 63 class CORE_EXPORT Frame : public RefCountedWillBeGarbageCollectedFinalized<Frame > {
62 public: 64 public:
63 virtual ~Frame(); 65 virtual ~Frame();
64 66
65 DECLARE_VIRTUAL_TRACE(); 67 DECLARE_VIRTUAL_TRACE();
66 68
67 virtual bool isLocalFrame() const { return false; } 69 virtual bool isLocalFrame() const { return false; }
68 virtual bool isRemoteFrame() const { return false; } 70 virtual bool isRemoteFrame() const { return false; }
69 71
70 virtual DOMWindow* domWindow() const = 0; 72 virtual DOMWindow* domWindow() const = 0;
71 virtual WindowProxy* windowProxy(DOMWrapperWorld&) = 0; 73 virtual WindowProxy* windowProxy(DOMWrapperWorld&) = 0;
72 74
73 virtual void navigate(Document& originDocument, const KURL&, bool lockBackFo rwardList, UserGestureStatus) = 0; 75 virtual void navigate(Document& originDocument, const KURL&, bool lockBackFo rwardList, UserGestureStatus) = 0;
74 // This version of Frame::navigate assumes the resulting navigation is not 76 // This version of Frame::navigate assumes the resulting navigation is not
75 // to be started on a timer. Use the method above in such cases. 77 // to be started on a timer. Use the method above in such cases.
76 virtual void navigate(const FrameLoadRequest&) = 0; 78 virtual void navigate(const FrameLoadRequest&) = 0;
77 virtual void reload(FrameLoadType, ClientRedirectPolicy) = 0; 79 virtual void reload(FrameLoadType, ClientRedirectPolicy) = 0;
78 80
79 virtual void detach(); 81 virtual void detach(FrameDetachType);
80 void detachChildren(); 82 void detachChildren();
81 virtual void disconnectOwnerElement(); 83 virtual void disconnectOwnerElement();
82 84
83 FrameClient* client() const; 85 FrameClient* client() const;
84 86
85 // NOTE: Page is moving out of Blink up into the browser process as 87 // NOTE: Page is moving out of Blink up into the browser process as
86 // part of the site-isolation (out of process iframes) work. 88 // part of the site-isolation (out of process iframes) work.
87 // FrameHost should be used instead where possible. 89 // FrameHost should be used instead where possible.
88 Page* page() const; 90 Page* page() const;
89 FrameHost* host() const; // Null when the frame is detached. 91 FrameHost* host() const; // Null when the frame is detached.
90 92
91 bool isMainFrame() const; 93 bool isMainFrame() const;
92 bool isLocalRoot() const; 94 bool isLocalRoot() const;
93 95
94 FrameOwner* owner() const; 96 FrameOwner* owner() const;
95 void setOwner(FrameOwner* owner) { m_owner = owner; } 97 void setOwner(FrameOwner* owner) { m_owner = owner; }
96 HTMLFrameOwnerElement* deprecatedLocalOwner() const; 98 HTMLFrameOwnerElement* deprecatedLocalOwner() const;
97 99
98 FrameTree& tree() const; 100 FrameTree& tree() const;
99 ChromeClient& chromeClient() const; 101 ChromeClient& chromeClient() const;
100 102
101 virtual SecurityContext* securityContext() const = 0; 103 virtual SecurityContext* securityContext() const = 0;
102 104
103 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame); 105 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame);
104 Frame* findUnsafeParentScrollPropagationBoundary(); 106 Frame* findUnsafeParentScrollPropagationBoundary();
105 107
108 // This prepares the Frame for the next commit. It will detach children,
109 // dispatch unload events, abort XHR requests and detach the document.
110 // Returns true if the frame is ready to receive the next commit, or false
111 // otherwise.
112 virtual bool prepareForCommit() = 0;
113 void prepareSwapFrom(Frame*);
106 void finishSwapFrom(Frame*); 114 void finishSwapFrom(Frame*);
107 115
108 bool canNavigate(const Frame&); 116 bool canNavigate(const Frame&);
109 virtual void printNavigationErrorMessage(const Frame&, const char* reason) = 0; 117 virtual void printNavigationErrorMessage(const Frame&, const char* reason) = 0;
110 118
111 LayoutPart* ownerLayoutObject() const; // LayoutObject for the element that contains this frame. 119 LayoutPart* ownerLayoutObject() const; // LayoutObject for the element that contains this frame.
112 120
113 int64_t frameID() const { return m_frameID; } 121 int64_t frameID() const { return m_frameID; }
114 122
115 Settings* settings() const; // can be null 123 Settings* settings() const; // can be null
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 { 160 {
153 return m_treeNode; 161 return m_treeNode;
154 } 162 }
155 163
156 // Allow equality comparisons of Frames by reference or pointer, interchangeably . 164 // Allow equality comparisons of Frames by reference or pointer, interchangeably .
157 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame) 165 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame)
158 166
159 } // namespace blink 167 } // namespace blink
160 168
161 #endif // Frame_h 169 #endif // Frame_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698