From 1609d0d3a7d5b0f3777702308a440b22f1b42b59 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Fri, 15 Apr 2011 22:06:21 +0000 Subject: Support PPB_Flash_ModileLocal blocking calls from background threads. This is a temporary stopgap to allow these specific functions to be used until the entire proxy can support threading. There are two functions that set up and clean up the routing information in the interface. These are necessary because the global dispatcher routing information is not threadsafe. When used from the main thread, the code works the same as before. When used from a background thread, we create a sync message, send it to the I/O thread, and block the sending thread until the reply is received. There is no handling of other incoming blocking messages (which are impossible), and no other Pepper functions are supported from the background thread. TEST=manual BUG=none Review URL: http://codereview.chromium.org/6875009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81814 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/plugins/ppapi/ppb_flash_file_impl.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'webkit/plugins') diff --git a/webkit/plugins/ppapi/ppb_flash_file_impl.cc b/webkit/plugins/ppapi/ppb_flash_file_impl.cc index 48e4ab0..cf657a9 100644 --- a/webkit/plugins/ppapi/ppb_flash_file_impl.cc +++ b/webkit/plugins/ppapi/ppb_flash_file_impl.cc @@ -72,6 +72,13 @@ void FreeDirContents(PP_Instance instance, PP_DirContents_Dev* contents) { namespace { +bool CreateThreadAdapterForInstance(PP_Instance instance) { + return false; // No multithreaded access allowed. +} + +void ClearThreadAdapterForInstance(PP_Instance instance) { +} + int32_t OpenModuleLocalFile(PP_Instance pp_instance, const char* path, int32_t mode, @@ -205,6 +212,8 @@ int32_t GetModuleLocalDirContents(PP_Instance pp_instance, } const PPB_Flash_File_ModuleLocal ppb_flash_file_modulelocal = { + &CreateThreadAdapterForInstance, + &ClearThreadAdapterForInstance, &OpenModuleLocalFile, &RenameModuleLocalFile, &DeleteModuleLocalFileOrDir, -- cgit v1.1