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

Side by Side Diff: Source/web/WebPluginContainerImpl.cpp

Issue 944753004: Check for an active document in WebPluginContainerImpl::windowClipRect (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // document().renderView() can be 0 when we receive messages from the 975 if (m_element->document().isActive()) {
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()) {
979 // Take our element and get the clip rect from the enclosing layer and 976 // Take our element and get the clip rect from the enclosing layer and
980 // frame view. 977 // frame view.
981 clipRect.intersect( 978 clipRect.intersect(
982 m_element->document().view()->windowClipRectForFrameOwner(m_element) ); 979 m_element->document().view()->windowClipRectForFrameOwner(m_element) );
983 } 980 }
984 981
985 return clipRect; 982 return clipRect;
986 } 983 }
987 984
988 bool WebPluginContainerImpl::pluginShouldPersist() const 985 bool WebPluginContainerImpl::pluginShouldPersist() const
989 { 986 {
990 return m_webPlugin->shouldPersist(); 987 return m_webPlugin->shouldPersist();
991 } 988 }
992 989
993 } // namespace blink 990 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698