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

Unified Diff: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp

Issue 2855753002: Simplify HTMLPlugInElement::PluginWrapper to not use SharedPersistent. (Closed)
Patch Set: no need for mutable Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLPlugInElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
index 3665ea9f8012823b4c414f5cd681d9e21f9d00fc..5fabc4a9af0564879b4bf72a28b7c6bedc6fd161 100644
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
@@ -48,6 +48,7 @@
#include "core/plugins/PluginView.h"
#include "platform/FrameViewBase.h"
#include "platform/Histogram.h"
+#include "platform/bindings/V8PerIsolateData.h"
#include "platform/loader/fetch/ResourceRequest.h"
#include "platform/network/mime/MIMETypeFromURL.h"
#include "platform/network/mime/MIMETypeRegistry.h"
@@ -86,7 +87,7 @@ HTMLPlugInElement::HTMLPlugInElement(
kShouldPreferPlugInsForImages) {}
HTMLPlugInElement::~HTMLPlugInElement() {
- DCHECK(!plugin_wrapper_); // cleared in detachLayoutTree()
+ DCHECK(plugin_wrapper_.IsEmpty()); // cleared in detachLayoutTree()
DCHECK(!is_delaying_load_event_);
}
@@ -365,18 +366,19 @@ void HTMLPlugInElement::FinishParsingChildren() {
}
void HTMLPlugInElement::ResetInstance() {
- plugin_wrapper_.Clear();
+ plugin_wrapper_.Reset();
}
-SharedPersistent<v8::Object>* HTMLPlugInElement::PluginWrapper() {
+v8::Local<v8::Object> HTMLPlugInElement::PluginWrapper() {
LocalFrame* frame = GetDocument().GetFrame();
if (!frame)
- return nullptr;
+ return v8::Local<v8::Object>();
// If the host dynamically turns off JavaScript (or Java) we will still
// return the cached allocated Bindings::Instance. Not supporting this
// edge-case is OK.
- if (!plugin_wrapper_) {
+ v8::Isolate* isolate = V8PerIsolateData::MainThreadIsolate();
+ if (plugin_wrapper_.IsEmpty()) {
PluginView* plugin;
if (persisted_plugin_)
@@ -384,12 +386,10 @@ SharedPersistent<v8::Object>* HTMLPlugInElement::PluginWrapper() {
else
plugin = PluginWidget();
- if (plugin) {
- plugin_wrapper_ =
- frame->GetScriptController().CreatePluginWrapper(*plugin);
- }
+ if (plugin)
+ plugin_wrapper_.Reset(isolate, plugin->ScriptableObject(isolate));
}
- return plugin_wrapper_.Get();
+ return plugin_wrapper_.Get(isolate);
}
PluginView* HTMLPlugInElement::PluginWidget() const {
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLPlugInElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698