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

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

Issue 635593004: PPAPI: Make V8VarConverter longer-lived (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 6 years, 2 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 | « no previous file | content/renderer/pepper/message_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/host_var_tracker_unittest.cc
diff --git a/content/renderer/pepper/host_var_tracker_unittest.cc b/content/renderer/pepper/host_var_tracker_unittest.cc
index 5b4175b9d1bc818007ae73415ef475d98b1ad384..356d43d5eee265cfb37bd28e1a3186e26169e888 100644
--- a/content/renderer/pepper/host_var_tracker_unittest.cc
+++ b/content/renderer/pepper/host_var_tracker_unittest.cc
@@ -9,6 +9,7 @@
#include "content/renderer/pepper/mock_resource.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/pepper_try_catch.h"
+#include "content/renderer/pepper/v8_var_converter.h"
#include "content/renderer/pepper/v8object_var.h"
#include "content/test/ppapi_unittest.h"
#include "gin/handle.h"
@@ -44,8 +45,9 @@ gin::WrapperInfo MyObject::kWrapperInfo = {gin::kEmbedderNativeGin};
class PepperTryCatchForTest : public PepperTryCatch {
public:
- explicit PepperTryCatchForTest(PepperPluginInstanceImpl* instance)
- : PepperTryCatch(instance, V8VarConverter::kAllowObjectVars),
+ PepperTryCatchForTest(PepperPluginInstanceImpl* instance,
+ V8VarConverter* converter)
+ : PepperTryCatch(instance, converter),
handle_scope_(instance->GetIsolate()),
context_scope_(v8::Context::New(instance->GetIsolate())) {}
@@ -87,7 +89,9 @@ TEST_F(HostVarTrackerTest, DeleteObjectVarWithInstance) {
PP_Instance pp_instance2 = instance2->pp_instance();
{
- PepperTryCatchForTest try_catch(instance2.get());
+ V8VarConverter converter(
+ instance2->pp_instance(), V8VarConverter::kAllowObjectVars);
+ PepperTryCatchForTest try_catch(instance2.get(), &converter);
// Make an object var.
ppapi::ScopedPPVar var = try_catch.FromV8(MyObject::Create(test_isolate));
EXPECT_EQ(1, g_v8objects_alive);
@@ -104,7 +108,9 @@ TEST_F(HostVarTrackerTest, DeleteObjectVarWithInstance) {
// Make sure that using the same v8 object should give the same PP_Var
// each time.
TEST_F(HostVarTrackerTest, ReuseVar) {
- PepperTryCatchForTest try_catch(instance());
+ V8VarConverter converter(
+ instance()->pp_instance(), V8VarConverter::kAllowObjectVars);
+ PepperTryCatchForTest try_catch(instance(), &converter);
v8::Handle<v8::Value> v8_object = MyObject::Create(v8::Isolate::GetCurrent());
ppapi::ScopedPPVar pp_object1 = try_catch.FromV8(v8_object);
« no previous file with comments | « no previous file | content/renderer/pepper/message_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698