| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 class DesktopSize; | 56 class DesktopSize; |
| 57 class DesktopVector; | 57 class DesktopVector; |
| 58 } // namespace webrtc | 58 } // namespace webrtc |
| 59 | 59 |
| 60 namespace remoting { | 60 namespace remoting { |
| 61 | 61 |
| 62 class PepperAudioPlayer; | 62 class PepperAudioPlayer; |
| 63 class ChromotingClient; | 63 class ChromotingClient; |
| 64 class ClientContext; | 64 class ClientContext; |
| 65 class DelegatingSignalStrategy; | 65 class DelegatingSignalStrategy; |
| 66 class LogToUI; |
| 66 class PepperAudioPlayer; | 67 class PepperAudioPlayer; |
| 67 class PepperMouseLocker; | 68 class PepperMouseLocker; |
| 68 | 69 |
| 69 class ChromotingInstance : public ClientUserInterface, | 70 class ChromotingInstance : public ClientUserInterface, |
| 70 public PepperVideoRenderer::EventHandler, | 71 public PepperVideoRenderer::EventHandler, |
| 71 public protocol::ClipboardStub, | 72 public protocol::ClipboardStub, |
| 72 public protocol::CursorShapeStub, | 73 public protocol::CursorShapeStub, |
| 73 public pp::Instance { | 74 public pp::Instance { |
| 74 public: | 75 public: |
| 75 // Plugin API version. This should be incremented whenever the API | 76 // Plugin API version. This should be incremented whenever the API |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 129 |
| 129 // protocol::CursorShapeStub interface. | 130 // protocol::CursorShapeStub interface. |
| 130 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; | 131 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; |
| 131 | 132 |
| 132 // PepperVideoRenderer::EventHandler interface. | 133 // PepperVideoRenderer::EventHandler interface. |
| 133 void OnVideoDecodeError() override; | 134 void OnVideoDecodeError() override; |
| 134 void OnVideoFirstFrameReceived() override; | 135 void OnVideoFirstFrameReceived() override; |
| 135 void OnVideoFrameDirtyRegion( | 136 void OnVideoFrameDirtyRegion( |
| 136 const webrtc::DesktopRegion& dirty_region) override; | 137 const webrtc::DesktopRegion& dirty_region) override; |
| 137 | 138 |
| 138 // 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 |
| 139 // our plugin instance. | 140 // our plugin instance. |
| 140 // This is called by the plugin's PPP_InitializeModule. | 141 // This is called by the plugin's PPP_InitializeModule. |
| 141 // 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 |
| 142 // registered for logging (see RegisterLoggingInstance). | 143 // registered for logging (see RegisterLoggingInstance). |
| 143 static void RegisterLogMessageHandler(); | 144 static void RegisterLogMessageListener(); |
| 144 | 145 |
| 145 // 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 |
| 146 // message handler. This overwrites any previously registered instance. | 147 // message handler. This overwrites any previously registered instance. |
| 147 void RegisterLoggingInstance(); | 148 void RegisterLoggingInstance(); |
| 148 | 149 |
| 149 // 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 |
| 150 // 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, |
| 151 // then the currently registered instance will stay in effect. | 152 // then the currently registered instance will stay in effect. |
| 152 void UnregisterLoggingInstance(); | 153 void UnregisterLoggingInstance(); |
| 153 | 154 |
| 154 // A Log Message Handler that is called after each LOG message has been | |
| 155 // processed. This must be of type LogMessageHandlerFunction defined in | |
| 156 // base/logging.h. | |
| 157 static bool LogToUI(int severity, const char* file, int line, | |
| 158 size_t message_start, const std::string& str); | |
| 159 | |
| 160 // Requests the webapp to fetch a third-party token. | 155 // Requests the webapp to fetch a third-party token. |
| 161 void FetchThirdPartyToken( | 156 void FetchThirdPartyToken( |
| 162 const std::string& host_public_key, | 157 const std::string& host_public_key, |
| 163 const std::string& token_url, | 158 const std::string& token_url, |
| 164 const std::string& scope, | 159 const std::string& scope, |
| 165 const protocol::ThirdPartyTokenFetchedCallback& token_fetched_callback); | 160 const protocol::ThirdPartyTokenFetchedCallback& token_fetched_callback); |
| 166 | 161 |
| 167 // Updates the specified UMA enumeration histogram with the input value. | 162 // Updates the specified UMA enumeration histogram with the input value. |
| 168 void UpdateUmaEnumHistogram(const std::string& histogram_name, | 163 void UpdateUmaEnumHistogram(const std::string& histogram_name, |
| 169 int64_t value, | 164 int64_t value, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 280 |
| 286 base::RepeatingTimer stats_update_timer_; | 281 base::RepeatingTimer stats_update_timer_; |
| 287 | 282 |
| 288 base::TimeTicks connection_started_time; | 283 base::TimeTicks connection_started_time; |
| 289 base::TimeTicks connection_authenticated_time_; | 284 base::TimeTicks connection_authenticated_time_; |
| 290 base::TimeTicks connection_connected_time_; | 285 base::TimeTicks connection_connected_time_; |
| 291 | 286 |
| 292 // Weak reference to this instance, used for global logging and task posting. | 287 // Weak reference to this instance, used for global logging and task posting. |
| 293 base::WeakPtrFactory<ChromotingInstance> weak_factory_; | 288 base::WeakPtrFactory<ChromotingInstance> weak_factory_; |
| 294 | 289 |
| 290 std::unique_ptr<LogToUI> log_to_ui_; |
| 291 |
| 295 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 292 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
| 296 }; | 293 }; |
| 297 | 294 |
| 298 } // namespace remoting | 295 } // namespace remoting |
| 299 | 296 |
| 300 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 297 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| OLD | NEW |