OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 class ResourceResponse; | 55 class ResourceResponse; |
56 class TouchEvent; | 56 class TouchEvent; |
57 class WebPlugin; | 57 class WebPlugin; |
58 class WheelEvent; | 58 class WheelEvent; |
59 class Widget; | 59 class Widget; |
60 struct WebPrintParams; | 60 struct WebPrintParams; |
61 struct WebPrintPresetOptions; | 61 struct WebPrintPresetOptions; |
62 | 62 |
63 class WebPluginContainerImpl final : public PluginView, public WebPluginContaine
r, public LocalFrameLifecycleObserver { | 63 class WebPluginContainerImpl final : public PluginView, public WebPluginContaine
r, public LocalFrameLifecycleObserver { |
64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerImpl); | 64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerImpl); |
| 65 WILL_BE_USING_PRE_FINALIZER(WebPluginContainerImpl, dispose); |
65 public: | 66 public: |
66 static PassRefPtrWillBeRawPtr<WebPluginContainerImpl> create(HTMLPlugInEleme
nt* element, WebPlugin* webPlugin) | 67 static PassRefPtrWillBeRawPtr<WebPluginContainerImpl> create(HTMLPlugInEleme
nt* element, WebPlugin* webPlugin) |
67 { | 68 { |
68 return adoptRefWillBeNoop(new WebPluginContainerImpl(element, webPlugin)
); | 69 return adoptRefWillBeNoop(new WebPluginContainerImpl(element, webPlugin)
); |
69 } | 70 } |
70 | 71 |
71 // PluginView methods | 72 // PluginView methods |
72 WebLayer* platformLayer() const override; | 73 WebLayer* platformLayer() const override; |
73 v8::Local<v8::Object> scriptableObject(v8::Isolate*) override; | 74 v8::Local<v8::Object> scriptableObject(v8::Isolate*) override; |
74 bool getFormValue(String&) override; | 75 bool getFormValue(String&) override; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 152 |
152 // Resource load events for the plugin's source data: | 153 // Resource load events for the plugin's source data: |
153 void didReceiveResponse(const ResourceResponse&) override; | 154 void didReceiveResponse(const ResourceResponse&) override; |
154 void didReceiveData(const char *data, int dataLength) override; | 155 void didReceiveData(const char *data, int dataLength) override; |
155 void didFinishLoading(); | 156 void didFinishLoading(); |
156 void didFailLoading(const ResourceError&); | 157 void didFailLoading(const ResourceError&); |
157 | 158 |
158 DECLARE_VIRTUAL_TRACE(); | 159 DECLARE_VIRTUAL_TRACE(); |
159 void dispose() override; | 160 void dispose() override; |
160 | 161 |
161 #if ENABLE(OILPAN) | |
162 LocalFrame* pluginFrame() const override { return frame(); } | |
163 void shouldDisposePlugin() override; | |
164 #endif | |
165 | |
166 private: | 162 private: |
167 // Sets |windowRect| to the content rect of the plugin in screen space. | 163 // Sets |windowRect| to the content rect of the plugin in screen space. |
168 // Sets |clippedAbsoluteRect| to the visible rect for the plugin, clipped to
the visible screen of the root frame, in local space of the plugin. | 164 // Sets |clippedAbsoluteRect| to the visible rect for the plugin, clipped to
the visible screen of the root frame, in local space of the plugin. |
169 // Sets |unclippedAbsoluteRect| to the visible rect for the plugin (but with
out also clipping to the screen), in local space of the plugin. | 165 // Sets |unclippedAbsoluteRect| to the visible rect for the plugin (but with
out also clipping to the screen), in local space of the plugin. |
170 void computeClipRectsForPlugin( | 166 void computeClipRectsForPlugin( |
171 const HTMLFrameOwnerElement* pluginOwnerElement, IntRect& windowRect, In
tRect& clippedLocalRect, IntRect& unclippedIntLocalRect) const; | 167 const HTMLFrameOwnerElement* pluginOwnerElement, IntRect& windowRect, In
tRect& clippedLocalRect, IntRect& unclippedIntLocalRect) const; |
172 | 168 |
173 WebPluginContainerImpl(HTMLPlugInElement*, WebPlugin*); | 169 WebPluginContainerImpl(HTMLPlugInElement*, WebPlugin*); |
174 ~WebPluginContainerImpl() override; | 170 ~WebPluginContainerImpl() override; |
175 | 171 |
(...skipping 23 matching lines...) Expand all Loading... |
199 WebPlugin* m_webPlugin; | 195 WebPlugin* m_webPlugin; |
200 | 196 |
201 WebLayer* m_webLayer; | 197 WebLayer* m_webLayer; |
202 | 198 |
203 IntRect m_pendingInvalidationRect; | 199 IntRect m_pendingInvalidationRect; |
204 | 200 |
205 TouchEventRequestType m_touchEventRequestType; | 201 TouchEventRequestType m_touchEventRequestType; |
206 bool m_wantsWheelEvents; | 202 bool m_wantsWheelEvents; |
207 | 203 |
208 bool m_inDispose; | 204 bool m_inDispose; |
209 #if ENABLE(OILPAN) | |
210 // Oilpan: if true, the plugin container must dispose | |
211 // of its plugin when being finalized. | |
212 bool m_shouldDisposePlugin; | |
213 #endif | |
214 }; | 205 }; |
215 | 206 |
216 DEFINE_TYPE_CASTS(WebPluginContainerImpl, Widget, widget, widget->isPluginContai
ner(), widget.isPluginContainer()); | 207 DEFINE_TYPE_CASTS(WebPluginContainerImpl, Widget, widget, widget->isPluginContai
ner(), widget.isPluginContainer()); |
217 // Unlike Widget, we need not worry about object type for container. | 208 // Unlike Widget, we need not worry about object type for container. |
218 // WebPluginContainerImpl is the only subclass of WebPluginContainer. | 209 // WebPluginContainerImpl is the only subclass of WebPluginContainer. |
219 DEFINE_TYPE_CASTS(WebPluginContainerImpl, WebPluginContainer, container, true, t
rue); | 210 DEFINE_TYPE_CASTS(WebPluginContainerImpl, WebPluginContainer, container, true, t
rue); |
220 | 211 |
221 } // namespace blink | 212 } // namespace blink |
222 | 213 |
223 #endif | 214 #endif |
OLD | NEW |