| 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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 for (size_t i = 0; i < cutOutRects.size(); i++) | 965 for (size_t i = 0; i < cutOutRects.size(); i++) |
| 966 cutOutRects[i].move(-frameRect.x(), -frameRect.y()); | 966 cutOutRects[i].move(-frameRect.x(), -frameRect.y()); |
| 967 } | 967 } |
| 968 | 968 |
| 969 IntRect WebPluginContainerImpl::windowClipRect() const | 969 IntRect WebPluginContainerImpl::windowClipRect() const |
| 970 { | 970 { |
| 971 // Start by clipping to our bounds. | 971 // Start by clipping to our bounds. |
| 972 IntRect clipRect = | 972 IntRect clipRect = |
| 973 convertToContainingWindow(IntRect(0, 0, width(), height())); | 973 convertToContainingWindow(IntRect(0, 0, width(), height())); |
| 974 | 974 |
| 975 if (m_element->document().isActive()) { | 975 // document().renderView() can be 0 when we receive messages from the |
| 976 // plugins while we are destroying a frame. |
| 977 // FIXME: Can we just check m_element->document().isActive() ? |
| 978 if (m_element->renderer()->document().renderView()) { |
| 976 // Take our element and get the clip rect from the enclosing layer and | 979 // Take our element and get the clip rect from the enclosing layer and |
| 977 // frame view. | 980 // frame view. |
| 978 clipRect.intersect( | 981 clipRect.intersect( |
| 979 m_element->document().view()->windowClipRectForFrameOwner(m_element)
); | 982 m_element->document().view()->windowClipRectForFrameOwner(m_element)
); |
| 980 } | 983 } |
| 981 | 984 |
| 982 return clipRect; | 985 return clipRect; |
| 983 } | 986 } |
| 984 | 987 |
| 985 bool WebPluginContainerImpl::pluginShouldPersist() const | 988 bool WebPluginContainerImpl::pluginShouldPersist() const |
| 986 { | 989 { |
| 987 return m_webPlugin->shouldPersist(); | 990 return m_webPlugin->shouldPersist(); |
| 988 } | 991 } |
| 989 | 992 |
| 990 } // namespace blink | 993 } // namespace blink |
| OLD | NEW |