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

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

Issue 1139983002: Speculative fix for WebPluginContainerImpl::calculateGeometry nullptr crashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 410 }
411 411
412 void WebPluginContainerImpl::scrollRect(const WebRect& rect) 412 void WebPluginContainerImpl::scrollRect(const WebRect& rect)
413 { 413 {
414 invalidateRect(rect); 414 invalidateRect(rect);
415 } 415 }
416 416
417 void WebPluginContainerImpl::reportGeometry() 417 void WebPluginContainerImpl::reportGeometry()
418 { 418 {
419 // We cannot compute geometry without a parent or layoutObject. 419 // We cannot compute geometry without a parent or layoutObject.
420 if (!parent() || !m_element->layoutObject()) 420 if (!parent() || !m_element || !m_element->layoutObject())
421 return; 421 return;
422 422
423 IntRect windowRect, clipRect, unobscuredRect; 423 IntRect windowRect, clipRect, unobscuredRect;
424 Vector<IntRect> cutOutRects; 424 Vector<IntRect> cutOutRects;
425 calculateGeometry(windowRect, clipRect, unobscuredRect, cutOutRects); 425 calculateGeometry(windowRect, clipRect, unobscuredRect, cutOutRects);
426 426
427 m_webPlugin->updateGeometry(windowRect, clipRect, unobscuredRect, cutOutRect s, isVisible()); 427 m_webPlugin->updateGeometry(windowRect, clipRect, unobscuredRect, cutOutRect s, isVisible());
428 428
429 if (m_scrollbarGroup) { 429 if (m_scrollbarGroup) {
430 m_scrollbarGroup->scrollAnimator()->contentsResized(); 430 m_scrollbarGroup->scrollAnimator()->contentsResized();
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 for (size_t i = 0; i < cutOutRects.size(); i++) 1014 for (size_t i = 0; i < cutOutRects.size(); i++)
1015 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 1015 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
1016 } 1016 }
1017 1017
1018 bool WebPluginContainerImpl::pluginShouldPersist() const 1018 bool WebPluginContainerImpl::pluginShouldPersist() const
1019 { 1019 {
1020 return m_webPlugin->shouldPersist(); 1020 return m_webPlugin->shouldPersist();
1021 } 1021 }
1022 1022
1023 } // namespace blink 1023 } // 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