diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 21:01:41 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 21:01:41 +0000 |
commit | 6ad63ef9d55f4b7a1997f27b3347ba1a79a49f49 (patch) | |
tree | 771226ba88e7e4f979b326d6407d087ead356f3c /webkit/glue/plugins/pepper_plugin_module.cc | |
parent | 32369d763913881d4afbab0ef8c6c769d22cad96 (diff) | |
download | chromium_src-6ad63ef9d55f4b7a1997f27b3347ba1a79a49f49.zip chromium_src-6ad63ef9d55f4b7a1997f27b3347ba1a79a49f49.tar.gz chromium_src-6ad63ef9d55f4b7a1997f27b3347ba1a79a49f49.tar.bz2 |
Add hook into pepper to query if running on the main thread.
Useful for plugins that make heavy use of background threads.
Review URL: http://codereview.chromium.org/3104031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/pepper_plugin_module.cc')
-rw-r--r-- | webkit/glue/plugins/pepper_plugin_module.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webkit/glue/plugins/pepper_plugin_module.cc b/webkit/glue/plugins/pepper_plugin_module.cc index 3b44868..6af71dc 100644 --- a/webkit/glue/plugins/pepper_plugin_module.cc +++ b/webkit/glue/plugins/pepper_plugin_module.cc @@ -120,13 +120,18 @@ void CallOnMainThread(int delay_in_msec, delay_in_msec); } +bool IsMainThread() { + return GetMainThreadMessageLoop()->BelongsToCurrentThread(); +} + const PPB_Core core_interface = { &AddRefResource, &ReleaseResource, &MemAlloc, &MemFree, &GetTime, - &CallOnMainThread + &CallOnMainThread, + &IsMainThread }; // PPB_Testing ----------------------------------------------------------------- |