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

Unified Diff: extensions/renderer/send_request_natives.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/script_context.cc ('k') | extensions/renderer/set_icon_natives.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/send_request_natives.cc
diff --git a/extensions/renderer/send_request_natives.cc b/extensions/renderer/send_request_natives.cc
index 7e27523d5a9951b7ed0a22137076b957eca908fa..8579501ca0f7db3dbc11d910b2576e65cc5aae30 100644
--- a/extensions/renderer/send_request_natives.cc
+++ b/extensions/renderer/send_request_natives.cc
@@ -38,11 +38,13 @@ void SendRequestNatives::GetNextRequestId(
void SendRequestNatives::StartRequest(
const v8::FunctionCallbackInfo<v8::Value>& args) {
CHECK_EQ(6, args.Length());
+ CHECK(args[2]->IsInt32());
+ v8::Local<v8::Context> v8_context = context()->v8_context();
std::string name = *v8::String::Utf8Value(args[0]);
- int request_id = args[2]->Int32Value();
- bool has_callback = args[3]->BooleanValue();
- bool for_io_thread = args[4]->BooleanValue();
- bool preserve_null_in_objects = args[5]->BooleanValue();
+ int request_id = args[2].As<v8::Int32>()->Value();
+ bool has_callback = args[3]->BooleanValue(v8_context).FromJust();
+ bool for_io_thread = args[4]->BooleanValue(v8_context).FromJust();
+ bool preserve_null_in_objects = args[5]->BooleanValue(v8_context).FromJust();
scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
« no previous file with comments | « extensions/renderer/script_context.cc ('k') | extensions/renderer/set_icon_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698