summaryrefslogtreecommitdiffstats
path: root/ppapi/c/private
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 22:06:21 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 22:06:21 +0000
commit1609d0d3a7d5b0f3777702308a440b22f1b42b59 (patch)
tree754be1a35ea8faa52a8dbb6a63264a2f686bea64 /ppapi/c/private
parent54457f38c36e43d9f5d434e5bfc3cb83d9e56926 (diff)
downloadchromium_src-1609d0d3a7d5b0f3777702308a440b22f1b42b59.zip
chromium_src-1609d0d3a7d5b0f3777702308a440b22f1b42b59.tar.gz
chromium_src-1609d0d3a7d5b0f3777702308a440b22f1b42b59.tar.bz2
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
Diffstat (limited to 'ppapi/c/private')
-rw-r--r--ppapi/c/private/ppb_flash_file.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/ppapi/c/private/ppb_flash_file.h b/ppapi/c/private/ppb_flash_file.h
index 9b674fa..b545128a 100644
--- a/ppapi/c/private/ppb_flash_file.h
+++ b/ppapi/c/private/ppb_flash_file.h
@@ -36,12 +36,26 @@ struct PP_DirContents_Dev {
// PPB_Flash_File_ModuleLocal --------------------------------------------------
-#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE "PPB_Flash_File_ModuleLocal;1"
+#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE "PPB_Flash_File_ModuleLocal;2"
// This interface provides (for Flash) synchronous access to module-local files.
// Module-local file paths are '/'-separated UTF-8 strings, relative to a
// module-specific root.
struct PPB_Flash_File_ModuleLocal {
+ // Does initialization necessary for proxying this interface on background
+ // threads. You must always call this function before using any other
+ // function in this interface for a given instance ID.
+ //
+ // Returns true if multithreaded access is supported. In this case you can
+ // use the rest of the functions from background threads. You may not call
+ // GetInterface or do any other PPAPI operations on background threads at
+ // this time.
+ bool (*CreateThreadAdapterForInstance)(PP_Instance instance);
+
+ // Call when an instance is destroyed when you've previously called
+ // CreateThreadAdapterForInstance.
+ void (*ClearThreadAdapterForInstance)(PP_Instance instance);
+
// Opens a file, returning a file descriptor (posix) or a HANDLE (win32) into
// file. The return value is the ppapi error, PP_OK if success, one of the
// PP_ERROR_* in case of failure.