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

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

Issue 1326603002: Oilpan: update plugin handling to work over plugins persisted over reattach (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 m_webPlugin->didFailLoading(error); 599 m_webPlugin->didFailLoading(error);
600 } 600 }
601 601
602 WebLayer* WebPluginContainerImpl::platformLayer() const 602 WebLayer* WebPluginContainerImpl::platformLayer() const
603 { 603 {
604 return m_webLayer; 604 return m_webLayer;
605 } 605 }
606 606
607 v8::Local<v8::Object> WebPluginContainerImpl::scriptableObject(v8::Isolate* isol ate) 607 v8::Local<v8::Object> WebPluginContainerImpl::scriptableObject(v8::Isolate* isol ate)
608 { 608 {
609 #if ENABLE(OILPAN)
610 // With Oilpan, on plugin element detach dispose() will be called to safely
611 // clear out references, including the pre-emptive destruction of the plugin .
612 //
613 // It clearly has no scriptable object if in such a disposed state.
614 if (!m_webPlugin)
615 return v8::Local<v8::Object>();
616 #endif
617
609 // The plugin may be destroyed due to re-entrancy when calling 618 // The plugin may be destroyed due to re-entrancy when calling
610 // v8ScriptableObject below. crbug.com/458776. Hold a reference to the 619 // v8ScriptableObject below. crbug.com/458776. Hold a reference to the
611 // plugin container to prevent this from happening. For Oilpan, 'this' 620 // plugin container to prevent this from happening. For Oilpan, 'this'
612 // is already stack reachable, so redundant. 621 // is already stack reachable, so redundant.
613 RefPtrWillBeRawPtr<WebPluginContainerImpl> protector(this); 622 RefPtrWillBeRawPtr<WebPluginContainerImpl> protector(this);
614 623
615 v8::Local<v8::Object> object = m_webPlugin->v8ScriptableObject(isolate); 624 v8::Local<v8::Object> object = m_webPlugin->v8ScriptableObject(isolate);
616 625
617 // If the plugin has been destroyed and the reference on the stack is the 626 // If the plugin has been destroyed and the reference on the stack is the
618 // only one left, then don't return the scriptable object. 627 // only one left, then don't return the scriptable object.
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 clipRect.move(-windowRect.x(), -windowRect.y()); 960 clipRect.move(-windowRect.x(), -windowRect.y());
952 unobscuredRect.move(-windowRect.x(), -windowRect.y()); 961 unobscuredRect.move(-windowRect.x(), -windowRect.y());
953 962
954 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 963 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
955 // Convert to the plugin position. 964 // Convert to the plugin position.
956 for (size_t i = 0; i < cutOutRects.size(); i++) 965 for (size_t i = 0; i < cutOutRects.size(); i++)
957 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 966 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
958 } 967 }
959 968
960 } // namespace blink 969 } // namespace blink
OLDNEW
« Source/core/html/HTMLPlugInElement.cpp ('K') | « Source/core/html/HTMLPlugInElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698