diff options
author | jochen <jochen@chromium.org> | 2015-11-30 03:33:42 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-30 11:34:24 +0000 |
commit | dfd8ec1b3edb7f876235bec1138ecec4f2da748d (patch) | |
tree | e592c87091c88da1ffb34f19bdcf711b079789ba | |
parent | 47ce5feb1d13ce889da15f76f063a7978a0b5c37 (diff) | |
download | chromium_src-dfd8ec1b3edb7f876235bec1138ecec4f2da748d.zip chromium_src-dfd8ec1b3edb7f876235bec1138ecec4f2da748d.tar.gz chromium_src-dfd8ec1b3edb7f876235bec1138ecec4f2da748d.tar.bz2 |
Always pass an v8::Isolate* to the TryCatch ctor
The parameter is required, and the old API will be deleted soon.
BUG=none
R=haraken@chromium.org
TBR=rdevlin.cronin@chromium.org
Review URL: https://codereview.chromium.org/1484723002
Cr-Commit-Position: refs/heads/master@{#362118}
47 files changed, 89 insertions, 87 deletions
diff --git a/chrome/test/base/v8_unit_test.cc b/chrome/test/base/v8_unit_test.cc index 9f382bf..b76e482 100644 --- a/chrome/test/base/v8_unit_test.cc +++ b/chrome/test/base/v8_unit_test.cc @@ -123,7 +123,7 @@ bool V8UnitTest::RunJavascriptTestF(const std::string& testFixture, v8::Boolean::New(isolate, false), v8::String::NewFromUtf8(isolate, "RUN_TEST_F"), params}; - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); v8::Local<v8::Value> result = function->Call(context->Global(), 3, args); // The test fails if an exception was thrown. EXPECT_FALSE(result.IsEmpty()); @@ -222,7 +222,7 @@ void V8UnitTest::ExecuteScriptInContext(const base::StringPiece& script_source, v8::String::kNormalString, script_name.size()); - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); v8::Local<v8::Script> script = v8::Script::Compile(source, name); // Ensure the script compiled without errors. if (script.IsEmpty()) @@ -267,7 +267,7 @@ void V8UnitTest::TestFunction(const std::string& function_name) { v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(functionProperty); - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); v8::Local<v8::Value> result = function->Call(context->Global(), 0, NULL); // The test fails if an exception was thrown. if (result.IsEmpty()) diff --git a/content/child/v8_value_converter_impl.cc b/content/child/v8_value_converter_impl.cc index fd36cf2..f6db421 100644 --- a/content/child/v8_value_converter_impl.cc +++ b/content/child/v8_value_converter_impl.cc @@ -235,7 +235,7 @@ v8::Local<v8::Value> V8ValueConverterImpl::ToV8Array( ToV8ValueImpl(isolate, creation_context, child); CHECK(!child_v8.IsEmpty()); - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); result->Set(static_cast<uint32>(i), child_v8); if (try_catch.HasCaught()) LOG(ERROR) << "Setter for index " << i << " threw an exception."; @@ -257,7 +257,7 @@ v8::Local<v8::Value> V8ValueConverterImpl::ToV8Object( ToV8ValueImpl(isolate, creation_context, &iter.value()); CHECK(!child_v8.IsEmpty()); - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); result->Set( v8::String::NewFromUtf8( isolate, key.c_str(), v8::String::kNormalString, key.length()), @@ -396,7 +396,7 @@ base::Value* V8ValueConverterImpl::FromV8Array( // Only fields with integer keys are carried over to the ListValue. for (uint32 i = 0; i < val->Length(); ++i) { - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); v8::Local<v8::Value> child_v8 = val->Get(i); if (try_catch.HasCaught()) { LOG(ERROR) << "Getter for index " << i << " threw an exception."; @@ -509,7 +509,7 @@ base::Value* V8ValueConverterImpl::FromV8Object( v8::String::Utf8Value name_utf8(key); - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); v8::Local<v8::Value> child_v8 = val->Get(key); if (try_catch.HasCaught()) { diff --git a/content/child/v8_value_converter_impl_unittest.cc b/content/child/v8_value_converter_impl_unittest.cc index 349dbe9..75bfebc 100644 --- a/content/child/v8_value_converter_impl_unittest.cc +++ b/content/child/v8_value_converter_impl_unittest.cc @@ -652,7 +652,7 @@ TEST_F(V8ValueConverterImplTest, DetectCycles) { // Now create a recursive object const std::string key("key"); v8::Local<v8::Object> recursive_object(v8::Object::New(isolate_)); - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate_); recursive_object->Set( v8::String::NewFromUtf8( isolate_, key.c_str(), v8::String::kNormalString, key.length()), diff --git a/content/renderer/pepper/pepper_try_catch.cc b/content/renderer/pepper/pepper_try_catch.cc index 938dac4..3b793b0 100644 --- a/content/renderer/pepper/pepper_try_catch.cc +++ b/content/renderer/pepper/pepper_try_catch.cc @@ -122,6 +122,7 @@ PepperTryCatchVar::PepperTryCatchVar(PepperPluginInstanceImpl* instance, PP_Var* exception) : PepperTryCatch(instance, var_converter), handle_scope_(instance_->GetIsolate()), + try_catch_(instance_->GetIsolate()), exception_(exception), exception_is_set_(false) { // Store a handle to the context here for 2 reasons: diff --git a/content/renderer/pepper/v8_var_converter.cc b/content/renderer/pepper/v8_var_converter.cc index 4942192..536827b 100644 --- a/content/renderer/pepper/v8_var_converter.cc +++ b/content/renderer/pepper/v8_var_converter.cc @@ -376,7 +376,7 @@ bool V8VarConverter::ToV8Value(const PP_Var& var, } if (did_create && CanHaveChildren(child_var)) stack.push(child_var); - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); v8_array->Set(static_cast<uint32>(i), child_v8); if (try_catch.HasCaught()) { LOG(ERROR) << "Setter for index " << i << " threw an exception."; @@ -412,7 +412,7 @@ bool V8VarConverter::ToV8Value(const PP_Var& var, } if (did_create && CanHaveChildren(child_var)) stack.push(child_var); - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); v8_object->Set( v8::String::NewFromUtf8( isolate, key.c_str(), v8::String::kNormalString, key.length()), @@ -517,7 +517,7 @@ bool V8VarConverter::FromV8ValueInternal( } for (uint32 i = 0; i < v8_array->Length(); ++i) { - v8::TryCatch try_catch; + v8::TryCatch try_catch(context->GetIsolate()); v8::Local<v8::Value> child_v8 = v8_array->Get(i); if (try_catch.HasCaught()) return false; @@ -573,7 +573,7 @@ bool V8VarConverter::FromV8ValueInternal( v8::String::Utf8Value name_utf8(key_string); - v8::TryCatch try_catch; + v8::TryCatch try_catch(context->GetIsolate()); v8::Local<v8::Value> child_v8 = v8_object->Get(key); if (try_catch.HasCaught()) return false; diff --git a/extensions/renderer/activity_log_converter_strategy.cc b/extensions/renderer/activity_log_converter_strategy.cc index 3a8d612..1e32832 100644 --- a/extensions/renderer/activity_log_converter_strategy.cc +++ b/extensions/renderer/activity_log_converter_strategy.cc @@ -17,7 +17,7 @@ namespace { // "[HTMLElement]"). scoped_ptr<base::Value> SummarizeV8Value(v8::Isolate* isolate, v8::Local<v8::Object> object) { - v8::TryCatch try_catch; + v8::TryCatch try_catch(isolate); v8::Isolate::DisallowJavascriptExecutionScope scope( isolate, v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE); v8::Local<v8::String> name = v8::String::NewFromUtf8(isolate, "["); diff --git a/extensions/renderer/utils_native_handler.cc b/extensions/renderer/utils_native_handler.cc index 49ff32a..35b39eb 100644 --- a/extensions/renderer/utils_native_handler.cc +++ b/extensions/renderer/utils_native_handler.cc @@ -73,7 +73,7 @@ void UtilsNativeHandler::CreateClassWrapper( superclass}; v8::Local<v8::Value> result; { - v8::TryCatch try_catch; + v8::TryCatch try_catch(GetIsolate()); try_catch.SetCaptureMessage(true); result = context()->CallFunction(func, arraysize(func_args), func_args); if (try_catch.HasCaught()) { diff --git a/third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp b/third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp index beeab2e..8eefc3d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp @@ -70,7 +70,7 @@ bool CustomElementConstructorBuilder::validateOptions(const AtomicString& type, { ASSERT(m_prototype.IsEmpty()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(m_scriptState->isolate()); if (!m_scriptState->perContextData()) { // FIXME: This should generate an InvalidContext exception at a later point. @@ -130,7 +130,7 @@ PassRefPtrWillBeRawPtr<CustomElementLifecycleCallbacks> CustomElementConstructor { ASSERT(!m_prototype.IsEmpty()); - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(m_scriptState->isolate()); exceptionCatcher.SetVerbose(true); v8::MaybeLocal<v8::Function> created = retrieveCallback("createdCallback"); diff --git a/third_party/WebKit/Source/bindings/core/v8/NPV8Object.cpp b/third_party/WebKit/Source/bindings/core/v8/NPV8Object.cpp index 7ddba71..0854303 100644 --- a/third_party/WebKit/Source/bindings/core/v8/NPV8Object.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/NPV8Object.cpp @@ -255,7 +255,7 @@ bool _NPN_Invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPV return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::Object> v8Object = v8::Local<v8::Object>::New(isolate, v8NpObject->v8Object); v8::Local<v8::Value> functionObject; @@ -308,7 +308,7 @@ bool _NPN_InvokeDefault(NPP npp, NPObject* npObject, const NPVariant* arguments, return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); // Lookup the function object and call it. v8::Local<v8::Object> functionObject = v8::Local<v8::Object>::New(isolate, v8NpObject->v8Object); @@ -359,7 +359,7 @@ bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); // FIXME: Is this branch still needed after switching to using UserGestureIndicator? String filename; @@ -394,7 +394,7 @@ bool _NPN_GetProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName, NP return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object); v8::Local<v8::Value> v8result; @@ -426,7 +426,7 @@ bool _NPN_SetProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName, co return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object); return v8CallBoolean(obj->Set(scriptState->context(), npIdentifierToV8Identifier(isolate, propertyName), convertNPVariantToV8Object(isolate, value, object->rootObject->frame()->script().windowScriptNPObject()))); @@ -452,7 +452,7 @@ bool _NPN_RemoveProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName) if (!scriptState) return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object); // FIXME: Verify that setting to undefined is right. @@ -470,7 +470,7 @@ bool _NPN_HasProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName) if (!scriptState) return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(scriptState->isolate(), object->v8Object); return v8CallBoolean(obj->Has(scriptState->context(), npIdentifierToV8Identifier(scriptState->isolate(), propertyName))); @@ -492,7 +492,7 @@ bool _NPN_HasMethod(NPP npp, NPObject* npObject, NPIdentifier methodName) if (!scriptState) return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object); v8::Local<v8::Value> prop; @@ -521,7 +521,7 @@ void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) return; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); V8ThrowException::throwGeneralError(isolate, message); } @@ -536,7 +536,7 @@ bool _NPN_Enumerate(NPP npp, NPObject* npObject, NPIdentifier** identifier, uint if (!scriptState) return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(scriptState->isolate()); v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(scriptState->isolate(), object->v8Object); @@ -592,7 +592,7 @@ bool _NPN_Construct(NPP npp, NPObject* npObject, const NPVariant* arguments, uin if (!scriptState) return false; ScriptState::Scope scope(scriptState); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(scriptState->isolate()); // Lookup the constructor function. v8::Local<v8::Object> ctorObj = v8::Local<v8::Object>::New(scriptState->isolate(), object->v8Object); diff --git a/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp index d6dd87f..1963ed7 100644 --- a/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp @@ -47,11 +47,11 @@ static void importFunction(const v8::FunctionCallbackInfo<v8::Value>& args); static v8::Local<v8::Value> compileAndRunPrivateScript(ScriptState* scriptState, String scriptClassName, const char* source, size_t size) { - v8::TryCatch block; + v8::Isolate* isolate = scriptState->isolate(); + v8::TryCatch block(isolate); String sourceString(source, size); String fileName = scriptClassName + ".js"; - v8::Isolate* isolate = scriptState->isolate(); v8::Local<v8::Context> context = scriptState->context(); v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Value> privateScriptController = global->Get(context, v8String(isolate, "privateScriptController")).ToLocalChecked(); @@ -192,10 +192,10 @@ static void initializeHolderIfNeeded(ScriptState* scriptState, v8::Local<v8::Obj v8::Local<v8::Context> context = scriptState->context(); v8::Local<v8::Value> isInitialized = V8HiddenValue::getHiddenValue(scriptState, holderObject, V8HiddenValue::privateScriptObjectIsInitialized(isolate)); if (isInitialized.IsEmpty()) { - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Value> initializeFunction; if (classObject->Get(scriptState->context(), v8String(isolate, "initialize")).ToLocal(&initializeFunction) && initializeFunction->IsFunction()) { - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Value> result; if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(initializeFunction), scriptState->executionContext(), holder, 0, 0, isolate).ToLocal(&result)) { fprintf(stderr, "Private script error: Object constructor threw an exception.\n"); @@ -304,7 +304,7 @@ v8::Local<v8::Value> PrivateScriptRunner::runDOMAttributeGetter(ScriptState* scr RELEASE_ASSERT_NOT_REACHED(); } initializeHolderIfNeeded(scriptState, classObject, holder); - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Value> result; if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(getter), scriptState->executionContext(), holder, 0, 0, isolate).ToLocal(&result)) { rethrowExceptionInPrivateScript(isolate, block, scriptStateInUserScript, ExceptionState::GetterContext, attributeName, className); @@ -330,7 +330,7 @@ bool PrivateScriptRunner::runDOMAttributeSetter(ScriptState* scriptState, Script } initializeHolderIfNeeded(scriptState, classObject, holder); v8::Local<v8::Value> argv[] = { v8Value }; - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Value> result; if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(setter), scriptState->executionContext(), holder, WTF_ARRAY_LENGTH(argv), argv, isolate).ToLocal(&result)) { rethrowExceptionInPrivateScript(isolate, block, scriptStateInUserScript, ExceptionState::SetterContext, attributeName, className); @@ -349,7 +349,7 @@ v8::Local<v8::Value> PrivateScriptRunner::runDOMMethod(ScriptState* scriptState, RELEASE_ASSERT_NOT_REACHED(); } initializeHolderIfNeeded(scriptState, classObject, holder); - v8::TryCatch block; + v8::TryCatch block(scriptState->isolate()); v8::Local<v8::Value> result; if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(method), scriptState->executionContext(), holder, argc, argv, scriptState->isolate()).ToLocal(&result)) { rethrowExceptionInPrivateScript(scriptState->isolate(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, methodName, className); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp index c39597d..79ee02a 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp @@ -175,7 +175,7 @@ v8::Local<v8::Value> ScriptController::executeScriptAndReturnValue(v8::Local<v8: // the code. These exceptions should not interfere with // javascript code we might evaluate from C++ when returning // from here. - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate()); tryCatch.SetVerbose(true); v8::Local<v8::Script> script; diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptFunctionCall.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptFunctionCall.cpp index 2b2debe..607eb0d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptFunctionCall.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptFunctionCall.cpp @@ -92,7 +92,7 @@ ScriptFunctionCall::ScriptFunctionCall(const ScriptValue& thisObject, const Stri ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions) { ScriptState::Scope scope(m_scriptState.get()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(m_scriptState->isolate()); tryCatch.SetVerbose(reportExceptions); ScriptValue result = callWithoutExceptionHandling(); @@ -131,7 +131,7 @@ ScriptValue ScriptFunctionCall::callWithoutExceptionHandling() v8::Local<v8::Function> ScriptFunctionCall::function() { - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(m_scriptState->isolate()); v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_thisObject.v8Value()); v8::Local<v8::Value> value; if (!thisObject->Get(m_scriptState->context(), v8String(m_scriptState->isolate(), m_name)).ToLocal(&value)) diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp index 1861056..8365826 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp @@ -108,7 +108,7 @@ protected: TEST_F(ScriptPromiseTest, constructFromNonPromise) { - v8::TryCatch trycatch; + v8::TryCatch trycatch(isolate()); ScriptPromise promise(scriptState(), v8::Undefined(isolate())); ASSERT_TRUE(trycatch.HasCaught()); ASSERT_TRUE(promise.isEmpty()); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptRegexp.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptRegexp.cpp index 9a357a4..f10b2c0 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptRegexp.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptRegexp.cpp @@ -42,7 +42,7 @@ ScriptRegexp::ScriptRegexp(const String& pattern, TextCaseSensitivity caseSensit v8::HandleScope handleScope(isolate); v8::Local<v8::Context> context = V8PerIsolateData::from(isolate)->ensureScriptRegexpContext(); v8::Context::Scope contextScope(context); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); unsigned flags = v8::RegExp::kNone; if (caseSensitivity == TextCaseInsensitive) @@ -73,7 +73,7 @@ int ScriptRegexp::match(const String& string, int startFrom, int* matchLength) c v8::HandleScope handleScope(isolate); v8::Local<v8::Context> context = V8PerIsolateData::from(isolate)->ensureScriptRegexpContext(); v8::Context::Scope contextScope(context); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::RegExp> regex = m_regex.newLocal(isolate); v8::Local<v8::Value> exec; diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp index c46fdd37..4f2a24c 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp @@ -166,7 +166,7 @@ TEST_F(ScriptStreamingTest, CompilingStreamedScript) ScriptSourceCode sourceCode = pendingScript().getSource(KURL(), errorOccurred); EXPECT_FALSE(errorOccurred); EXPECT_TRUE(sourceCode.streamer()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate()); v8::Local<v8::Script> script; EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&script)); EXPECT_FALSE(tryCatch.HasCaught()); @@ -199,7 +199,7 @@ TEST_F(ScriptStreamingTest, CompilingStreamedScriptWithParseError) ScriptSourceCode sourceCode = pendingScript().getSource(KURL(), errorOccurred); EXPECT_FALSE(errorOccurred); EXPECT_TRUE(sourceCode.streamer()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate()); v8::Local<v8::Script> script; EXPECT_FALSE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&script)); EXPECT_TRUE(tryCatch.HasCaught()); @@ -330,7 +330,7 @@ TEST_F(ScriptStreamingTest, ScriptsWithSmallFirstChunk) ScriptSourceCode sourceCode = pendingScript().getSource(KURL(), errorOccurred); EXPECT_FALSE(errorOccurred); EXPECT_TRUE(sourceCode.streamer()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate()); v8::Local<v8::Script> script; EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&script)); EXPECT_FALSE(tryCatch.HasCaught()); @@ -358,7 +358,7 @@ TEST_F(ScriptStreamingTest, EncodingChanges) ScriptSourceCode sourceCode = pendingScript().getSource(KURL(), errorOccurred); EXPECT_FALSE(errorOccurred); EXPECT_TRUE(sourceCode.streamer()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate()); v8::Local<v8::Script> script; EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&script)); EXPECT_FALSE(tryCatch.HasCaught()); @@ -386,7 +386,7 @@ TEST_F(ScriptStreamingTest, EncodingFromBOM) ScriptSourceCode sourceCode = pendingScript().getSource(KURL(), errorOccurred); EXPECT_FALSE(errorOccurred); EXPECT_TRUE(sourceCode.streamer()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate()); v8::Local<v8::Script> script; EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&script)); EXPECT_FALSE(tryCatch.HasCaught()); diff --git a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp index 8e5e2df..33f7289 100644 --- a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp @@ -21,7 +21,7 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValueFactory::create(v8::Isola ScriptValueSerializer::Status status; String errorMessage; { - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); status = doSerialize(value, writer, messagePorts, arrayBuffers, imageBitmaps, blobInfo, serializedValue.get(), tryCatch, errorMessage, isolate); if (status == ScriptValueSerializer::JSException) { // If there was a JS exception thrown, re-throw it. diff --git a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp index 524680e..0775e08 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp @@ -125,7 +125,7 @@ void V8AbstractEventListener::invokeEventHandler(ScriptState* scriptState, Event v8::Local<v8::Value> returnValue; { // Catch exceptions thrown in the event handler so they do not propagate to javascript code that caused the event to fire. - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate()); tryCatch.SetVerbose(true); // Save the old 'event' property so we can restore it later. diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp index f6b3480..7db1204 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp @@ -114,7 +114,7 @@ PassRefPtrWillBeRawPtr<NodeFilter> toNodeFilter(v8::Local<v8::Value> callback, v bool toBooleanSlow(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { ASSERT(!value->IsBoolean()); - v8::TryCatch block; + v8::TryCatch block(isolate); bool result = false; if (!v8Call(value->BooleanValue(isolate->GetCurrentContext()), result, block)) exceptionState.rethrowV8Exception(block.Exception()); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h index 3beee93..0f847a5 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h @@ -608,7 +608,7 @@ Vector<RefPtr<T>> toRefPtrNativeArrayUnchecked(v8::Local<v8::Value> v8Value, uin Vector<RefPtr<T>> result; result.reserveInitialCapacity(length); v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value); - v8::TryCatch block; + v8::TryCatch block(isolate); for (uint32_t i = 0; i < length; ++i) { v8::Local<v8::Value> element; if (!v8Call(object->Get(isolate->GetCurrentContext(), i), element, block)) { @@ -672,7 +672,7 @@ WillBeHeapVector<RefPtrWillBeMember<T>> toRefPtrWillBeMemberNativeArray(v8::Loca WillBeHeapVector<RefPtrWillBeMember<T>> result; result.reserveInitialCapacity(length); v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value); - v8::TryCatch block; + v8::TryCatch block(isolate); for (uint32_t i = 0; i < length; ++i) { v8::Local<v8::Value> element; if (!v8Call(object->Get(isolate->GetCurrentContext(), i), element, block)) { @@ -706,7 +706,7 @@ WillBeHeapVector<RefPtrWillBeMember<T>> toRefPtrWillBeMemberNativeArray(v8::Loca WillBeHeapVector<RefPtrWillBeMember<T>> result; result.reserveInitialCapacity(length); v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value); - v8::TryCatch block; + v8::TryCatch block(isolate); for (uint32_t i = 0; i < length; ++i) { v8::Local<v8::Value> element; if (!v8Call(object->Get(isolate->GetCurrentContext(), i), element, block)) { @@ -740,7 +740,7 @@ HeapVector<Member<T>> toMemberNativeArray(v8::Local<v8::Value> value, int argume HeapVector<Member<T>> result; result.reserveInitialCapacity(length); v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value); - v8::TryCatch block; + v8::TryCatch block(isolate); for (uint32_t i = 0; i < length; ++i) { v8::Local<v8::Value> element; if (!v8Call(object->Get(isolate->GetCurrentContext(), i), element, block)) { @@ -783,7 +783,7 @@ VectorType toImplArray(v8::Local<v8::Value> value, int argumentIndex, v8::Isolat VectorType result; result.reserveInitialCapacity(length); v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value); - v8::TryCatch block; + v8::TryCatch block(isolate); for (uint32_t i = 0; i < length; ++i) { v8::Local<v8::Value> element; if (!v8Call(object->Get(isolate->GetCurrentContext(), i), element, block)) { @@ -851,7 +851,7 @@ inline bool toV8Sequence(v8::Local<v8::Value> value, uint32_t& length, v8::Isola // FIXME: The specification states that the length property should be used as fallback, if value // is not a platform object that supports indexed properties. If it supports indexed properties, // length should actually be one greater than value's maximum indexed property index. - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Value> lengthValue; if (!v8Call(object->Get(isolate->GetCurrentContext(), lengthSymbol), lengthValue, block)) { exceptionState.rethrowV8Exception(block.Exception()); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp b/third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp index bd89e95..3de51b5 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp @@ -169,7 +169,7 @@ void V8CustomElementLifecycleCallbacks::created(Element* element) if (callback.IsEmpty()) return; - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); ScriptController::callFunction(executionContext(), callback, receiver, 0, 0, isolate); } @@ -211,7 +211,7 @@ void V8CustomElementLifecycleCallbacks::attributeChanged(Element* element, const newValue.isNull() ? v8::Local<v8::Value>(v8::Null(isolate)) : v8::Local<v8::Value>(v8String(isolate, newValue)) }; - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); ScriptController::callFunction(executionContext(), callback, receiver, WTF_ARRAY_LENGTH(argv), argv, isolate); } @@ -237,7 +237,7 @@ void V8CustomElementLifecycleCallbacks::call(const ScopedPersistent<v8::Function if (receiver.IsEmpty()) return; - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); ScriptController::callFunction(executionContext(), callback, receiver, 0, 0, isolate); } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp index 64f5741..ff6942a 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp @@ -72,7 +72,7 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptState* scriptSta error = v8::Null(isolate()); v8::Local<v8::Value> parameters[5] = { v8String(isolate(), errorEvent->message()), v8String(isolate(), errorEvent->filename()), v8::Integer::New(isolate(), errorEvent->lineno()), v8::Integer::New(isolate(), errorEvent->colno()), error }; - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate()); tryCatch.SetVerbose(true); v8::MaybeLocal<v8::Value> result; if (scriptState->executionContext()->isWorkerGlobalScope()) { diff --git a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp index 4a9b24b..e0f7268 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp @@ -78,7 +78,7 @@ void V8MutationCallback::call(const WillBeHeapVector<RefPtrWillBeMember<Mutation return; v8::Local<v8::Value> argv[] = { v8Mutations, observerHandle }; - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); ScriptController::callFunction(executionContext(), m_callback.newLocal(isolate), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp b/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp index 886617f..45e5517 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp @@ -68,7 +68,7 @@ unsigned V8NodeFilterCondition::acceptNode(Node* node, ExceptionState& exception if (filter.IsEmpty()) return NodeFilter::FILTER_ACCEPT; - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(isolate); v8::Local<v8::Function> callback; v8::Local<v8::Value> receiver; diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp index 0e10a7e..0113dea 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp @@ -57,7 +57,7 @@ void V8PerformanceObserverCallback::handleEvent(PerformanceObserverEntryList* en } v8::Local<v8::Value> argv[] = { entriesHandle, observerHandle }; - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(m_scriptState->isolate()); exceptionCatcher.SetVerbose(true); ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), thisObject, 2, argv, m_scriptState->isolate()); } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp index 56dbc54..03f6877 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp @@ -75,7 +75,7 @@ v8::Local<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate, sanitizedCreationContext = scriptState->context()->Global(); } - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); DOMException* domException = DOMException::create(ec, sanitizedMessage, unsanitizedMessage); v8::Local<v8::Value> exception = toV8(domException, sanitizedCreationContext, isolate); diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/WorkerScriptController.cpp index b83ceb6..c8c4c4e 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WorkerScriptController.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WorkerScriptController.cpp @@ -193,7 +193,7 @@ ScriptValue WorkerScriptController::evaluate(const String& script, const String& m_disableEvalPending = String(); } - v8::TryCatch block; + v8::TryCatch block(isolate()); v8::Local<v8::Script> compiledScript; v8::MaybeLocal<v8::Value> maybeResult; diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8CustomXPathNSResolver.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8CustomXPathNSResolver.cpp index 896ec40..e3e0fdc 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8CustomXPathNSResolver.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8CustomXPathNSResolver.cpp @@ -74,7 +74,7 @@ AtomicString V8CustomXPathNSResolver::lookupNamespaceURI(const String& prefix) } // Catch exceptions from calling the namespace resolver. - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); tryCatch.SetVerbose(true); // Print exceptions to console. const int argc = 1; diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp index be37420..c8ea896 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp @@ -86,7 +86,7 @@ void V8XMLHttpRequest::responseAttributeGetterCustom(const v8::FunctionCallbackI // Catch syntax error. Swallows an exception (when thrown) as the // spec says. https://xhr.spec.whatwg.org/#response-body - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(isolate); v8::Local<v8::Value> json; if (v8Call(v8::JSON::Parse(isolate, jsonSource.v8Value()), json, exceptionCatcher)) v8SetReturnValue(info, json); diff --git a/third_party/WebKit/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp b/third_party/WebKit/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp index 9e208eb..52bf0dc 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp @@ -19,7 +19,7 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create ScriptValueSerializer::Status status; String errorMessage; { - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); status = SerializedScriptValueFactory::doSerialize(value, writer, messagePorts, arrayBuffers, imageBitmaps, blobInfo, serializedValue.get(), tryCatch, errorMessage, isolate); if (status == ScriptValueSerializer::JSException) { // If there was a JS exception thrown, re-throw it. diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp index aa8877c..82d593b 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp @@ -205,7 +205,7 @@ static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Local<v8::Value> IDBKey::KeyArray subkeys; uint32_t length = array->Length(); - v8::TryCatch block; + v8::TryCatch block(isolate); for (uint32_t i = 0; i < length; ++i) { v8::Local<v8::Value> item; if (!v8Call(array->Get(isolate->GetCurrentContext(), i), item, block)) { @@ -266,7 +266,7 @@ static IDBKey* createIDBKeyFromValueAndKeyPath(v8::Isolate* isolate, v8::Local<v v8::HandleScope handleScope(isolate); v8::Local<v8::Context> context = isolate->GetCurrentContext(); - v8::TryCatch block; + v8::TryCatch block(isolate); for (size_t i = 0; i < keyPathElements.size(); ++i) { if (v8Value->IsString() && keyPathElements[i] == "length") { int32_t length = v8Value.As<v8::String>()->Length(); diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp index 4720509..94e07db 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp @@ -66,7 +66,7 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr errorHandle }; - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); v8::Local<v8::Value> result; diff --git a/third_party/WebKit/Source/bindings/templates/callback_interface.cpp b/third_party/WebKit/Source/bindings/templates/callback_interface.cpp index 5bf4561..4af6611 100644 --- a/third_party/WebKit/Source/bindings/templates/callback_interface.cpp +++ b/third_party/WebKit/Source/bindings/templates/callback_interface.cpp @@ -63,7 +63,7 @@ DEFINE_TRACE({{v8_class}}) {% set this_handle_parameter = 'thisHandle, ' if method.call_with_this_handle else 'v8::Undefined(m_scriptState->isolate()), ' %} {% if method.idl_type == 'boolean' %} - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(m_scriptState->isolate()); exceptionCatcher.SetVerbose(true); ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate()); return !exceptionCatcher.HasCaught(); diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp index a4f38c4..3913d74 100644 --- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp +++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp @@ -32,7 +32,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ {% endif %} {# Declare local variables only when the dictionary has members to avoid unused variable warnings. #} {% if members %} - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Object> v8Object; if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block)) { exceptionState.rethrowV8Exception(block.Exception()); diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp index 03c19fa..aa03258 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp @@ -60,7 +60,7 @@ bool V8TestCallbackInterface::booleanMethod() ScriptState::Scope scope(m_scriptState.get()); v8::Local<v8::Value> *argv = 0; - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(m_scriptState->isolate()); exceptionCatcher.SetVerbose(true); ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 0, argv, m_scriptState->isolate()); return !exceptionCatcher.HasCaught(); diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp index 7ba52e9..9de0ed4 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp @@ -34,7 +34,7 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value return; } - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Object> v8Object; if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block)) { exceptionState.rethrowV8Exception(block.Exception()); diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp index 5538e4a..ce841ef 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp @@ -26,7 +26,7 @@ void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Loca if (exceptionState.hadException()) return; - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Object> v8Object; if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block)) { exceptionState.rethrowV8Exception(block.Exception()); diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp index 8c6be09..625e960 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp @@ -25,7 +25,7 @@ void V8TestInterfaceEventInit::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> if (exceptionState.hadException()) return; - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Object> v8Object; if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block)) { exceptionState.rethrowV8Exception(block.Exception()); diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp index 1e757ca..12893fc 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp @@ -20,7 +20,7 @@ void V8TestPermissiveDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Valu return; } - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Object> v8Object; if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block)) { exceptionState.rethrowV8Exception(block.Exception()); diff --git a/third_party/WebKit/Source/core/inspector/InjectedScript.cpp b/third_party/WebKit/Source/core/inspector/InjectedScript.cpp index 076bb23..61cbb3e 100644 --- a/third_party/WebKit/Source/core/inspector/InjectedScript.cpp +++ b/third_party/WebKit/Source/core/inspector/InjectedScript.cpp @@ -516,7 +516,7 @@ void InjectedScript::makeEvalCall(ErrorString* errorString, ScriptFunctionCall& void InjectedScript::makeCallWithExceptionDetails(ScriptFunctionCall& function, RefPtr<JSONValue>* result, RefPtr<TypeBuilder::Debugger::ExceptionDetails>* exceptionDetails) { ScriptState::Scope scope(injectedScriptObject().scriptState()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(injectedScriptObject().isolate()); ScriptValue resultValue = function.callWithoutExceptionHandling(); if (tryCatch.HasCaught()) { v8::Local<v8::Message> message = tryCatch.Message(); diff --git a/third_party/WebKit/Source/core/inspector/ScriptArguments.cpp b/third_party/WebKit/Source/core/inspector/ScriptArguments.cpp index 70125a1..769693d 100644 --- a/third_party/WebKit/Source/core/inspector/ScriptArguments.cpp +++ b/third_party/WebKit/Source/core/inspector/ScriptArguments.cpp @@ -62,6 +62,7 @@ private: V8ValueStringBuilder(v8::Isolate* isolate) : m_arrayLimit(maxArrayItemsLimit) , m_isolate(isolate) + , m_tryCatch(isolate) { } diff --git a/third_party/WebKit/Source/core/inspector/v8/JavaScriptCallFrame.cpp b/third_party/WebKit/Source/core/inspector/v8/JavaScriptCallFrame.cpp index bab3c22..d235585 100644 --- a/third_party/WebKit/Source/core/inspector/v8/JavaScriptCallFrame.cpp +++ b/third_party/WebKit/Source/core/inspector/v8/JavaScriptCallFrame.cpp @@ -181,7 +181,7 @@ v8::Local<v8::Value> JavaScriptCallFrame::evaluateWithExceptionDetails(v8::Local expression, scopeExtension }; - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(m_isolate); v8::Local<v8::Object> wrappedResult = v8::Object::New(m_isolate); v8::Local<v8::Value> result; if (V8ScriptRunner::callInternalFunction(evalFunction, callFrame, WTF_ARRAY_LENGTH(argv), argv, m_isolate).ToLocal(&result)) { diff --git a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp index d62a316..cea0985 100644 --- a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp +++ b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp @@ -930,7 +930,7 @@ void V8DebuggerAgentImpl::compileScript(ErrorString* errorString, const String& ScriptState::Scope scope(injectedScript.scriptState()); v8::Local<v8::String> source = v8String(m_isolate, expression); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(m_isolate); v8::Local<v8::Script> script; if (!v8Call(V8ScriptRunner::compileScript(source, sourceURL, String(), TextPosition(), m_isolate), script, tryCatch)) { v8::Local<v8::Message> message = tryCatch.Message(); @@ -976,7 +976,7 @@ void V8DebuggerAgentImpl::runScript(ErrorString* errorString, const ScriptId& sc *errorString = "Script execution failed"; return; } - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(m_isolate); v8::Local<v8::Value> value; ScriptValue scriptValue; if (v8Call(V8ScriptRunner::runCompiledScript(m_isolate, script, scriptState->executionContext()), value, tryCatch)) { diff --git a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp index f4ca12c..fdb4be8 100644 --- a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp +++ b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp @@ -382,7 +382,7 @@ bool V8DebuggerImpl::setScriptSource(const String& sourceID, const String& newCo v8::Local<v8::Value> v8result; { EnableLiveEditScope enableLiveEditScope(m_isolate); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(m_isolate); tryCatch.SetVerbose(false); v8::MaybeLocal<v8::Value> maybeResult = callDebuggerMethod("liveEditScriptSource", 3, argv); if (tryCatch.HasCaught()) { diff --git a/third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp b/third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp index c6d33dc..d479218 100644 --- a/third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp +++ b/third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp @@ -83,7 +83,7 @@ void V8InjectedScriptHost::internalConstructorNameCallback(const v8::FunctionCal if (!result.IsEmpty() && toCoreStringWithUndefinedOrNullCheck(result) == "Object") { v8::Local<v8::String> constructorSymbol = v8AtomicString(info.GetIsolate(), "constructor"); if (object->HasRealNamedProperty(constructorSymbol) && !object->HasRealNamedCallbackProperty(constructorSymbol)) { - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(info.GetIsolate()); v8::Local<v8::Value> constructor = object->GetRealNamedProperty(constructorSymbol); if (!constructor.IsEmpty() && constructor->IsFunction()) { v8::Local<v8::String> constructorName = functionDisplayName(v8::Local<v8::Function>::Cast(constructor)); @@ -325,7 +325,7 @@ void V8InjectedScriptHost::evalCallback(const v8::FunctionCallbackInfo<v8::Value } ASSERT(isolate->InContext()); - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::Value> result; if (!v8Call(V8ScriptRunner::compileAndRunInternalScript(expression, info.GetIsolate()), result, tryCatch)) { v8SetReturnValue(info, tryCatch.ReThrow()); @@ -360,7 +360,7 @@ void V8InjectedScriptHost::evaluateWithExceptionDetailsCallback(const v8::Functi v8::Local<v8::Object> wrappedResult = v8::Object::New(isolate); if (wrappedResult.IsEmpty()) return; - v8::TryCatch tryCatch; + v8::TryCatch tryCatch(isolate); v8::Local<v8::Script> script; v8::Local<v8::Value> result; if (!v8Call(V8ScriptRunner::compileScript(expression, String(), String(), TextPosition(), isolate), script, tryCatch)) { diff --git a/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp b/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp index 7efd009..2d8ad71 100644 --- a/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp +++ b/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp @@ -195,7 +195,7 @@ void CryptoResultImpl::completeWithJson(const char* utf8Data, unsigned length) v8::Local<v8::String> jsonString = v8AtomicString(scriptState->isolate(), utf8Data, length); - v8::TryCatch exceptionCatcher; + v8::TryCatch exceptionCatcher(scriptState->isolate()); v8::Local<v8::Value> jsonDictionary; if (v8Call(v8::JSON::Parse(scriptState->isolate(), jsonString), jsonDictionary, exceptionCatcher)) m_resolver->resolve(jsonDictionary); diff --git a/third_party/WebKit/Source/modules/fetch/Body.cpp b/third_party/WebKit/Source/modules/fetch/Body.cpp index c23beff..aa16605 100644 --- a/third_party/WebKit/Source/modules/fetch/Body.cpp +++ b/third_party/WebKit/Source/modules/fetch/Body.cpp @@ -91,7 +91,7 @@ public: ScriptState::Scope scope(resolver()->scriptState()); v8::Isolate* isolate = resolver()->scriptState()->isolate(); v8::Local<v8::String> inputString = v8String(isolate, string); - v8::TryCatch trycatch; + v8::TryCatch trycatch(isolate); v8::Local<v8::Value> parsed; if (v8Call(v8::JSON::Parse(isolate, inputString), parsed, trycatch)) resolver()->resolve(parsed); diff --git a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp index 00b4101..8add6b5 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp @@ -78,7 +78,7 @@ ScriptValue PushMessageData::json(ScriptState* scriptState, ExceptionState& exce ScriptState::Scope scope(scriptState); v8::Local<v8::String> dataString = v8String(isolate, text()); - v8::TryCatch block; + v8::TryCatch block(isolate); v8::Local<v8::Value> parsed; if (!v8Call(v8::JSON::Parse(isolate, dataString), parsed, block)) { exceptionState.rethrowV8Exception(block.Exception()); |