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

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: tests and cleanup 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') | Source/web/FrameLoaderClientImpl.cpp » ('J')
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 class FrameOwner; 46 class FrameOwner;
47 class HTMLFrameOwnerElement; 47 class HTMLFrameOwnerElement;
48 class LayoutPart; 48 class LayoutPart;
49 class KURL; 49 class KURL;
50 class Page; 50 class Page;
51 class SecurityContext; 51 class SecurityContext;
52 class Settings; 52 class Settings;
53 class WindowProxy; 53 class WindowProxy;
54 class WindowProxyManager; 54 class WindowProxyManager;
55 55
56 enum class DetachType { Remove, Swap };
dcheng 2015/06/04 00:58:23 Let's call this FrameDetachType if we're going to
lfg 2015/06/04 19:16:57 Done.
57
56 // Status of user gesture. 58 // Status of user gesture.
57 enum class UserGestureStatus { Active, None }; 59 enum class UserGestureStatus { Active, None };
58 60
59 class CORE_EXPORT Frame : public RefCountedWillBeGarbageCollectedFinalized<Frame > { 61 class CORE_EXPORT Frame : public RefCountedWillBeGarbageCollectedFinalized<Frame > {
60 public: 62 public:
61 virtual ~Frame(); 63 virtual ~Frame();
62 64
63 DECLARE_VIRTUAL_TRACE(); 65 DECLARE_VIRTUAL_TRACE();
64 66
65 virtual bool isLocalFrame() const { return false; } 67 virtual bool isLocalFrame() const { return false; }
66 virtual bool isRemoteFrame() const { return false; } 68 virtual bool isRemoteFrame() const { return false; }
67 69
68 virtual DOMWindow* domWindow() const = 0; 70 virtual DOMWindow* domWindow() const = 0;
69 virtual WindowProxy* windowProxy(DOMWrapperWorld&) = 0; 71 virtual WindowProxy* windowProxy(DOMWrapperWorld&) = 0;
70 72
71 virtual void navigate(Document& originDocument, const KURL&, bool lockBackFo rwardList, UserGestureStatus) = 0; 73 virtual void navigate(Document& originDocument, const KURL&, bool lockBackFo rwardList, UserGestureStatus) = 0;
72 virtual void reload(ReloadPolicy, ClientRedirectPolicy) = 0; 74 virtual void reload(ReloadPolicy, ClientRedirectPolicy) = 0;
73 75
74 virtual void detach(); 76 virtual void detach(DetachType);
75 void detachChildren(); 77 void detachChildren();
76 virtual void disconnectOwnerElement(); 78 virtual void disconnectOwnerElement();
77 79
78 FrameClient* client() const; 80 FrameClient* client() const;
79 81
80 // NOTE: Page is moving out of Blink up into the browser process as 82 // NOTE: Page is moving out of Blink up into the browser process as
81 // part of the site-isolation (out of process iframes) work. 83 // part of the site-isolation (out of process iframes) work.
82 // FrameHost should be used instead where possible. 84 // FrameHost should be used instead where possible.
83 Page* page() const; 85 Page* page() const;
84 FrameHost* host() const; // Null when the frame is detached. 86 FrameHost* host() const; // Null when the frame is detached.
85 87
86 bool isMainFrame() const; 88 bool isMainFrame() const;
87 bool isLocalRoot() const; 89 bool isLocalRoot() const;
88 90
89 FrameOwner* owner() const; 91 FrameOwner* owner() const;
90 void setOwner(FrameOwner* owner) { m_owner = owner; } 92 void setOwner(FrameOwner* owner) { m_owner = owner; }
91 HTMLFrameOwnerElement* deprecatedLocalOwner() const; 93 HTMLFrameOwnerElement* deprecatedLocalOwner() const;
92 94
93 FrameTree& tree() const; 95 FrameTree& tree() const;
94 ChromeClient& chromeClient() const; 96 ChromeClient& chromeClient() const;
95 97
96 virtual SecurityContext* securityContext() const = 0; 98 virtual SecurityContext* securityContext() const = 0;
97 99
98 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame); 100 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame);
99 Frame* findUnsafeParentScrollPropagationBoundary(); 101 Frame* findUnsafeParentScrollPropagationBoundary();
100 102
103 void prepareSwapFrom(Frame*);
101 void finishSwapFrom(Frame*); 104 void finishSwapFrom(Frame*);
102 105
103 bool canNavigate(const Frame&); 106 bool canNavigate(const Frame&);
104 virtual void printNavigationErrorMessage(const Frame&, const char* reason) = 0; 107 virtual void printNavigationErrorMessage(const Frame&, const char* reason) = 0;
105 108
106 LayoutPart* ownerLayoutObject() const; // LayoutObject for the element that contains this frame. 109 LayoutPart* ownerLayoutObject() const; // LayoutObject for the element that contains this frame.
107 110
108 int64_t frameID() const { return m_frameID; } 111 int64_t frameID() const { return m_frameID; }
109 112
110 Settings* settings() const; // can be null 113 Settings* settings() const; // can be null
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 { 150 {
148 return m_treeNode; 151 return m_treeNode;
149 } 152 }
150 153
151 // Allow equality comparisons of Frames by reference or pointer, interchangeably . 154 // Allow equality comparisons of Frames by reference or pointer, interchangeably .
152 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame) 155 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame)
153 156
154 } // namespace blink 157 } // namespace blink
155 158
156 #endif // Frame_h 159 #endif // Frame_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/Frame.cpp » ('j') | Source/web/FrameLoaderClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698