Revert 271602 "Implementation of leveldb-backed PrefStore."
[chromium-blink-merge.git] / ppapi / proxy / error_conversion.cc
blobf3587ec671dbbd1fabcbe6552565ab980075d134
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.
5 #include "ppapi/proxy/error_conversion.h"
7 #include "ppapi/c/pp_errors.h"
9 namespace ppapi {
10 namespace proxy {
12 int32_t ConvertNetworkAPIErrorForCompatibility(int32_t pp_error,
13 bool private_api) {
14 // The private API doesn't return network-specific error codes or
15 // PP_ERROR_NOACCESS. In order to preserve the behavior, we convert those to
16 // PP_ERROR_FAILED.
17 if (private_api &&
18 (pp_error <= PP_ERROR_CONNECTION_CLOSED ||
19 pp_error == PP_ERROR_NOACCESS)) {
20 return PP_ERROR_FAILED;
22 return pp_error;
25 } // namespace proxy
26 } // namespace ppapi