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

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: 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
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system.cc
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index 4665d753f37c579d09e2afa60f64d4df60bb2d1c..ae2c9f93b3cd1b9fc3ab58c86b3594e244a43e0a 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()) {
jochen (gone - plz use gerrit) 2016/07/14 15:03:23 I'd just crash / add NOTREACHED()
+ //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) {
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698