Commit 69d47576 authored by raymes's avatar raymes Committed by Commit bot

Check whether a number is passed as an argument to kJSSetZoomLevel rather than a double.

In the in-process PDF plugin when checking the argument type of kJSSetZoomLevel
calls to the plugin we would check if the argument is a double. But it may be
an int and we really want to check if it's a number. This probably worked in
the past by chance and broke when we switched to using gin to implement JS
bindings for Pepper.

BUG=413525

Review URL: https://codereview.chromium.org/569403004

Cr-Commit-Position: refs/heads/master@{#295008}
parent f7d19a3d
...@@ -1768,7 +1768,7 @@ pp::Var Instance::CallScriptableMethod(const pp::Var& method, ...@@ -1768,7 +1768,7 @@ pp::Var Instance::CallScriptableMethod(const pp::Var& method,
return pp::Var(); return pp::Var();
} }
if (method_str == kJSSetZoomLevel) { if (method_str == kJSSetZoomLevel) {
if (args.size() == 1 && args[0].is_double()) if (args.size() == 1 && args[0].is_number())
SetZoom(ZOOM_SCALE, args[0].AsDouble()); SetZoom(ZOOM_SCALE, args[0].AsDouble());
return pp::Var(); return pp::Var();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment