OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_error_util.h" |
| 6 |
| 7 #include "third_party/ppapi/c/pp_errors.h" |
| 8 |
| 9 namespace pepper { |
| 10 |
| 11 int PlatformFileErrorToPepperError(base::PlatformFileError error_code) { |
| 12 switch (error_code) { |
| 13 case base::PLATFORM_FILE_OK: |
| 14 return PP_OK; |
| 15 case base::PLATFORM_FILE_ERROR_EXISTS: |
| 16 return PP_ERROR_FILEEXISTS; |
| 17 case base::PLATFORM_FILE_ERROR_NOT_FOUND: |
| 18 return PP_ERROR_FILENOTFOUND; |
| 19 case base::PLATFORM_FILE_ERROR_ACCESS_DENIED: |
| 20 return PP_ERROR_NOACCESS; |
| 21 case base::PLATFORM_FILE_ERROR_NO_MEMORY: |
| 22 return PP_ERROR_NOMEMORY; |
| 23 case base::PLATFORM_FILE_ERROR_NO_SPACE: |
| 24 return PP_ERROR_NOSPACE; |
| 25 case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY: |
| 26 return PP_ERROR_FAILED; |
| 27 default: |
| 28 return PP_ERROR_FAILED; |
| 29 } |
| 30 } |
| 31 |
| 32 } // namespace pepper |
OLD | NEW |