DEPS | 2 +- extensions/renderer/module_system.cc | 14 ++++++++++---- .../WebKit/Source/bindings/core/v8/ScriptPromise.cpp | 11 ++++++++--- .../Source/bindings/core/v8/ScriptPromisePropertyBase.cpp | 4 ++-- third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp | 5 ++++- .../bindings/core/v8/V8PagePopupControllerBinding.cpp | 6 ++++-- third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp | 8 ++++++-- .../Source/bindings/core/v8/custom/V8WindowCustom.cpp | 2 +- 8 files changed, 36 insertions(+), 16 deletions(-) diff --git a/DEPS b/DEPS index 2dd45816..a07b80e 100644 --- a/DEPS +++ b/DEPS @@ -154,7 +154,7 @@ deps = { Var('chromium_git') + '/external/swarming.client.git' + '@' + Var('swarming_revision'), 'src/v8': - Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), + "git@github.com:danbev/v8.git@064718a8921608eaf9b5eadbb7d734ec04068a87", 'src/native_client': Var('chromium_git') + '/native_client/src/native_client.git' + '@' + Var('nacl_revision'), diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc index 4665d75..ae2c9f9 100644 --- a/extensions/renderer/module_system.cc +++ b/extensions/renderer/module_system.cc @@ -457,7 +457,9 @@ void ModuleSystem::LazyFieldGetterInner( v8::Local<v8::Value> val = info.This(); if (val->IsObject()) { v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(val); - object->Delete(context, property); + if (object->Delete(context, property).IsNothing()) { + //TODO: What action, if any, should be taken here? + } SetProperty(context, object, property, new_field); } else { NOTREACHED(); @@ -577,8 +579,10 @@ void ModuleSystem::RequireAsync( gin::ModuleRegistry::From(v8_context); if (!module_registry) { Warn(GetIsolate(), "Extension view no longer exists"); - resolver->Reject(v8_context, v8::Exception::Error(ToV8StringUnsafe( - GetIsolate(), "Extension view no longer exists"))); + if (resolver->Reject(v8_context, v8::Exception::Error(ToV8StringUnsafe( + GetIsolate(), "Extension view no longer exists"))).IsNothing()) { + // TODO: What action, if any, should be taken here? + } return; } module_registry->LoadModule( @@ -752,7 +756,9 @@ void ModuleSystem::OnModuleLoaded( v8::HandleScope handle_scope(GetIsolate()); v8::Local<v8::Promise::Resolver> resolver_local( v8::Local<v8::Promise::Resolver>::New(GetIsolate(), *resolver)); - resolver_local->Resolve(context()->v8_context(), value); + if (resolver_local->Resolve(context()->v8_context(), value).IsNothing()) { + // TODO: What action, if any, should be taken here? + } } void ModuleSystem::ClobberExistingNativeHandler(const std::string& name) { diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp index 35322d3..39c8188 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp @@ -183,7 +183,9 @@ void ScriptPromise::InternalResolver::resolve(v8::Local<v8::Value> value) { if (m_resolver.isEmpty()) return; - m_resolver.v8Value().As<v8::Promise::Resolver>()->Resolve(m_resolver.context(), value); + if (m_resolver.v8Value().As<v8::Promise::Resolver>()->Resolve( + m_resolver.context(), value).IsNothing()) + return; clear(); } @@ -191,7 +193,9 @@ void ScriptPromise::InternalResolver::reject(v8::Local<v8::Value> value) { if (m_resolver.isEmpty()) return; - m_resolver.v8Value().As<v8::Promise::Resolver>()->Reject(m_resolver.context(), value); + if (m_resolver.v8Value().As<v8::Promise::Resolver>()->Reject( + m_resolver.context(), value).IsNothing()) + return; clear(); } @@ -305,7 +309,8 @@ v8::Local<v8::Promise> ScriptPromise::rejectRaw(ScriptState* scriptState, v8::Lo if (!v8::Promise::Resolver::New(scriptState->context()).ToLocal(&resolver)) return v8::Local<v8::Promise>(); v8::Local<v8::Promise> promise = resolver->GetPromise(); - resolver->Reject(scriptState->context(), value); + if (resolver->Reject(scriptState->context(), value).IsNothing()) + return v8::Local<v8::Promise>(); return promise; } diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp index fa01f5f..dbf4830 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp @@ -113,10 +113,10 @@ void ScriptPromisePropertyBase::resolveOrRejectInternal(v8::Local<v8::Promise::R ASSERT_NOT_REACHED(); break; case Resolved: - resolver->Resolve(context, resolvedValue(m_isolate, context->Global())); + resolver->Resolve(context, resolvedValue(m_isolate, context->Global())).FromJust(); break; case Rejected: - resolver->Reject(context, rejectedValue(m_isolate, context->Global())); + resolver->Reject(context, rejectedValue(m_isolate, context->Global())).FromJust(); break; } } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp index 24cb6e6..77c3d8e 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp @@ -904,7 +904,10 @@ void removeHiddenValueFromArray(v8::Isolate* isolate, v8::Local<v8::Object> obje if (!array->Get(isolate->GetCurrentContext(), i).ToLocal(&item)) return; if (item->StrictEquals(value)) { - array->Delete(isolate->GetCurrentContext(), i); + if (array->Delete(isolate->GetCurrentContext(), i).IsNothing()) { + // TODO: Not sure if this should be logged or an error thrown or + // if it is fine to just return + } return; } } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp index e8c989c..df4bf6d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp @@ -40,10 +40,12 @@ void V8PagePopupControllerBinding::installPagePopupController(v8::Local<v8::Cont && ContextFeatures::pagePopupEnabled(toDocument(executionContext)))) return; - windowWrapper->SetAccessor( + if (windowWrapper->SetAccessor( context, v8AtomicString(context->GetIsolate(), "pagePopupController"), - pagePopupControllerAttributeGetterCallback); + pagePopupControllerAttributeGetterCallback).IsNothing()) { + // TODO: What action should, if any, should be taken here? + } } } // namespace blink diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp index c6cb296..c92cfb0 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp @@ -534,7 +534,9 @@ void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& nam v8::Local<v8::Context> context = m_scriptState->context(); v8::Local<v8::Object> documentHandle = m_document.newLocal(m_isolate); checkDocumentWrapper(documentHandle, document); - documentHandle->SetAccessor(context, v8String(m_isolate, name), getter); + if (documentHandle->SetAccessor(context, v8String(m_isolate, name), getter).IsNothing()) { + // TODO: What action, if any, should be taken here? + } } void WindowProxy::namedItemRemoved(HTMLDocument* document, const AtomicString& name) @@ -551,7 +553,9 @@ void WindowProxy::namedItemRemoved(HTMLDocument* document, const AtomicString& n ASSERT(!m_document.isEmpty()); v8::Local<v8::Object> documentHandle = m_document.newLocal(m_isolate); checkDocumentWrapper(documentHandle, document); - documentHandle->Delete(m_isolate->GetCurrentContext(), v8String(m_isolate, name)); + if (documentHandle->Delete(m_isolate->GetCurrentContext(), v8String(m_isolate, name)).IsNothing()) { + // TODO: What action, if any, should be taken here? + } } void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp index 730dd27..84a0297 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp @@ -144,7 +144,7 @@ void V8Window::openerAttributeSetterCustom(v8::Local<v8::Value> value, const v8: } // Delete the accessor from the inner object. - info.Holder()->Delete(isolate->GetCurrentContext(), v8AtomicString(isolate, "opener")); + if (info.Holder()->Delete(isolate->GetCurrentContext(), v8AtomicString(isolate, "opener")).IsNothing()) return; // Put property on the inner object. if (info.Holder()->IsObject()) { DEPS | 2 +- extensions/renderer/module_system.cc | 14 ++++++++++---- .../WebKit/Source/bindings/core/v8/ScriptPromise.cpp | 11 ++++++++--- .../Source/bindings/core/v8/ScriptPromisePropertyBase.cpp | 4 ++-- third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp | 5 ++++- .../bindings/core/v8/V8PagePopupControllerBinding.cpp | 6 ++++-- third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp | 8 ++++++-- .../Source/bindings/core/v8/custom/V8WindowCustom.cpp | 2 +- 8 files changed, 36 insertions(+), 16 deletions(-) diff --git a/DEPS b/DEPS index 2dd45816..a07b80e 100644 --- a/DEPS +++ b/DEPS @@ -154,7 +154,7 @@ deps = { Var('chromium_git') + '/external/swarming.client.git' + '@' + Var('swarming_revision'), 'src/v8': - Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), + "git@github.com:danbev/v8.git@064718a8921608eaf9b5eadbb7d734ec04068a87", 'src/native_client': Var('chromium_git') + '/native_client/src/native_client.git' + '@' + Var('nacl_revision'), diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc index 4665d75..ae2c9f9 100644 --- a/extensions/renderer/module_system.cc +++ b/extensions/renderer/module_system.cc @@ -457,7 +457,9 @@ void ModuleSystem::LazyFieldGetterInner( v8::Local<v8::Value> val = info.This(); if (val->IsObject()) { v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(val); - object->Delete(context, property); + if (object->Delete(context, property).IsNothing()) { + //TODO: What action, if any, should be taken here? + } SetProperty(context, object, property, new_field); } else { NOTREACHED(); @@ -577,8 +579,10 @@ void ModuleSystem::RequireAsync( gin::ModuleRegistry::From(v8_context); if (!module_registry) { Warn(GetIsolate(), "Extension view no longer exists"); - resolver->Reject(v8_context, v8::Exception::Error(ToV8StringUnsafe( - GetIsolate(), "Extension view no longer exists"))); + if (resolver->Reject(v8_context, v8::Exception::Error(ToV8StringUnsafe( + GetIsolate(), "Extension view no longer exists"))).IsNothing()) { + // TODO: What action, if any, should be taken here? + } return; } module_registry->LoadModule( @@ -752,7 +756,9 @@ void ModuleSystem::OnModuleLoaded( v8::HandleScope handle_scope(GetIsolate()); v8::Local<v8::Promise::Resolver> resolver_local( v8::Local<v8::Promise::Resolver>::New(GetIsolate(), *resolver)); - resolver_local->Resolve(context()->v8_context(), value); + if (resolver_local->Resolve(context()->v8_context(), value).IsNothing()) { + // TODO: What action, if any, should be taken here? + } } void ModuleSystem::ClobberExistingNativeHandler(const std::string& name) { diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp index 35322d3..39c8188 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp @@ -183,7 +183,9 @@ void ScriptPromise::InternalResolver::resolve(v8::Local<v8::Value> value) { if (m_resolver.isEmpty()) return; - m_resolver.v8Value().As<v8::Promise::Resolver>()->Resolve(m_resolver.context(), value); + if (m_resolver.v8Value().As<v8::Promise::Resolver>()->Resolve( + m_resolver.context(), value).IsNothing()) + return; clear(); } @@ -191,7 +193,9 @@ void ScriptPromise::InternalResolver::reject(v8::Local<v8::Value> value) { if (m_resolver.isEmpty()) return; - m_resolver.v8Value().As<v8::Promise::Resolver>()->Reject(m_resolver.context(), value); + if (m_resolver.v8Value().As<v8::Promise::Resolver>()->Reject( + m_resolver.context(), value).IsNothing()) + return; clear(); } @@ -305,7 +309,8 @@ v8::Local<v8::Promise> ScriptPromise::rejectRaw(ScriptState* scriptState, v8::Lo if (!v8::Promise::Resolver::New(scriptState->context()).ToLocal(&resolver)) return v8::Local<v8::Promise>(); v8::Local<v8::Promise> promise = resolver->GetPromise(); - resolver->Reject(scriptState->context(), value); + if (resolver->Reject(scriptState->context(), value).IsNothing()) + return v8::Local<v8::Promise>(); return promise; } diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp index fa01f5f..dbf4830 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp @@ -113,10 +113,10 @@ void ScriptPromisePropertyBase::resolveOrRejectInternal(v8::Local<v8::Promise::R ASSERT_NOT_REACHED(); break; case Resolved: - resolver->Resolve(context, resolvedValue(m_isolate, context->Global())); + resolver->Resolve(context, resolvedValue(m_isolate, context->Global())).FromJust(); break; case Rejected: - resolver->Reject(context, rejectedValue(m_isolate, context->Global())); + resolver->Reject(context, rejectedValue(m_isolate, context->Global())).FromJust(); break; } } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp index 24cb6e6..77c3d8e 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp @@ -904,7 +904,10 @@ void removeHiddenValueFromArray(v8::Isolate* isolate, v8::Local<v8::Object> obje if (!array->Get(isolate->GetCurrentContext(), i).ToLocal(&item)) return; if (item->StrictEquals(value)) { - array->Delete(isolate->GetCurrentContext(), i); + if (array->Delete(isolate->GetCurrentContext(), i).IsNothing()) { + // TODO: Not sure if this should be logged or an error thrown or + // if it is fine to just return + } return; } } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp index e8c989c..df4bf6d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp @@ -40,10 +40,12 @@ void V8PagePopupControllerBinding::installPagePopupController(v8::Local<v8::Cont && ContextFeatures::pagePopupEnabled(toDocument(executionContext)))) return; - windowWrapper->SetAccessor( + if (windowWrapper->SetAccessor( context, v8AtomicString(context->GetIsolate(), "pagePopupController"), - pagePopupControllerAttributeGetterCallback); + pagePopupControllerAttributeGetterCallback).IsNothing()) { + // TODO: What action should, if any, should be taken here? + } } } // namespace blink diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp index c6cb296..c92cfb0 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp @@ -534,7 +534,9 @@ void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& nam v8::Local<v8::Context> context = m_scriptState->context(); v8::Local<v8::Object> documentHandle = m_document.newLocal(m_isolate); checkDocumentWrapper(documentHandle, document); - documentHandle->SetAccessor(context, v8String(m_isolate, name), getter); + if (documentHandle->SetAccessor(context, v8String(m_isolate, name), getter).IsNothing()) { + // TODO: What action, if any, should be taken here? + } } void WindowProxy::namedItemRemoved(HTMLDocument* document, const AtomicString& name) @@ -551,7 +553,9 @@ void WindowProxy::namedItemRemoved(HTMLDocument* document, const AtomicString& n ASSERT(!m_document.isEmpty()); v8::Local<v8::Object> documentHandle = m_document.newLocal(m_isolate); checkDocumentWrapper(documentHandle, document); - documentHandle->Delete(m_isolate->GetCurrentContext(), v8String(m_isolate, name)); + if (documentHandle->Delete(m_isolate->GetCurrentContext(), v8String(m_isolate, name)).IsNothing()) { + // TODO: What action, if any, should be taken here? + } } void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp index 730dd27..84a0297 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp @@ -144,7 +144,7 @@ void V8Window::openerAttributeSetterCustom(v8::Local<v8::Value> value, const v8: } // Delete the accessor from the inner object. - info.Holder()->Delete(isolate->GetCurrentContext(), v8AtomicString(isolate, "opener")); + if (info.Holder()->Delete(isolate->GetCurrentContext(), v8AtomicString(isolate, "opener")).IsNothing()) return; // Put property on the inner object. if (info.Holder()->IsObject()) {