| 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/instance.h" | 18 #include "ppapi/cpp/instance.h" |
| 19 #include "ppapi/cpp/var.h" | 19 #include "ppapi/cpp/var.h" |
| 20 #include "remoting/client/client_context.h" | 20 #include "remoting/client/client_context.h" |
| 21 #include "remoting/client/plugin/chromoting_scriptable_object.h" | 21 #include "remoting/client/plugin/chromoting_scriptable_object.h" |
| 22 #include "remoting/client/plugin/pepper_client_logger.h" |
| 22 #include "remoting/protocol/connection_to_host.h" | 23 #include "remoting/protocol/connection_to_host.h" |
| 23 | 24 |
| 24 class MessageLoop; | 25 class MessageLoop; |
| 25 struct PP_InputEvent; | 26 struct PP_InputEvent; |
| 26 | 27 |
| 27 namespace base { | 28 namespace base { |
| 28 class Thread; | 29 class Thread; |
| 29 } // namespace base | 30 } // namespace base |
| 30 | 31 |
| 31 namespace pp { | 32 namespace pp { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Convenience wrapper to get the ChromotingScriptableObject. | 79 // Convenience wrapper to get the ChromotingScriptableObject. |
| 79 ChromotingScriptableObject* GetScriptableObject(); | 80 ChromotingScriptableObject* GetScriptableObject(); |
| 80 | 81 |
| 81 // Called by ChromotingScriptableObject to provide username and password. | 82 // Called by ChromotingScriptableObject to provide username and password. |
| 82 void SubmitLoginInfo(const std::string& username, | 83 void SubmitLoginInfo(const std::string& username, |
| 83 const std::string& password); | 84 const std::string& password); |
| 84 | 85 |
| 85 // Called by ChromotingScriptableObject to set scale-to-fit. | 86 // Called by ChromotingScriptableObject to set scale-to-fit. |
| 86 void SetScaleToFit(bool scale_to_fit); | 87 void SetScaleToFit(bool scale_to_fit); |
| 87 | 88 |
| 88 void LogDebugInfo(const std::string& info); | 89 void Log(int severity, const char* format, ...); |
| 90 void VLog(int verboselevel, const char* format, ...); |
| 89 | 91 |
| 90 // Return statistics record by ChromotingClient. | 92 // Return statistics record by ChromotingClient. |
| 91 // If no connection is currently active then NULL will be returned. | 93 // If no connection is currently active then NULL will be returned. |
| 92 ChromotingStats* GetStats(); | 94 ChromotingStats* GetStats(); |
| 93 | 95 |
| 94 private: | 96 private: |
| 95 FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup); | 97 FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup); |
| 96 | 98 |
| 97 bool initialized_; | 99 bool initialized_; |
| 98 | 100 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 111 scoped_refptr<RectangleUpdateDecoder> rectangle_decoder_; | 113 scoped_refptr<RectangleUpdateDecoder> rectangle_decoder_; |
| 112 scoped_ptr<InputHandler> input_handler_; | 114 scoped_ptr<InputHandler> input_handler_; |
| 113 scoped_ptr<ChromotingClient> client_; | 115 scoped_ptr<ChromotingClient> client_; |
| 114 | 116 |
| 115 // XmppProxy is a refcounted interface used to perform thread-switching and | 117 // XmppProxy is a refcounted interface used to perform thread-switching and |
| 116 // detaching between objects whose lifetimes are controlled by pepper, and | 118 // detaching between objects whose lifetimes are controlled by pepper, and |
| 117 // jingle_glue objects. This is used when if we start a sandboxed jingle | 119 // jingle_glue objects. This is used when if we start a sandboxed jingle |
| 118 // connection. | 120 // connection. |
| 119 scoped_refptr<PepperXmppProxy> xmpp_proxy_; | 121 scoped_refptr<PepperXmppProxy> xmpp_proxy_; |
| 120 | 122 |
| 123 PepperClientLogger logger_; |
| 124 |
| 121 // JavaScript interface to control this instance. | 125 // JavaScript interface to control this instance. |
| 122 // This wraps a ChromotingScriptableObject in a pp::Var. | 126 // This wraps a ChromotingScriptableObject in a pp::Var. |
| 123 pp::Var instance_object_; | 127 pp::Var instance_object_; |
| 124 | 128 |
| 125 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 129 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
| 126 }; | 130 }; |
| 127 | 131 |
| 128 } // namespace remoting | 132 } // namespace remoting |
| 129 | 133 |
| 130 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 134 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| OLD | NEW |