Chromium Code Reviews| Index: ppapi/host/error_conversion.cc |
| diff --git a/ppapi/host/error_conversion.cc b/ppapi/host/error_conversion.cc |
| index e84c7e5d4ecc4427575dcc164a5d0320906e5c8c..f7e5ea530edb24888d430be6e105b01a16a9b179 100644 |
| --- a/ppapi/host/error_conversion.cc |
| +++ b/ppapi/host/error_conversion.cc |
| @@ -4,6 +4,9 @@ |
| #include "ppapi/host/error_conversion.h" |
| +#include <limits> |
| + |
| +#include "base/logging.h" |
| #include "net/base/net_errors.h" |
| #include "ppapi/c/pp_errors.h" |
| @@ -11,8 +14,10 @@ namespace ppapi { |
| namespace host { |
| int32_t NetErrorToPepperError(int net_error) { |
| - if (net_error > 0) |
| + if (net_error > 0) { |
| + CHECK_LE(net_error, std::numeric_limits<int32_t>::max()); |
|
bbudge
2013/06/18 14:54:37
Should we crash the browser process?
Why not use b
yzshen1
2013/06/18 16:39:16
I think it should be fine, because having a positi
|
| return static_cast<int32_t>(net_error); |
| + } |
| switch (net_error) { |
| case net::OK: |