[M69] Apply upstream v8 API changes 73/187873/3
authorYoungsoo Choi <kenshin.choi@samsung.com>
Wed, 29 Aug 2018 06:24:15 +0000 (06:24 +0000)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Mon, 19 Nov 2018 05:07:36 +0000 (05:07 +0000)
This adds Isolate parameter to method v8::New, v8::TryCatch, and v8::ToInt32
as per upstream chromium changes.

Change-Id: Id02928aecd20f5dacf5d7c25290a3a4354ae139d
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
extensions/renderer/object_tools_module.cc
extensions/renderer/widget_module.cc
extensions/renderer/xwalk_extension_module.cc
extensions/renderer/xwalk_v8tools_module.cc

index 67cb503..290eb23 100644 (file)
@@ -50,7 +50,7 @@ v8::Handle<v8::Value> RunString(const std::string& code) {
   v8::Handle<v8::String> v8_code(
       v8::String::NewFromUtf8(isolate, code.c_str()));
 
-  v8::TryCatch try_catch;
+  v8::TryCatch try_catch(isolate);
   try_catch.SetVerbose(true);
 
   v8::Handle<v8::Script> script(v8::Script::Compile(v8_code));
@@ -101,7 +101,7 @@ v8::Handle<v8::Object> ObjectToolsModule::NewInstance() {
       v8::Local<v8::Function>::New(isolate, create_function_);
 
   v8::Handle<v8::Context> context = v8::Context::New(isolate);
-  v8::TryCatch try_catch;
+  v8::TryCatch try_catch(isolate);
   v8::Handle<v8::Value> ret = function->Call(context->Global(), 0, NULL);
   if (try_catch.HasCaught()) {
     LOGGER(ERROR) << "Exception when running create function: ";
index 2237501..5e86a97 100644 (file)
@@ -69,7 +69,7 @@ void DispatchEvent(const v8::Local<v8::Object>& This,
     newvalue
   };
 
-  v8::TryCatch try_catch;
+  v8::TryCatch try_catch(isolate);
   v8::Handle<v8::Function>::Cast(function)->Call(
       context->Global(), argc, argv);
   if (try_catch.HasCaught())
@@ -98,7 +98,7 @@ v8::Handle<v8::Object> MakeException(int code,
 
 void KeyFunction(const v8::FunctionCallbackInfo<v8::Value>& info) {
   v8::Isolate* isolate = v8::Isolate::GetCurrent();
-  int idx = info[0]->ToInt32()->Value();
+  int idx = info[0]->ToInt32(isolate)->Value();
   auto widget = WidgetPreferenceDB::GetInstance();
   std::string keyname;
   if (widget->Key(idx, &keyname)) {
@@ -187,7 +187,7 @@ WidgetModule::WidgetModule() {
   v8::Isolate* isolate = v8::Isolate::GetCurrent();
   v8::HandleScope handle_scope(isolate);
   v8::Handle<v8::ObjectTemplate>
-      preference_object_template = v8::ObjectTemplate::New();
+      preference_object_template = v8::ObjectTemplate::New(isolate);
 
   auto getter = [](
       v8::Local<v8::String> property,
index c222556..dc612aa 100644 (file)
@@ -229,7 +229,7 @@ v8::Handle<v8::Value> RunString(const std::string& code,
   v8::Handle<v8::String> v8_code(
       v8::String::NewFromUtf8(isolate, code.c_str()));
 
-  v8::TryCatch try_catch;
+  v8::TryCatch try_catch(isolate);
   try_catch.SetVerbose(true);
 
   v8::Handle<v8::Script> script(v8::Script::Compile(v8_code));
@@ -289,7 +289,8 @@ void XWalkExtensionModule::LoadExtensionCode(
     require_native
   };
 
-  v8::TryCatch try_catch;
+  v8::Isolate* isolate = v8::Isolate::GetCurrent();
+  v8::TryCatch try_catch(isolate);
   try_catch.SetVerbose(true);
   callable_api_code->Call(context->Global(), argc, argv);
   if (try_catch.HasCaught()) {
@@ -313,7 +314,7 @@ void XWalkExtensionModule::HandleMessageFromNative(const std::string& msg) {
   v8::Handle<v8::Function> message_listener =
       v8::Local<v8::Function>::New(isolate, message_listener_);
 
-  v8::TryCatch try_catch;
+  v8::TryCatch try_catch(isolate);
   message_listener->Call(context->Global(), 1, args);
   if (try_catch.HasCaught())
     LOGGER(ERROR) << "Exception when running message listener: "
index 941851d..9945cef 100755 (executable)
@@ -74,7 +74,7 @@ void LifecycleTracker(const v8::FunctionCallbackInfo<v8::Value>& info) {
 XWalkV8ToolsModule::XWalkV8ToolsModule() {
   v8::Isolate* isolate = v8::Isolate::GetCurrent();
   v8::HandleScope handle_scope(isolate);
-  v8::Handle<v8::ObjectTemplate> object_template = v8::ObjectTemplate::New();
+  v8::Handle<v8::ObjectTemplate> object_template = v8::ObjectTemplate::New(isolate);
 
   // TODO(cmarcelo): Use Template::Set() function that takes isolate, once we
   // update the Chromium (and V8) version.