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

Unified Diff: extensions/renderer/runtime_custom_bindings.cc

Issue 1167423002: Use V8 Maybe APIs in extensions/renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « extensions/renderer/resource_bundle_source_map.cc ('k') | extensions/renderer/safe_builtins.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/runtime_custom_bindings.cc
diff --git a/extensions/renderer/runtime_custom_bindings.cc b/extensions/renderer/runtime_custom_bindings.cc
index 483f08b7796d2f2c2f80634cf70a6d3ce9b1f680..29ae4f3443ccf815206f001c7aced5d5e3458eda 100644
--- a/extensions/renderer/runtime_custom_bindings.cc
+++ b/extensions/renderer/runtime_custom_bindings.cc
@@ -69,7 +69,7 @@ void RuntimeCustomBindings::OpenChannelToExtension(
info.source_url = context()->GetURL();
std::string channel_name = *v8::String::Utf8Value(args[1]);
bool include_tls_channel_id =
- args.Length() > 2 ? args[2]->BooleanValue() : false;
+ args.Length() > 2 ? args[2].As<v8::Boolean>()->Value() : false;
int port_id = -1;
renderframe->Send(new ExtensionHostMsg_OpenChannelToExtension(
renderframe->GetRoutingID(), info, channel_name, include_tls_channel_id,
@@ -126,7 +126,7 @@ void RuntimeCustomBindings::GetExtensionViews(
// |browser_window_id| == extension_misc::kUnknownWindowId means getting
// all views for the current extension.
- int browser_window_id = args[0]->Int32Value();
+ int browser_window_id = args[0].As<v8::Int32>()->Value();
std::string view_type_string = *v8::String::Utf8Value(args[1]);
StringToUpperASCII(&view_type_string);
@@ -165,7 +165,10 @@ void RuntimeCustomBindings::GetExtensionViews(
if (!context.IsEmpty()) {
v8::Local<v8::Value> window = context->Global();
DCHECK(!window.IsEmpty());
- v8_views->Set(v8::Integer::New(args.GetIsolate(), v8_index++), window);
+ auto maybe = v8_views->Set(
+ context, v8::Integer::New(args.GetIsolate(), v8_index++), window);
+ if (maybe.IsNothing() || !maybe.FromJust())
+ return;
}
}
« no previous file with comments | « extensions/renderer/resource_bundle_source_map.cc ('k') | extensions/renderer/safe_builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698