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

Side by Side Diff: Source/core/html/HTMLPlugInElement.h

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Support renderer-less plugin disposal 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 27 matching lines...) Expand all
38 38
39 enum PreferPlugInsForImagesOption { 39 enum PreferPlugInsForImagesOption {
40 ShouldPreferPlugInsForImages, 40 ShouldPreferPlugInsForImages,
41 ShouldNotPreferPlugInsForImages 41 ShouldNotPreferPlugInsForImages
42 }; 42 };
43 43
44 class HTMLPlugInElement : public HTMLFrameOwnerElement { 44 class HTMLPlugInElement : public HTMLFrameOwnerElement {
45 public: 45 public:
46 virtual ~HTMLPlugInElement(); 46 virtual ~HTMLPlugInElement();
47 virtual void trace(Visitor*) override; 47 virtual void trace(Visitor*) override;
48 #if ENABLE(OILPAN)
49 virtual void disconnectContentFrame() override;
50 void setIsAllowedToDisposePlugin();
51 #endif
48 52
49 void resetInstance(); 53 void resetInstance();
50 SharedPersistent<v8::Object>* pluginWrapper(); 54 SharedPersistent<v8::Object>* pluginWrapper();
51 Widget* pluginWidget() const; 55 Widget* pluginWidget() const;
52 NPObject* getNPObject(); 56 NPObject* getNPObject();
53 bool canProcessDrag() const; 57 bool canProcessDrag() const;
54 const String& url() const { return m_url; } 58 const String& url() const { return m_url; }
55 59
56 // Public for FrameView::addWidgetToUpdate() 60 // Public for FrameView::addWidgetToUpdate()
57 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } 61 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 128
125 // Return any existing RenderWidget without triggering relayout, or 0 if it 129 // Return any existing RenderWidget without triggering relayout, or 0 if it
126 // doesn't yet exist. 130 // doesn't yet exist.
127 virtual RenderWidget* existingRenderWidget() const = 0; 131 virtual RenderWidget* existingRenderWidget() const = 0;
128 virtual void updateWidgetInternal() = 0; 132 virtual void updateWidgetInternal() = 0;
129 133
130 bool loadPlugin(const KURL&, const String& mimeType, const Vector<String>& p aramNames, const Vector<String>& paramValues, bool useFallback, bool requireRend erer); 134 bool loadPlugin(const KURL&, const String& mimeType, const Vector<String>& p aramNames, const Vector<String>& paramValues, bool useFallback, bool requireRend erer);
131 bool pluginIsLoadable(const KURL&, const String& mimeType); 135 bool pluginIsLoadable(const KURL&, const String& mimeType);
132 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType) ; 136 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType) ;
133 137
138 void setPersistedPluginWidget(Widget*);
139
134 mutable RefPtr<SharedPersistent<v8::Object> > m_pluginWrapper; 140 mutable RefPtr<SharedPersistent<v8::Object> > m_pluginWrapper;
135 NPObject* m_NPObject; 141 NPObject* m_NPObject;
136 bool m_isCapturingMouseEvents; 142 bool m_isCapturingMouseEvents;
137 bool m_needsWidgetUpdate; 143 bool m_needsWidgetUpdate;
138 bool m_shouldPreferPlugInsForImages; 144 bool m_shouldPreferPlugInsForImages;
139 bool m_usePlaceholderContent; 145 bool m_usePlaceholderContent;
140 146
141 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. 147 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget.
142 // However, plugins can persist even when not rendered. In order to 148 // However, plugins can persist even when not rendered. In order to
143 // prevent confusing code which may assume that widget() != null 149 // prevent confusing code which may assume that widget() != null
144 // means the frame is active, we save off m_widget here while 150 // means the frame is active, we save off m_widget here while
145 // the plugin is persisting but not being displayed. 151 // the plugin is persisting but not being displayed.
146 RefPtr<Widget> m_persistedPluginWidget; 152 RefPtrWillBeMember<Widget> m_persistedPluginWidget;
147 }; 153 };
148 154
149 inline bool isHTMLPlugInElement(const HTMLElement& element) 155 inline bool isHTMLPlugInElement(const HTMLElement& element)
150 { 156 {
151 return element.isPluginElement(); 157 return element.isPluginElement();
152 } 158 }
153 159
154 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); 160 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement);
155 161
156 } // namespace blink 162 } // namespace blink
157 163
158 #endif // HTMLPlugInElement_h 164 #endif // HTMLPlugInElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698