| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "ppapi/c/pp_instance.h" | 15 #include "ppapi/c/pp_instance.h" |
| 16 #include "ppapi/c/pp_rect.h" | 16 #include "ppapi/c/pp_rect.h" |
| 17 #include "ppapi/c/pp_resource.h" | 17 #include "ppapi/c/pp_resource.h" |
| 18 #include "ppapi/cpp/var.h" | 18 #include "ppapi/cpp/var.h" |
| 19 #include "ppapi/cpp/private/instance_private.h" | 19 #include "ppapi/cpp/private/instance_private.h" |
| 20 #include "remoting/base/scoped_thread_proxy.h" | 20 #include "remoting/base/scoped_thread_proxy.h" |
| 21 #include "remoting/client/client_context.h" | 21 #include "remoting/client/client_context.h" |
| 22 #include "remoting/client/plugin/chromoting_scriptable_object.h" | 22 #include "remoting/client/plugin/chromoting_scriptable_object.h" |
| 23 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h" | 23 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h" |
| 24 #include "remoting/protocol/connection_to_host.h" | 24 #include "remoting/protocol/connection_to_host.h" |
| 25 | 25 |
| 26 namespace base { | |
| 27 class Thread; | |
| 28 } // namespace base | |
| 29 | |
| 30 namespace pp { | 26 namespace pp { |
| 31 class InputEvent; | 27 class InputEvent; |
| 32 class Module; | 28 class Module; |
| 33 } // namespace pp | 29 } // namespace pp |
| 34 | 30 |
| 35 namespace remoting { | 31 namespace remoting { |
| 36 | 32 |
| 37 namespace protocol { | 33 namespace protocol { |
| 38 class ConnectionToHost; | 34 class ConnectionToHost; |
| 39 } // namespace protocol | 35 } // namespace protocol |
| 40 | 36 |
| 41 class ChromotingClient; | 37 class ChromotingClient; |
| 42 class ChromotingStats; | 38 class ChromotingStats; |
| 43 class ClientContext; | 39 class ClientContext; |
| 44 class InputHandler; | 40 class InputHandler; |
| 45 class JingleThread; | |
| 46 class PepperView; | 41 class PepperView; |
| 47 class PepperViewProxy; | 42 class PepperViewProxy; |
| 48 class RectangleUpdateDecoder; | 43 class RectangleUpdateDecoder; |
| 49 | 44 |
| 50 struct ClientConfig; | 45 struct ClientConfig; |
| 51 | 46 |
| 52 namespace protocol { | |
| 53 class HostConnection; | |
| 54 } // namespace protocol | |
| 55 | |
| 56 class ChromotingInstance : public pp::InstancePrivate { | 47 class ChromotingInstance : public pp::InstancePrivate { |
| 57 public: | 48 public: |
| 58 // The mimetype for which this plugin is registered. | 49 // The mimetype for which this plugin is registered. |
| 59 static const char kMimeType[]; | 50 static const char kMimeType[]; |
| 60 | 51 |
| 61 explicit ChromotingInstance(PP_Instance instance); | 52 explicit ChromotingInstance(PP_Instance instance); |
| 62 virtual ~ChromotingInstance(); | 53 virtual ~ChromotingInstance(); |
| 63 | 54 |
| 64 // pp::Instance interface. | 55 // pp::Instance interface. |
| 65 virtual void DidChangeView(const pp::Rect& position, | 56 virtual void DidChangeView(const pp::Rect& position, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // Unregisters this instance so that debug log messages will no longer be sent | 94 // Unregisters this instance so that debug log messages will no longer be sent |
| 104 // to it. If this instance is not the currently registered logging instance, | 95 // to it. If this instance is not the currently registered logging instance, |
| 105 // then the currently registered instance will stay in effect. | 96 // then the currently registered instance will stay in effect. |
| 106 void UnregisterLoggingInstance(); | 97 void UnregisterLoggingInstance(); |
| 107 | 98 |
| 108 // A Log Message Handler that is called after each LOG message has been | 99 // A Log Message Handler that is called after each LOG message has been |
| 109 // processed. This must be of type LogMessageHandlerFunction defined in | 100 // processed. This must be of type LogMessageHandlerFunction defined in |
| 110 // base/logging.h. | 101 // base/logging.h. |
| 111 static bool LogToUI(int severity, const char* file, int line, | 102 static bool LogToUI(int severity, const char* file, int line, |
| 112 size_t message_start, const std::string& str); | 103 size_t message_start, const std::string& str); |
| 104 |
| 113 private: | 105 private: |
| 114 FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup); | 106 FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup); |
| 115 | 107 |
| 116 void ProcessLogToUI(const std::string& message); | 108 void ProcessLogToUI(const std::string& message); |
| 117 | 109 |
| 118 bool initialized_; | 110 bool initialized_; |
| 119 | 111 |
| 120 PepperPluginThreadDelegate plugin_thread_delegate_; | 112 PepperPluginThreadDelegate plugin_thread_delegate_; |
| 121 scoped_refptr<PluginMessageLoopProxy> plugin_message_loop_; | 113 scoped_refptr<PluginMessageLoopProxy> plugin_message_loop_; |
| 122 ClientContext context_; | 114 ClientContext context_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 149 pp::Var instance_object_; | 141 pp::Var instance_object_; |
| 150 | 142 |
| 151 scoped_ptr<ScopedThreadProxy> thread_proxy_; | 143 scoped_ptr<ScopedThreadProxy> thread_proxy_; |
| 152 | 144 |
| 153 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 145 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
| 154 }; | 146 }; |
| 155 | 147 |
| 156 } // namespace remoting | 148 } // namespace remoting |
| 157 | 149 |
| 158 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 150 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| OLD | NEW |