| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ | 5 #ifndef BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ |
| 6 #define BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ | 6 #define BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "blimp/client/core/session/client_network_components.h" | 15 #include "blimp/client/core/session/client_network_components.h" |
| 16 #include "blimp/client/core/session/identity_source.h" | 16 #include "blimp/client/core/session/identity_source.h" |
| 17 #include "blimp/client/core/session/network_event_observer.h" | 17 #include "blimp/client/core/session/network_event_observer.h" |
| 18 #include "blimp/client/public/blimp_client_context.h" | 18 #include "blimp/client/public/blimp_client_context.h" |
| 19 #include "blimp/client/public/contents/blimp_contents.h" | 19 #include "blimp/client/public/contents/blimp_contents.h" |
| 20 #include "blimp/client/public/session/assignment.h" | 20 #include "blimp/client/public/session/assignment.h" |
| 21 #include "blimp/net/thread_pipe_manager.h" | 21 #include "blimp/net/thread_pipe_manager.h" |
| 22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 23 | 23 |
| 24 namespace blimp { | 24 namespace blimp { |
| 25 namespace client { | 25 namespace client { |
| 26 | 26 |
| 27 class BlimpContentsManager; | 27 class BlimpContentsManager; |
| 28 class ImeFeature; |
| 29 class NavigationFeature; |
| 28 class TabControlFeature; | 30 class TabControlFeature; |
| 29 | 31 |
| 30 // BlimpClientContextImpl is the implementation of the main context-class for | 32 // BlimpClientContextImpl is the implementation of the main context-class for |
| 31 // the blimp client. | 33 // the blimp client. |
| 32 class BlimpClientContextImpl : public BlimpClientContext, | 34 class BlimpClientContextImpl : public BlimpClientContext, |
| 33 public NetworkEventObserver { | 35 public NetworkEventObserver { |
| 34 public: | 36 public: |
| 35 // The |io_thread_task_runner| must be the task runner to use for IO | 37 // The |io_thread_task_runner| must be the task runner to use for IO |
| 36 // operations. | 38 // operations. |
| 37 // The |file_thread_task_runner| must be the task runner to use for file | 39 // The |file_thread_task_runner| must be the task runner to use for file |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // The task runner to use for IO operations. | 76 // The task runner to use for IO operations. |
| 75 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; | 77 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; |
| 76 | 78 |
| 77 // The task runner to use for file operations. | 79 // The task runner to use for file operations. |
| 78 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_; | 80 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_; |
| 79 | 81 |
| 80 // The AssignmentSource is used when the user of BlimpClientContextImpl calls | 82 // The AssignmentSource is used when the user of BlimpClientContextImpl calls |
| 81 // Connect() to get a valid assignment and later connect to the engine. | 83 // Connect() to get a valid assignment and later connect to the engine. |
| 82 std::unique_ptr<AssignmentSource> assignment_source_; | 84 std::unique_ptr<AssignmentSource> assignment_source_; |
| 83 | 85 |
| 86 // Features to handle all incoming and outgoing protobuf messages. |
| 87 std::unique_ptr<ImeFeature> ime_feature_; |
| 88 std::unique_ptr<NavigationFeature> navigation_feature_; |
| 84 std::unique_ptr<TabControlFeature> tab_control_feature_; | 89 std::unique_ptr<TabControlFeature> tab_control_feature_; |
| 85 | 90 |
| 86 std::unique_ptr<BlimpContentsManager> blimp_contents_manager_; | 91 std::unique_ptr<BlimpContentsManager> blimp_contents_manager_; |
| 87 | 92 |
| 88 // Container struct for network components. | 93 // Container struct for network components. |
| 89 // Must be deleted on the IO thread. | 94 // Must be deleted on the IO thread. |
| 90 std::unique_ptr<ClientNetworkComponents> net_components_; | 95 std::unique_ptr<ClientNetworkComponents> net_components_; |
| 91 | 96 |
| 92 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; | 97 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; |
| 93 | 98 |
| 94 // Provide OAuth2 token and propagate account sign in states change. | 99 // Provide OAuth2 token and propagate account sign in states change. |
| 95 std::unique_ptr<IdentitySource> identity_source_; | 100 std::unique_ptr<IdentitySource> identity_source_; |
| 96 | 101 |
| 97 base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_; | 102 base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_; |
| 98 | 103 |
| 99 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl); | 104 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl); |
| 100 }; | 105 }; |
| 101 | 106 |
| 102 } // namespace client | 107 } // namespace client |
| 103 } // namespace blimp | 108 } // namespace blimp |
| 104 | 109 |
| 105 #endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ | 110 #endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ |
| OLD | NEW |