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

Unified Diff: extensions/renderer/user_gestures_native_handler.cc

Issue 2454433002: [Extensions + Blink] Account for user gesture in v8 function calls (Closed)
Patch Set: whoops Created 4 years, 2 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/user_gestures_native_handler.cc
diff --git a/extensions/renderer/user_gestures_native_handler.cc b/extensions/renderer/user_gestures_native_handler.cc
index 6d310949f3b2ccfb9ee2bdc8451a09cf803c025e..d4665c2a7871c94302e802fe367d4af568460a35 100644
--- a/extensions/renderer/user_gestures_native_handler.cc
+++ b/extensions/renderer/user_gestures_native_handler.cc
@@ -39,8 +39,8 @@ void UserGesturesNativeHandler::RunWithUserGesture(
blink::WebScopedUserGesture user_gesture(context()->web_frame());
CHECK_EQ(args.Length(), 1);
CHECK(args[0]->IsFunction());
- v8::Local<v8::Value> no_args;
- context()->CallFunction(v8::Local<v8::Function>::Cast(args[0]), 0, &no_args);
+ context()->CallFunctionSafe(v8::Local<v8::Function>::Cast(args[0]), 0,
haraken 2016/10/28 08:45:14 Where is CallFunctionSafe defined? I couldn't find
Devlin 2016/10/28 15:00:05 D'oh - this is supposed to be SafeCallFunction() (
+ nullptr);
}
void UserGesturesNativeHandler::RunWithoutUserGesture(
@@ -49,7 +49,8 @@ void UserGesturesNativeHandler::RunWithoutUserGesture(
CHECK_EQ(args.Length(), 1);
CHECK(args[0]->IsFunction());
v8::Local<v8::Value> no_args;
- context()->CallFunction(v8::Local<v8::Function>::Cast(args[0]), 0, &no_args);
+ context()->CallFunctionSafe(v8::Local<v8::Function>::Cast(args[0]), 0,
+ nullptr);
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698