OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ppapi/proxy/pp_utils.h" |
| 6 |
| 7 #include "ppapi/c/pp_errors.h" |
| 8 |
| 9 namespace ppapi { |
| 10 namespace proxy { |
| 11 |
| 12 int32_t ConvertPPError(int32_t pp_error, bool private_api) { |
| 13 // The private API doesn't return network-specific error codes or |
| 14 // PP_ERROR_NOACCESS. In order to preserve the behavior, we convert those to |
| 15 // PP_ERROR_FAILED. |
| 16 if (private_api && |
| 17 (pp_error <= PP_ERROR_CONNECTION_CLOSED || |
| 18 pp_error == PP_ERROR_NOACCESS)) { |
| 19 return PP_ERROR_FAILED; |
| 20 } |
| 21 return pp_error; |
| 22 } |
| 23 |
| 24 } // namespace proxy |
| 25 } // namespace ppapi |
OLD | NEW |