diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 13:34:08 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 13:34:08 +0000 |
commit | c708db4675caea8773ccf88a5762d33035073e2d (patch) | |
tree | 643c56b05e66b960af36fc8964be555dc6a3554c /remoting/client/plugin/chromoting_plugin.h | |
parent | 0520e8a4859a2bb806638c00aa03daf5612d50dc (diff) | |
download | chromium_src-c708db4675caea8773ccf88a5762d33035073e2d.zip chromium_src-c708db4675caea8773ccf88a5762d33035073e2d.tar.gz chromium_src-c708db4675caea8773ccf88a5762d33035073e2d.tar.bz2 |
Reapply r51857 to start building chromoting plugin. Update for ppapi changes.
This should work now after the ppapi roll to r164 that fixes the
-fvisibility=hidden being removed in the linux shlib build.
Original Review here: http://codereview.chromium.org/2858037
BUG=none
TEST=try bots + local run of PPAPITest with a shared_library build.
Review URL: http://codereview.chromium.org/3038001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52658 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/plugin/chromoting_plugin.h')
-rw-r--r-- | remoting/client/plugin/chromoting_plugin.h | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/remoting/client/plugin/chromoting_plugin.h b/remoting/client/plugin/chromoting_plugin.h index 757e038..0aac051 100644 --- a/remoting/client/plugin/chromoting_plugin.h +++ b/remoting/client/plugin/chromoting_plugin.h @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// TODO(ajwong): We need to come up with a better description of the +// responsibilities for each thread. + #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_PLUGIN_H_ #define REMOTING_CLIENT_PLUGIN_CHROMOTING_PLUGIN_H_ @@ -15,12 +18,19 @@ #include "third_party/ppapi/c/pp_instance.h" #include "third_party/ppapi/c/pp_rect.h" #include "third_party/ppapi/c/pp_resource.h" -#include "third_party/ppapi/c/ppb_instance.h" +#include "third_party/ppapi/cpp/instance.h" +#include "third_party/ppapi/cpp/device_context_2d.h" + +class MessageLoop; namespace base { class Thread; } // namespace base +namespace pp { +class Module; +} // namespace pp + namespace remoting { class ChromotingClient; @@ -28,23 +38,20 @@ class HostConnection; class JingleThread; class PepperView; -class ChromotingClient; - -class ChromotingPlugin { +class ChromotingPlugin : public pp::Instance { public: // The mimetype for which this plugin is registered. - // - // TODO(ajwong): Mimetype doesn't really make sense for us as the trigger - // point. I think we should handle a special protocol (eg., chromotocol://) static const char *kMimeType; - ChromotingPlugin(PP_Instance instance, const PPB_Instance* instance_funcs); + ChromotingPlugin(PP_Instance instance); virtual ~ChromotingPlugin(); virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); virtual bool HandleEvent(const PP_Event& event); virtual void ViewChanged(const PP_Rect& position, const PP_Rect& clip); + virtual bool CurrentlyOnPluginThread() const; + private: FRIEND_TEST(ChromotingPluginTest, ParseUrl); FRIEND_TEST(ChromotingPluginTest, TestCaseSetup); @@ -54,14 +61,13 @@ class ChromotingPlugin { std::string* auth_token, std::string* host_jid); - // Size of the plugin window. - int width_; - int height_; - - PP_Resource drawing_context_; - - PP_Instance pp_instance_; - const PPB_Instance* ppb_instance_funcs_; + // Since we're an internal plugin, we can just grab the message loop during + // init to figure out which thread we're on. This should only be used to + // sanity check which thread we're executing on. Do not post task here! + // Instead, use PPB_Core:CallOnMainThread() in the pepper api. + // + // TODO(ajwong): Think if there is a better way to safeguard this. + MessageLoop* pepper_main_loop_dont_post_to_me_; scoped_ptr<base::Thread> main_thread_; scoped_ptr<JingleThread> network_thread_; |