OLD | NEW |
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 Loading... |
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 #endif |
48 | 51 |
49 void resetInstance(); | 52 void resetInstance(); |
50 SharedPersistent<v8::Object>* pluginWrapper(); | 53 SharedPersistent<v8::Object>* pluginWrapper(); |
51 Widget* pluginWidget() const; | 54 Widget* pluginWidget() const; |
52 NPObject* getNPObject(); | 55 NPObject* getNPObject(); |
53 bool canProcessDrag() const; | 56 bool canProcessDrag() const; |
54 const String& url() const { return m_url; } | 57 const String& url() const { return m_url; } |
55 | 58 |
56 // Public for FrameView::addWidgetToUpdate() | 59 // Public for FrameView::addWidgetToUpdate() |
57 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } | 60 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 bool m_isCapturingMouseEvents; | 139 bool m_isCapturingMouseEvents; |
137 bool m_needsWidgetUpdate; | 140 bool m_needsWidgetUpdate; |
138 bool m_shouldPreferPlugInsForImages; | 141 bool m_shouldPreferPlugInsForImages; |
139 bool m_usePlaceholderContent; | 142 bool m_usePlaceholderContent; |
140 | 143 |
141 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. | 144 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. |
142 // However, plugins can persist even when not rendered. In order to | 145 // However, plugins can persist even when not rendered. In order to |
143 // prevent confusing code which may assume that widget() != null | 146 // prevent confusing code which may assume that widget() != null |
144 // means the frame is active, we save off m_widget here while | 147 // means the frame is active, we save off m_widget here while |
145 // the plugin is persisting but not being displayed. | 148 // the plugin is persisting but not being displayed. |
146 RefPtr<Widget> m_persistedPluginWidget; | 149 // --- |
| 150 // Oilpan: a Persistent<> is used for finalization purposes. |
| 151 // A renderer-less plugin element is not detached prior to |
| 152 // finalization, so the required disposing of plugin container |
| 153 // widgets that happen then won't. Instead, a Persistent is |
| 154 // used to extend the lifetime of this persisted widget |
| 155 // beyond the plugin element's, so that it can be disposed |
| 156 // of by the plugin element's finalizer. |
| 157 // |
| 158 // To prevent a leak from that, the plugin container does not |
| 159 // keep a strong reference back to the plugin element. |
| 160 // Not pretty. |
| 161 GC_PLUGIN_IGNORE("") |
| 162 RefPtrWillBePersistent<Widget> m_persistedPluginWidget; |
147 }; | 163 }; |
148 | 164 |
149 inline bool isHTMLPlugInElement(const HTMLElement& element) | 165 inline bool isHTMLPlugInElement(const HTMLElement& element) |
150 { | 166 { |
151 return element.isPluginElement(); | 167 return element.isPluginElement(); |
152 } | 168 } |
153 | 169 |
154 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); | 170 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); |
155 | 171 |
156 } // namespace blink | 172 } // namespace blink |
157 | 173 |
158 #endif // HTMLPlugInElement_h | 174 #endif // HTMLPlugInElement_h |
OLD | NEW |