| OLD | NEW | 
|   1 // Copyright 2013 The Chromium Authors. All rights reserved. |   1 // Copyright 2013 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_HOST_HOST_WINDOW_PROXY_H_ |   5 #ifndef REMOTING_HOST_HOST_WINDOW_PROXY_H_ | 
|   6 #define REMOTING_HOST_HOST_WINDOW_PROXY_H_ |   6 #define REMOTING_HOST_HOST_WINDOW_PROXY_H_ | 
|   7  |   7  | 
 |   8 #include <memory> | 
 |   9  | 
|   8 #include "base/macros.h" |  10 #include "base/macros.h" | 
|   9 #include "base/memory/ref_counted.h" |  11 #include "base/memory/ref_counted.h" | 
|  10 #include "base/memory/scoped_ptr.h" |  | 
|  11 #include "base/memory/weak_ptr.h" |  12 #include "base/memory/weak_ptr.h" | 
|  12 #include "remoting/host/host_window.h" |  13 #include "remoting/host/host_window.h" | 
|  13  |  14  | 
|  14 namespace base { |  15 namespace base { | 
|  15 class SingleThreadTaskRunner; |  16 class SingleThreadTaskRunner; | 
|  16 } |  17 } | 
|  17  |  18  | 
|  18 namespace remoting { |  19 namespace remoting { | 
|  19  |  20  | 
|  20 // Takes an instance of |HostWindow| and runs it on the |ui_task_runner| thread. |  21 // Takes an instance of |HostWindow| and runs it on the |ui_task_runner| thread. | 
|  21 class HostWindowProxy : public HostWindow { |  22 class HostWindowProxy : public HostWindow { | 
|  22  public: |  23  public: | 
|  23   HostWindowProxy( |  24   HostWindowProxy( | 
|  24       scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |  25       scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 
|  25       scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |  26       scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 
|  26       scoped_ptr<HostWindow> host_window); |  27       std::unique_ptr<HostWindow> host_window); | 
|  27   ~HostWindowProxy() override; |  28   ~HostWindowProxy() override; | 
|  28  |  29  | 
|  29   // HostWindow overrides. |  30   // HostWindow overrides. | 
|  30   void Start(const base::WeakPtr<ClientSessionControl>& client_session_control) |  31   void Start(const base::WeakPtr<ClientSessionControl>& client_session_control) | 
|  31       override; |  32       override; | 
|  32  |  33  | 
|  33  private: |  34  private: | 
|  34   // All thread switching logic is implemented in the ref-counted |Core| class. |  35   // All thread switching logic is implemented in the ref-counted |Core| class. | 
|  35   class Core; |  36   class Core; | 
|  36   scoped_refptr<Core> core_; |  37   scoped_refptr<Core> core_; | 
|  37  |  38  | 
|  38   DISALLOW_COPY_AND_ASSIGN(HostWindowProxy); |  39   DISALLOW_COPY_AND_ASSIGN(HostWindowProxy); | 
|  39 }; |  40 }; | 
|  40  |  41  | 
|  41 }  // namespace remoting |  42 }  // namespace remoting | 
|  42  |  43  | 
|  43 #endif  // REMOTING_HOST_HOST_WINDOW_PROXY_H_ |  44 #endif  // REMOTING_HOST_HOST_WINDOW_PROXY_H_ | 
| OLD | NEW |