| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 5 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 6 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 // protocol::CursorShapeStub interface. | 130 // protocol::CursorShapeStub interface. |
| 131 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; | 131 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; |
| 132 | 132 |
| 133 // PepperVideoRenderer::EventHandler interface. | 133 // PepperVideoRenderer::EventHandler interface. |
| 134 void OnVideoDecodeError() override; | 134 void OnVideoDecodeError() override; |
| 135 void OnVideoFirstFrameReceived() override; | 135 void OnVideoFirstFrameReceived() override; |
| 136 void OnVideoFrameDirtyRegion( | 136 void OnVideoFrameDirtyRegion( |
| 137 const webrtc::DesktopRegion& dirty_region) override; | 137 const webrtc::DesktopRegion& dirty_region) override; |
| 138 | 138 |
| 139 // Registers a global log message handler that redirects the log output to | 139 // Registers a global log message listener that redirects the log output to |
| 140 // our plugin instance. | 140 // our plugin instance. |
| 141 // This is called by the plugin's PPP_InitializeModule. | 141 // This is called by the plugin's PPP_InitializeModule. |
| 142 // Note that no logging will be processed unless a ChromotingInstance has been | 142 // Note that no logging will be processed unless a ChromotingInstance has been |
| 143 // registered for logging (see RegisterLoggingInstance). | 143 // registered for logging (see RegisterLoggingInstance). |
| 144 static void RegisterLogMessageHandler(); | 144 static void RegisterLogMessageListener(); |
| 145 | 145 |
| 146 // Registers this instance so it processes messages sent by the global log | 146 // Registers this instance so it processes messages sent by the global log |
| 147 // message handler. This overwrites any previously registered instance. | 147 // message handler. This overwrites any previously registered instance. |
| 148 void RegisterLoggingInstance(); | 148 void RegisterLoggingInstance(); |
| 149 | 149 |
| 150 // Unregisters this instance so that debug log messages will no longer be sent | 150 // Unregisters this instance so that debug log messages will no longer be sent |
| 151 // to it. If this instance is not the currently registered logging instance, | 151 // to it. If this instance is not the currently registered logging instance, |
| 152 // then the currently registered instance will stay in effect. | 152 // then the currently registered instance will stay in effect. |
| 153 void UnregisterLoggingInstance(); | 153 void UnregisterLoggingInstance(); |
| 154 | 154 |
| 155 // A Log Message Handler that is called after each LOG message has been | 155 // A Log Message Listener that is called after each LOG message has been |
| 156 // processed. This must be of type LogMessageHandlerFunction defined in | 156 // processed. This must be of type LogMessageListenerFunction defined in |
| 157 // base/logging.h. | 157 // base/logging.h. |
| 158 static bool LogToUI(int severity, const char* file, int line, | 158 static void LogToUI(int severity, const char* file, int line, |
| 159 size_t message_start, const std::string& str); | 159 size_t message_start, const std::string& str); |
| 160 | 160 |
| 161 // Requests the webapp to fetch a third-party token. | 161 // Requests the webapp to fetch a third-party token. |
| 162 void FetchThirdPartyToken( | 162 void FetchThirdPartyToken( |
| 163 const std::string& host_public_key, | 163 const std::string& host_public_key, |
| 164 const std::string& token_url, | 164 const std::string& token_url, |
| 165 const std::string& scope, | 165 const std::string& scope, |
| 166 const protocol::ThirdPartyTokenFetchedCallback& token_fetched_callback); | 166 const protocol::ThirdPartyTokenFetchedCallback& token_fetched_callback); |
| 167 | 167 |
| 168 // Updates the specified UMA enumeration histogram with the input value. | 168 // Updates the specified UMA enumeration histogram with the input value. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 292 |
| 293 // Weak reference to this instance, used for global logging and task posting. | 293 // Weak reference to this instance, used for global logging and task posting. |
| 294 base::WeakPtrFactory<ChromotingInstance> weak_factory_; | 294 base::WeakPtrFactory<ChromotingInstance> weak_factory_; |
| 295 | 295 |
| 296 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 296 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
| 297 }; | 297 }; |
| 298 | 298 |
| 299 } // namespace remoting | 299 } // namespace remoting |
| 300 | 300 |
| 301 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 301 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| OLD | NEW |