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

Unified Diff: extensions/renderer/module_system.cc

Issue 2144093002: Adding checks for V8 functions returning Maybe<bool> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding NOTREACHED if Delete result IsNothing for LazyFieldGetterInner Created 4 years, 5 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: extensions/renderer/module_system.cc
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index 4665d753f37c579d09e2afa60f64d4df60bb2d1c..e7b72fc7906499793363a9a5a209d06658f147ca 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()) {
+ NOTREACHED();
+ }
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?
haraken 2016/07/15 02:38:41 I think we should just crash.
+ }
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?
haraken 2016/07/15 02:38:40 Ditto.
+ }
}
void ModuleSystem::ClobberExistingNativeHandler(const std::string& name) {

Powered by Google App Engine
This is Rietveld 408576698