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

Unified Diff: Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp

Issue 147333004: Revert of Limit the usage of SharedPersistent to ScriptValue only (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | « Source/bindings/v8/V8NPObject.cpp ('k') | Source/core/html/HTMLPlugInElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp
diff --git a/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp
index 123f9eb0fb322e80be36da420dbf52b4c9915b8c..d29360ac3cb693b049ecb6495d480feb8db88d17 100644
--- a/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp
@@ -33,7 +33,7 @@
#include "V8HTMLAppletElement.h"
#include "V8HTMLEmbedElement.h"
#include "V8HTMLObjectElement.h"
-#include "bindings/v8/ScriptValue.h"
+#include "bindings/v8/SharedPersistent.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8NPObject.h"
#include "core/frame/UseCounter.h"
@@ -47,7 +47,11 @@
static void npObjectNamedGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
HTMLPlugInElement* imp = C::toNative(info.Holder());
- v8::Handle<v8::Object> instanceTemplate = v8::Handle<v8::Object>::Cast(imp->pluginWrapper().v8Value());
+ RefPtr<SharedPersistent<v8::Object> > wrapper = imp->pluginWrapper();
+ if (!wrapper)
+ return;
+
+ v8::Local<v8::Object> instanceTemplate = wrapper->newLocal(info.GetIsolate());
if (instanceTemplate.IsEmpty())
return;
@@ -58,7 +62,11 @@
static void npObjectNamedSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
HTMLPlugInElement* imp = C::toNative(info.Holder());
- v8::Handle<v8::Object> instanceTemplate = v8::Handle<v8::Object>::Cast(imp->pluginWrapper().v8Value());
+ RefPtr<SharedPersistent<v8::Object> > wrapper = imp->pluginWrapper();
+ if (!wrapper)
+ return;
+
+ v8::Local<v8::Object> instanceTemplate = wrapper->newLocal(info.GetIsolate());
if (instanceTemplate.IsEmpty())
return;
@@ -120,7 +128,11 @@
void npObjectIndexedGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
{
HTMLPlugInElement* imp = C::toNative(info.Holder());
- v8::Handle<v8::Object> instanceTemplate = v8::Handle<v8::Object>::Cast(imp->pluginWrapper().v8Value());
+ RefPtr<SharedPersistent<v8::Object> > wrapper = imp->pluginWrapper();
+ if (!wrapper)
+ return;
+
+ v8::Local<v8::Object> instanceTemplate = wrapper->newLocal(info.GetIsolate());
if (instanceTemplate.IsEmpty())
return;
@@ -131,7 +143,11 @@
void npObjectIndexedSetter(uint32_t index, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
HTMLPlugInElement* imp = C::toNative(info.Holder());
- v8::Handle<v8::Object> instanceTemplate = v8::Handle<v8::Object>::Cast(imp->pluginWrapper().v8Value());
+ RefPtr<SharedPersistent<v8::Object> > wrapper = imp->pluginWrapper();
+ if (!wrapper)
+ return;
+
+ v8::Local<v8::Object> instanceTemplate = wrapper->newLocal(info.GetIsolate());
if (instanceTemplate.IsEmpty())
return;
« no previous file with comments | « Source/bindings/v8/V8NPObject.cpp ('k') | Source/core/html/HTMLPlugInElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698