OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // TODO(ajwong): We need to come up with a better description of the | 5 // TODO(ajwong): We need to come up with a better description of the |
6 // responsibilities for each thread. | 6 // responsibilities for each thread. |
7 | 7 |
8 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 8 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
9 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 9 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class ChromotingInstance : public pp::Instance { | 43 class ChromotingInstance : public pp::Instance { |
44 public: | 44 public: |
45 // The mimetype for which this plugin is registered. | 45 // The mimetype for which this plugin is registered. |
46 static const char *kMimeType; | 46 static const char *kMimeType; |
47 | 47 |
48 explicit ChromotingInstance(PP_Instance instance); | 48 explicit ChromotingInstance(PP_Instance instance); |
49 virtual ~ChromotingInstance(); | 49 virtual ~ChromotingInstance(); |
50 | 50 |
51 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); | 51 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); |
52 virtual void Connect(const ClientConfig& config); | 52 virtual void Connect(const ClientConfig& config); |
53 virtual bool HandleEvent(const PP_InputEvent& event); | 53 virtual bool HandleInputEvent(const PP_InputEvent& event); |
54 virtual pp::Var GetInstanceObject(); | 54 virtual pp::Var GetInstanceObject(); |
55 virtual void ViewChanged(const pp::Rect& position, const pp::Rect& clip); | 55 virtual void ViewChanged(const pp::Rect& position, const pp::Rect& clip); |
56 | 56 |
57 virtual bool CurrentlyOnPluginThread() const; | 57 virtual bool CurrentlyOnPluginThread() const; |
58 | 58 |
59 private: | 59 private: |
60 FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup); | 60 FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup); |
61 | 61 |
62 // Since we're an internal plugin, we can just grab the message loop during | 62 // Since we're an internal plugin, we can just grab the message loop during |
63 // init to figure out which thread we're on. This should only be used to | 63 // init to figure out which thread we're on. This should only be used to |
64 // sanity check which thread we're executing on. Do not post task here! | 64 // sanity check which thread we're executing on. Do not post task here! |
65 // Instead, use PPB_Core:CallOnMainThread() in the pepper api. | 65 // Instead, use PPB_Core:CallOnMainThread() in the pepper api. |
66 // | 66 // |
67 // TODO(ajwong): Think if there is a better way to safeguard this. | 67 // TODO(ajwong): Think if there is a better way to safeguard this. |
68 MessageLoop* pepper_main_loop_dont_post_to_me_; | 68 MessageLoop* pepper_main_loop_dont_post_to_me_; |
69 | 69 |
70 ClientContext context_; | 70 ClientContext context_; |
71 scoped_ptr<HostConnection> host_connection_; | 71 scoped_ptr<HostConnection> host_connection_; |
72 scoped_ptr<PepperView> view_; | 72 scoped_ptr<PepperView> view_; |
73 scoped_ptr<InputHandler> input_handler_; | 73 scoped_ptr<InputHandler> input_handler_; |
74 scoped_ptr<ChromotingClient> client_; | 74 scoped_ptr<ChromotingClient> client_; |
75 pp::Var instance_object_; // JavaScript interface to control this instance. | 75 pp::Var instance_object_; // JavaScript interface to control this instance. |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 77 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace remoting | 80 } // namespace remoting |
81 | 81 |
82 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 82 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
OLD | NEW |