| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 m_webPlugin->updateVisibility(false); | 196 m_webPlugin->updateVisibility(false); |
| 197 | 197 |
| 198 Widget::hide(); | 198 Widget::hide(); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void WebPluginContainerImpl::handleEvent(Event* event) | 201 void WebPluginContainerImpl::handleEvent(Event* event) |
| 202 { | 202 { |
| 203 if (!m_webPlugin->acceptsInputEvents()) | 203 if (!m_webPlugin->acceptsInputEvents()) |
| 204 return; | 204 return; |
| 205 | 205 |
| 206 RefPtrWillBeRawPtr<WebPluginContainerImpl> protector(this); | 206 RawPtr<WebPluginContainerImpl> protector(this); |
| 207 // The events we pass are defined at: | 207 // The events we pass are defined at: |
| 208 // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/struct
ures5.html#1000000 | 208 // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/struct
ures5.html#1000000 |
| 209 // Don't take the documentation as truth, however. There are many cases | 209 // Don't take the documentation as truth, however. There are many cases |
| 210 // where mozilla behaves differently than the spec. | 210 // where mozilla behaves differently than the spec. |
| 211 if (event->isMouseEvent()) | 211 if (event->isMouseEvent()) |
| 212 handleMouseEvent(toMouseEvent(event)); | 212 handleMouseEvent(toMouseEvent(event)); |
| 213 else if (event->isWheelEvent()) | 213 else if (event->isWheelEvent()) |
| 214 handleWheelEvent(toWheelEvent(event)); | 214 handleWheelEvent(toWheelEvent(event)); |
| 215 else if (event->isKeyboardEvent()) | 215 else if (event->isKeyboardEvent()) |
| 216 handleKeyboardEvent(toKeyboardEvent(event)); | 216 handleKeyboardEvent(toKeyboardEvent(event)); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 return m_webPlugin->executeEditCommand(name, value); | 395 return m_webPlugin->executeEditCommand(name, value); |
| 396 } | 396 } |
| 397 | 397 |
| 398 WebElement WebPluginContainerImpl::element() | 398 WebElement WebPluginContainerImpl::element() |
| 399 { | 399 { |
| 400 return WebElement(m_element); | 400 return WebElement(m_element); |
| 401 } | 401 } |
| 402 | 402 |
| 403 void WebPluginContainerImpl::dispatchProgressEvent(const WebString& type, bool l
engthComputable, unsigned long long loaded, unsigned long long total, const WebS
tring& url) | 403 void WebPluginContainerImpl::dispatchProgressEvent(const WebString& type, bool l
engthComputable, unsigned long long loaded, unsigned long long total, const WebS
tring& url) |
| 404 { | 404 { |
| 405 RefPtrWillBeRawPtr<ProgressEvent> event; | 405 RawPtr<ProgressEvent> event; |
| 406 if (url.isEmpty()) { | 406 if (url.isEmpty()) { |
| 407 event = ProgressEvent::create(type, lengthComputable, loaded, total); | 407 event = ProgressEvent::create(type, lengthComputable, loaded, total); |
| 408 } else { | 408 } else { |
| 409 event = ResourceProgressEvent::create(type, lengthComputable, loaded, to
tal, url); | 409 event = ResourceProgressEvent::create(type, lengthComputable, loaded, to
tal, url); |
| 410 } | 410 } |
| 411 m_element->dispatchEvent(event.release()); | 411 m_element->dispatchEvent(event.release()); |
| 412 } | 412 } |
| 413 | 413 |
| 414 void WebPluginContainerImpl::invalidate() | 414 void WebPluginContainerImpl::invalidate() |
| 415 { | 415 { |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 // | 635 // |
| 636 // It clearly has no scriptable object if in such a disposed state. | 636 // It clearly has no scriptable object if in such a disposed state. |
| 637 if (!m_webPlugin) | 637 if (!m_webPlugin) |
| 638 return v8::Local<v8::Object>(); | 638 return v8::Local<v8::Object>(); |
| 639 #endif | 639 #endif |
| 640 | 640 |
| 641 // The plugin may be destroyed due to re-entrancy when calling | 641 // The plugin may be destroyed due to re-entrancy when calling |
| 642 // v8ScriptableObject below. crbug.com/458776. Hold a reference to the | 642 // v8ScriptableObject below. crbug.com/458776. Hold a reference to the |
| 643 // plugin container to prevent this from happening. For Oilpan, 'this' | 643 // plugin container to prevent this from happening. For Oilpan, 'this' |
| 644 // is already stack reachable, so redundant. | 644 // is already stack reachable, so redundant. |
| 645 RefPtrWillBeRawPtr<WebPluginContainerImpl> protector(this); | 645 RawPtr<WebPluginContainerImpl> protector(this); |
| 646 | 646 |
| 647 v8::Local<v8::Object> object = m_webPlugin->v8ScriptableObject(isolate); | 647 v8::Local<v8::Object> object = m_webPlugin->v8ScriptableObject(isolate); |
| 648 | 648 |
| 649 // If the plugin has been destroyed and the reference on the stack is the | 649 // If the plugin has been destroyed and the reference on the stack is the |
| 650 // only one left, then don't return the scriptable object. | 650 // only one left, then don't return the scriptable object. |
| 651 #if ENABLE(OILPAN) | 651 #if ENABLE(OILPAN) |
| 652 if (!m_webPlugin) | 652 if (!m_webPlugin) |
| 653 #else | 653 #else |
| 654 if (hasOneRef()) | 654 if (hasOneRef()) |
| 655 #endif | 655 #endif |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 // frame view. | 986 // frame view. |
| 987 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); | 987 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); |
| 988 } | 988 } |
| 989 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 989 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
| 990 // Convert to the plugin position. | 990 // Convert to the plugin position. |
| 991 for (size_t i = 0; i < cutOutRects.size(); i++) | 991 for (size_t i = 0; i < cutOutRects.size(); i++) |
| 992 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 992 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
| 993 } | 993 } |
| 994 | 994 |
| 995 } // namespace blink | 995 } // namespace blink |
| OLD | NEW |