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

Unified Diff: content/renderer/pepper/v8object_var.cc

Issue 459553003: Replace NPObject usage in ppapi with gin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
Index: content/renderer/pepper/v8object_var.cc
diff --git a/content/renderer/pepper/v8object_var.cc b/content/renderer/pepper/v8object_var.cc
index dbf431ae4586accde1b2be1748e9cf28bf62ba59..faf8bef8e7a492d034afa289b5b259bac846cab2 100644
--- a/content/renderer/pepper/v8object_var.cc
+++ b/content/renderer/pepper/v8object_var.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "content/public/renderer/pepper_plugin_instance.h"
#include "content/renderer/pepper/host_globals.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "ppapi/c/pp_var.h"
namespace ppapi {
@@ -15,9 +16,8 @@ namespace ppapi {
V8ObjectVar::V8ObjectVar(PP_Instance instance,
v8::Handle<v8::Object> v8_object)
- : instance_(instance) {
- v8_object_.Reset(
- content::PepperPluginInstance::Get(instance_)->GetIsolate(), v8_object);
+ : instance_(content::HostGlobals::Get()->GetInstance(instance)) {
+ v8_object_.Reset(instance_->GetIsolate(), v8_object);
content::HostGlobals::Get()->host_var_tracker()->AddV8ObjectVar(this);
}
@@ -36,10 +36,8 @@ PP_VarType V8ObjectVar::GetType() const {
}
v8::Local<v8::Object> V8ObjectVar::GetHandle() const {
- content::PepperPluginInstance* instance =
- content::PepperPluginInstance::Get(instance_);
- if (instance)
- return v8::Local<v8::Object>::New(instance->GetIsolate(), v8_object_);
+ if (instance_)
+ return v8::Local<v8::Object>::New(instance_->GetIsolate(), v8_object_);
return v8::Local<v8::Object>();
}
@@ -47,7 +45,7 @@ void V8ObjectVar::InstanceDeleted() {
// This is called by the HostVarTracker which will take care of removing us
// from its set.
DCHECK(instance_);
- instance_ = 0;
+ instance_ = NULL;
}
// static

Powered by Google App Engine
This is Rietveld 408576698