| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_CLIENT_IOS_APP_RUNTIME_H_ |
| 6 #define REMOTING_CLIENT_IOS_APP_RUNTIME_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "base/bind.h" |
| 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/message_loop/message_loop.h" |
| 16 #include "remoting/base/auto_thread.h" |
| 17 #include "remoting/client/chromoting_client_runtime.h" |
| 18 |
| 19 // TODO(nicholss): Saving this for a pending CL that introduces audio. |
| 20 //#include "remoting/client/ios/audio_player_ios.h" |
| 21 |
| 22 namespace remoting { |
| 23 namespace ios { |
| 24 |
| 25 class AppRuntime { |
| 26 public: |
| 27 AppRuntime(); |
| 28 |
| 29 scoped_refptr<AutoThreadTaskRunner> display_task_runner() { |
| 30 return runtime_->ui_task_runner(); |
| 31 } |
| 32 |
| 33 scoped_refptr<AutoThreadTaskRunner> network_task_runner() { |
| 34 return runtime_->network_task_runner(); |
| 35 } |
| 36 |
| 37 scoped_refptr<AutoThreadTaskRunner> file_task_runner() { |
| 38 return runtime_->file_task_runner(); |
| 39 } |
| 40 |
| 41 // TODO(nicholss): Saving this for a pending CL that introduces audio. |
| 42 // scoped_refptr<AutoThreadTaskRunner> audio_task_runner() { |
| 43 // return _runtime->audio_task_runner(); |
| 44 // } |
| 45 |
| 46 private: |
| 47 // This object is ref-counted, so it cleans itself up. |
| 48 ~AppRuntime(); |
| 49 |
| 50 // TODO(nicholss): Saving this for a pending CL that introduces GL rendering. |
| 51 // void SetupOpenGl(); |
| 52 |
| 53 // Chromium code's connection to the OBJ_C message loop. Once created the |
| 54 // MessageLoop will live for the life of the program. An attempt was made to |
| 55 // create the primary message loop earlier in the programs life, but a |
| 56 // MessageLoop requires ARC to be disabled. |
| 57 std::unique_ptr<base::MessageLoopForUI> ui_loop_; |
| 58 |
| 59 std::unique_ptr<remoting::ChromotingClientRuntime> runtime_; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(AppRuntime); |
| 62 }; |
| 63 |
| 64 } // namespace ios |
| 65 } // namespace remoting |
| 66 |
| 67 #endif // REMOTING_CLIENT_IOS_APP_RUNTIME_H_ |
| OLD | NEW |