Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
| 6 #include "ppapi/c/private/ppb_flash_file.h" | 6 #include "ppapi/c/private/ppb_flash_file.h" |
| 7 #include "ppapi/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
| 8 #include "ppapi/thunk/ppb_flash_api.h" | 8 #include "ppapi/thunk/ppb_flash_api.h" |
| 9 #include "ppapi/thunk/ppb_instance_api.h" | 9 #include "ppapi/thunk/ppb_instance_api.h" |
| 10 #include "ppapi/thunk/thunk.h" | 10 #include "ppapi/thunk/thunk.h" |
| 11 | 11 |
| 12 namespace ppapi { | 12 namespace ppapi { |
| 13 namespace thunk { | 13 namespace thunk { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 bool CreateThreadAdapterForInstance(PP_Instance instance) { | 17 bool CreateThreadAdapterForInstance(PP_Instance instance) { |
| 18 EnterInstance enter(instance); | 18 return true; |
|
yzshen1
2012/06/07 17:38:34
This is not true for in-process mode, right?
So we
| |
| 19 if (enter.failed()) | |
| 20 return false; | |
| 21 return enter.functions()->GetFlashAPI()->CreateThreadAdapterForInstance( | |
| 22 instance); | |
| 23 } | 19 } |
| 24 | 20 |
| 25 void ClearThreadAdapterForInstance(PP_Instance instance) { | 21 void ClearThreadAdapterForInstance(PP_Instance instance) { |
| 26 EnterInstance enter(instance); | |
| 27 if (enter.succeeded()) { | |
| 28 return enter.functions()->GetFlashAPI()->ClearThreadAdapterForInstance( | |
| 29 instance); | |
| 30 } | |
| 31 } | 22 } |
| 32 | 23 |
| 33 int32_t OpenFile(PP_Instance instance, | 24 int32_t OpenFile(PP_Instance instance, |
| 34 const char* path, | 25 const char* path, |
| 35 int32_t mode, | 26 int32_t mode, |
| 36 PP_FileHandle* file) { | 27 PP_FileHandle* file) { |
| 37 EnterInstance enter(instance); | 28 EnterInstance enter(instance); |
| 38 if (enter.failed()) | 29 if (enter.failed()) |
| 39 return PP_ERROR_BADARGUMENT; | 30 return PP_ERROR_BADARGUMENT; |
| 40 return enter.functions()->GetFlashAPI()->OpenFile(instance, path, mode, file); | 31 return enter.functions()->GetFlashAPI()->OpenFile(instance, path, mode, file); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 }; | 97 }; |
| 107 | 98 |
| 108 } // namespace | 99 } // namespace |
| 109 | 100 |
| 110 const PPB_Flash_File_ModuleLocal* GetPPB_Flash_File_ModuleLocal_Thunk() { | 101 const PPB_Flash_File_ModuleLocal* GetPPB_Flash_File_ModuleLocal_Thunk() { |
| 111 return &g_ppb_flash_file_modulelocal_thunk; | 102 return &g_ppb_flash_file_modulelocal_thunk; |
| 112 } | 103 } |
| 113 | 104 |
| 114 } // namespace thunk | 105 } // namespace thunk |
| 115 } // namespace ppapi | 106 } // namespace ppapi |
| OLD | NEW |